help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: latex files encoding


From: Reiner Steib
Subject: Re: latex files encoding
Date: Fri, 10 Aug 2007 20:05:00 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

On Fri, Aug 10 2007, Harald Hanche-Olsen wrote:

> + Alain Muls <alain.muls@telenet.be>:
>
> | I have numerous latex files I created using kile. The encoding is (I
> | think) sat to UTF-8 or UTF-16. 

Probably UTF-8.

> | Since I like auctex, reftex, etc I decided to return to emacs, an
> | editor I used until 2 years ago.
> |
> | Now I have a problem with the encoding of these files. As an example,
> | the ë (e diacritic ?) is shown as ï. How can I get emacs to respect
> | the encoding of the files.
>
> The hard way:  Type C-x C-m c  and specify utf-8 for the coding
> system, and immediately follow this by C-x C-f to find the file.
>
> The easy way:  Put a comment on the first line of your latex files:
> % -*- coding: utf-8; -*-

In Emacs 22, there is `latex-inputenc-coding-alist'.

,----[ <f1> v latex-inputenc-coding-alist RET ]
| latex-inputenc-coding-alist is a variable defined in `latexenc'.
| Its value is shown below.
| 
| Documentation:
| Mapping from LaTeX encodings in "inputenc.sty" to Emacs coding systems.
| LaTeX encodings are specified with "\usepackage[encoding]{inputenc}".
| Used by the function `latexenc-find-file-coding-system'.
| 
| You can customize this variable.
| 
| Value: 
| ([...]
|  ("latin1" . iso-8859-1)
|  [...]
|  ("utf8" . utf-8)
|  ("utf8x" . utf-8))
`----

>   (push '("[.]tex$" . utf-8) file-coding-system-alist)

(add-to-list 'file-coding-system-alist '("\\.tex\\'" . utf-8))

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]