Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting German Umlauts to LaTeX

0 views
Skip to first unread message

Christian Herenz

unread,
Apr 20, 2007, 6:07:31 AM4/20/07
to help-gn...@gnu.org
Hello,
I am totally new to this eMail-List, so I hope this question does not
seem dumb, or so..

I write my LaTeX documents usually in emacs, that works very fine at my
personal computer. Since I am german, I use the UTF-8 encoding. I load
the package for UTF-8 encoding in TeX simply with
/usepackage[utf-8]{inputenc}, which really improves typing a lot (I am
german, so I use frequently umlauts and the szlig).

However, at the computer-terminals in our institute, they do not support
UTF-8. LaTeX gives me an error-message, that [utf-8] is not supported by
inputenc.

My idea was to convert the document into an UTF-8 free file. So that all
occurences of umlauts will be converted into the LaTeX equivalent (e.g.
ö to "o), and I could also compile the file on the debain-boxes at our
instiute.

I think that this could be achived with a few lines of code, but I am
somewhat new to customize emacs with elisp (havent done anything yet),
so could you please give me a hint or point me where to look.

Thanks in advance,
Christian from Germany


Daniel Rubin

unread,
Apr 20, 2007, 6:25:14 AM4/20/07
to help-gn...@gnu.org
Christian Herenz wrote:

Hi Christian,

it *might* be as easy as fetching the file `utf8.def' from a ctan
server and putting it in your personal `texmf' dir (say,
`~/texmf') to teach LaTeX UTF-8.

As for the conversion of your files, I have no better idea than
some replace-string sessions. There is a tool called `recode',
but I have no experience with it.

Also, have a look at `Input Methods' in the Emacs info manual.

Hope this is of some use, have fun
----Daniel

--
Daniel Rubin
daniel warum-ada de


Daniel Rubin

unread,
Apr 20, 2007, 6:48:28 AM4/20/07
to help-gn...@gnu.org
Daniel Rubin wrote:

Silly me, not thinking of that before:
Why don't you use IO-8859-1 encoding instead of UTF-8? It has all
the umlauts (but lacks the Euro sign, though).

Christian Herenz

unread,
Apr 20, 2007, 10:32:00 AM4/20/07
to Daniel Rubin, help-gn...@gnu.org
Daniel Rubin schrieb:

>
> Silly me, not thinking of that before:
> Why don't you use IO-8859-1 encoding instead of UTF-8? It has all the
> umlauts (but lacks the Euro sign, though).
>
> ----Daniel
>

Hi Daniel,
thanks for your Tip? But isn't the file saved as UTF-8 encoded on an
UTF-8 system. Because all the umlauts are not directly shown on machines
at the instute, they have the old-stable debian (not etch) running
there, at home I have bleeding edge openSUSE.


I also got another hint, which was not forwarded to this list, but I
think this is just a more deep explanation of what you meant:

It should be enough to convert in UTF-8 all „ “ and ‚ ‘ into
\g[rl]q[q]{} and to change the line
\usepackage[utf8]{inputenc}
into
\usepackage[latin9]{inputenc}
and then save the file in ISO 8859-15/ISO Latin 9 encoding:
C-x RET c iso-8859-15 RET C-x C-s

I will test this next week... If this would work, I think I will make a
macro (I have the book "Learning GNU Emacs", which is excellent) .

Thanks for your help!

Greetings,
Christian


Stefan Monnier

unread,
Apr 20, 2007, 11:01:03 AM4/20/07
to
> I write my LaTeX documents usually in emacs, that works very fine at my
> personal computer. Since I am german, I use the UTF-8 encoding. I load the
> package for UTF-8 encoding in TeX simply with /usepackage[utf-8]{inputenc},
> which really improves typing a lot (I am german, so I use frequently umlauts
> and the szlig).

> However, at the computer-terminals in our institute, they do not support
> UTF-8. LaTeX gives me an error-message, that [utf-8] is not supported
> by inputenc.

I also recommend you fix it on the TeX side, not in Emacs.
I.e. try "utf8" instead of "utf-8", or "utf8x" even (some names that I've
seen used in the past with inputenc), and if they really don't have utf-8
support in their TeX installation, then switch to latin-1, which I'm sure
they support.

> My idea was to convert the document into an UTF-8 free file. So that all
> occurences of umlauts will be converted into the LaTeX equivalent (e.g. ö to
> "o), and I could also compile the file on the debain-boxes at our instiute.

You can do that with the iso-cvt Emacs package. But beware that it's not
100% identical (e.g. doesn't work right in verbatim environments).


Stefan

Christian Herenz

unread,
Apr 20, 2007, 4:48:42 PM4/20/07
to Stefan Monnier, help-gn...@gnu.org
Stefan Monnier schrieb:

> I also recommend you fix it on the TeX side, not in Emacs.
> I.e. try "utf8" instead of "utf-8", or "utf8x" even (some names that I've
> seen used in the past with inputenc), and if they really don't have utf-8
> support in their TeX installation, then switch to latin-1, which I'm sure
> they support.
>
All above mentioned packages are not supported. However, I know that
they plan to switch to debian-etch soon. Do you know, if etch has UTF-8
support build in?
(sorry for OT)


Daniel Rubin

unread,
Apr 21, 2007, 3:25:14 AM4/21/07
to help-gn...@gnu.org
Christian Herenz wrote:

> Stefan Monnier schrieb:


>> I also recommend you fix it on the TeX side, not in Emacs.
>> I.e. try "utf8" instead of "utf-8", or "utf8x" even (some names that I've
>> seen used in the past with inputenc), and if they really don't have utf-8
>> support in their TeX installation, then switch to latin-1, which I'm sure
>> they support.
>>

> All above mentioned packages are not supported. However, I know that
> they plan to switch to debian-etch soon. Do you know, if etch has UTF-8
> support build in?
> (sorry for OT)

I don't know, but have you tried my first suggestion and provided
LaTeX with your own copy of `utf8.def'? I think that solved the
problem for me once.

"Wilfred Zegwaard (privé)"

unread,
Apr 21, 2007, 10:28:05 AM4/21/07
to help-gn...@gnu.org
In LaTeX it is usual that you use the TeX side of it.

So it is not: ä, but \"a.

If you don't like that you can load additional codepackages where you
can use ä. But if you use XeTeX or to Germany adapted LaTeX
distributions (with EMacs), these problems are solved.

Check out the TeXlive distibution. There is documentation about using
TeXLive with EMacs and German there. There is sufficient documentation
about using german codepages with LaTeX at the German TeX users group. A
list of codepages for EMacs / LaTeX can be found in several distributions.

Hope this helps,

Wilfred

It is advocated world-wide to use the usual TeX standards. So the usual
EMacs codepage should be all-right.


Christian Herenz

unread,
Apr 21, 2007, 1:16:00 PM4/21/07
to "Wilfred Zegwaard (privé)", help-gn...@gnu.org
Wilfred Zegwaard (privé) schrieb:

> In LaTeX it is usual that you use the TeX side of it.
>
> So it is not: ä, but \"a.
>
> If you don't like that you can load additional codepackages where you
> can use ä. But if you use XeTeX or to Germany adapted LaTeX
> distributions (with EMacs), these problems are solved.
As I said, at home everything works fine, cause I had the choice to
install a LaTeX distribution which fits my needs (openSUSE implements a
lot of packages for LaTeX in their distribution). And yes, I don't like
typing \"a instead of ä, because that somewhat slows down my workflow.
Another Problem here is, that the emacs interprets the " by default in
TeX mode as quotes, and changes them into '', which will not interpreted
as an umlaut anymore. Of course, this behaviour is changeable, but I
think that it is not "so cool" that this behaviour is default.

The Problem which started this thread, was indeed that the package for
UTF8 encoding was not available on one of the two systems where I have
to work on my document. Unfortunately this system is in an environment,
where I only have normal user acsess to the system, and I have no
influence on the system wide installed packages nor the LaTeX distribution.

However, it was also mentioned earlier in this thread that I could solve
the problem with an local copy of the file "utf8.def". I have not tested
this, but it should work.

What I have tested, and that worked for me and I think it is a good
solution is to save the file in emacs as Latin9 encoded. Then I use
\usepackage{inputenc}[latin9] and I can type my umlauts at home and at
the university terminals as I like them to type.

There was also a nice snippet for my .emacs send to me, which was not
postet to this list. This is really great, since emacs saves TeX-files
automatically as Latin9 encoded, when this is inserted into .emacs.

(setq file-coding-system-alist
(append
'(("\\.tex\\'" iso-latin-9-unix . iso-latin-9-unix))
; '(("\\.el\\'" iso-latin-9-unix . iso-latin-9-unix))
file-coding-system-alist))

I already forwarded it to this list, but I think something went wrong so
it did not appear here in this thread. Thats why I am posting this again.

> Check out the TeXlive distibution. There is documentation about using
> TeXLive with EMacs and German there. There is sufficient documentation
> about using german codepages with LaTeX at the German TeX users group.
> A list of codepages for EMacs / LaTeX can be found in several
> distributions.

Thank you, I will have a look at it.

Regards,
Christian


0 new messages