* latex files encoding
@ 2007-08-10 9:45 Alain Muls
0 siblings, 0 replies; 5+ messages in thread
From: Alain Muls @ 2007-08-10 9:45 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 585 bytes --]
Hi,
I have numerous latex files I created using kile. The encoding is (I
think) sat to UTF-8 or UTF-16. 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.
I also read something about a U in the command-line, that would indicate
UTF encoded file. I can see that in a compilation buffer, but I cannot
get that ina latex buffer.
Tx for any advise
[-- Attachment #2: alain.muls.vcf --]
[-- Type: text/x-vcard, Size: 242 bytes --]
begin:vcard
fn:Alain Muls
n:Muls;Alain
org:RMA;CISS
adr:;;Renaissance Avenue 30;Brussems;;1000;Belgium
email;internet:alain.muls@telenet.be
title:Prof
tel;work:+32.2.7376340
tel;cell:+32.477.675091
x-mozilla-html:FALSE
version:2.1
end:vcard
[-- Attachment #3: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex files encoding
[not found] <mailman.4601.1186739710.32220.help-gnu-emacs@gnu.org>
@ 2007-08-10 10:33 ` Harald Hanche-Olsen
2007-08-10 16:03 ` Emilio Lopes
2007-08-10 18:05 ` Reiner Steib
2007-08-10 17:51 ` Ralf Angeli
1 sibling, 2 replies; 5+ messages in thread
From: Harald Hanche-Olsen @ 2007-08-10 10:33 UTC (permalink / raw)
To: help-gnu-emacs
+ 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. 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; -*-
If you want the utf-8 encoding on every tex file you can do
something like
(push '("[.]tex$" . utf-8) file-coding-system-alist)
(er, push is part of the cl package, so you need (require 'cl) first,
or rewrite to the equivalent non-cl elisp - which I admit I am too
lazy to figure out right now).
You can still override that with C-x C-m c if you encounter a
non-utf-8 latex file.
And finally, you can convert your utf-8 encoded tex files to latin-1
(if possible) by first reading them after using C-x C-m c utf-8 RET
and then changing the coding system using C-c C-m f and specifying
latin-1, whereupon you save the file. (You'd better edit the
\usepackage[...]{inputenc} in the source file accordingly.)
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex files encoding
2007-08-10 10:33 ` Harald Hanche-Olsen
@ 2007-08-10 16:03 ` Emilio Lopes
2007-08-10 18:05 ` Reiner Steib
1 sibling, 0 replies; 5+ messages in thread
From: Emilio Lopes @ 2007-08-10 16:03 UTC (permalink / raw)
To: help-gnu-emacs
Harald Hanche-Olsen writes:
> (push '("[.]tex$" . utf-8) file-coding-system-alist)
> (er, push is part of the cl package, so you need (require 'cl) first,
> or rewrite to the equivalent non-cl elisp - which I admit I am too
> lazy to figure out right now).
It is called `add-to-list' and has the additional advantage of being
idempotent: it will not add a value to the list if it's already
there. This is a plus when you reload your init-files e.g.
Note that the order of the arguments is different compared to `push'
and that the list variable must be quoted:
(add-to-list 'file-coding-system-alist '("[.]tex$" . utf-8))
--
Emílio C. Lopes Ich leb und weiß nit wie lang,
Munich, Germany ich stirb und weiß nit wann,
ich fahr und weiß nit wohin,
(Martinus von Biberach) mich wundert, dass ich fröhlich bin!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex files encoding
[not found] <mailman.4601.1186739710.32220.help-gnu-emacs@gnu.org>
2007-08-10 10:33 ` Harald Hanche-Olsen
@ 2007-08-10 17:51 ` Ralf Angeli
1 sibling, 0 replies; 5+ messages in thread
From: Ralf Angeli @ 2007-08-10 17:51 UTC (permalink / raw)
To: help-gnu-emacs
* Alain Muls (2007-08-10) writes:
> I have numerous latex files I created using kile. The encoding is (I
> think) sat to UTF-8 or UTF-16. 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.
Which version of Emacs is that?
--
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex files encoding
2007-08-10 10:33 ` Harald Hanche-Olsen
2007-08-10 16:03 ` Emilio Lopes
@ 2007-08-10 18:05 ` Reiner Steib
1 sibling, 0 replies; 5+ messages in thread
From: Reiner Steib @ 2007-08-10 18:05 UTC (permalink / raw)
To: help-gnu-emacs
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/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-10 18:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-10 9:45 latex files encoding Alain Muls
[not found] <mailman.4601.1186739710.32220.help-gnu-emacs@gnu.org>
2007-08-10 10:33 ` Harald Hanche-Olsen
2007-08-10 16:03 ` Emilio Lopes
2007-08-10 18:05 ` Reiner Steib
2007-08-10 17:51 ` Ralf Angeli
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.