Re: [Orgmode] Umlauts in LaTeX export
Nick Dokos nicholas.do...@hp.com writes: [...] There are a couple of assumptions here (and in Eric F.'s mail about the TeX input method as well). One is that the buffer is encoded in UTF-8: if you use e.g iso-8859-1, you can use whatever input method you want, but you'll end up with a byte in your file that LaTeX won't like. Umm, just to clarify something: the file can well be in iso-8859-1 encoding. It need not be in UTF-8 if all you want are typical west European characters (umlauts etc.). For instance, the following file contents work just fine (I've forced iso-8859-1 encoding although I use UTF-8 more often than not): --8---cut here---start-8--- # -*- coding: iso-8859-1; -*- * Introduction This text includes a number of characters from España because we want to say /cigüeña/ instead of /swan/. --8---cut here---end---8--- This exports just fine to latex and org automatically includes the line: : \usepackage[latin1]{inputenc} I've attached the org file in case anybody wants to play with this very small example. # -*- coding: iso-8859-1; -*- * Introduction This text includes a number of characters from España because we want to say /cigüeña/ instead of /swan/. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.02trans (release_7.3.14.g106ad) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Eric S Fraga ucec...@ucl.ac.uk wrote: Nick Dokos nicholas.do...@hp.com writes: [...] There are a couple of assumptions here (and in Eric F.'s mail about the TeX input method as well). One is that the buffer is encoded in UTF-8: if you use e.g iso-8859-1, you can use whatever input method you want, but you'll end up with a byte in your file that LaTeX won't like. Umm, just to clarify something: the file can well be in iso-8859-1 encoding. It need not be in UTF-8 if all you want are typical west European characters (umlauts etc.). For instance, the following file contents work just fine (I've forced iso-8859-1 encoding although I use UTF-8 more often than not): # -*- coding: iso-8859-1; -*- * Introduction This text includes a number of characters from España because we want to say /cigüeña/ instead of /swan/. This exports just fine to latex and org automatically includes the line: : \usepackage[latin1]{inputenc} I've attached the org file in case anybody wants to play with this very small example. Ah, thanks: I forgot how smart org is. Nick ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Umlauts in LaTeX export
Hi all, I don't think this is a bug so much as an unfortunate consequence of expected behavior, but I wanted to document it here for the sake of future mailing list searches, because I didn't find anything about it myself. (If someone has a better solution than the one I propose, please clue me in!) To add an umlaut/trema/diaeresis to a letter in LaTeX, I use the \ command, as in: G\{o}del Unfortunately, due to the fact that Org export treats both `{}' and `' specially, this will be exported to LaTeX as: G\''\{o\}del It isn't sufficient to surround the \{o} with math mode delimiters, e.g., G\(\{o}\)del even though this will prevent Org from escaping the brackets and converting the double-quote, because the command doesn't seem to produce output in math mode. (The compiled file will read Gdel.) So, the work-around I've come up with is to use an \mbox inside math mode, which prevents Org from doing the escapes/conversions: G\(\mbox{\{o}}\)del A bit ugly, but it produces the correct output. Hope that helps someone! And again, if there's a better way, please let me know! Best, Richard ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Thanks Richard, I had the same issue! I can definitely use your solution! S. On Wed, Nov 3, 2010 at 11:50 AM, Richard Lawrence richard.lawre...@berkeley.edu wrote: Hi all, I don't think this is a bug so much as an unfortunate consequence of expected behavior, but I wanted to document it here for the sake of future mailing list searches, because I didn't find anything about it myself. (If someone has a better solution than the one I propose, please clue me in!) To add an umlaut/trema/diaeresis to a letter in LaTeX, I use the \ command, as in: G\{o}del Unfortunately, due to the fact that Org export treats both `{}' and `' specially, this will be exported to LaTeX as: G\''\{o\}del It isn't sufficient to surround the \{o} with math mode delimiters, e.g., G\(\{o}\)del even though this will prevent Org from escaping the brackets and converting the double-quote, because the command doesn't seem to produce output in math mode. (The compiled file will read Gdel.) So, the work-around I've come up with is to use an \mbox inside math mode, which prevents Org from doing the escapes/conversions: G\(\mbox{\{o}}\)del A bit ugly, but it produces the correct output. Hope that helps someone! And again, if there's a better way, please let me know! Best, Richard ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Dear Richard, sitting in front of a German keyboard, writing Gödel seems to be the obvious solution for modern LaTeX and Emacs versions - you could define some shortcut to insert the appropriate Unicode character into your text (as your keyboard probably does not feature a ö key), or copy/paste the Umlauts from another Emacs file as necessary. If you do not need it very often, this might be a reasonable alternative. Warm regards, Stefan On 03.11.2010, at 16:50, Richard Lawrence wrote: Hi all, I don't think this is a bug so much as an unfortunate consequence of expected behavior, but I wanted to document it here for the sake of future mailing list searches, because I didn't find anything about it myself. (If someone has a better solution than the one I propose, please clue me in!) To add an umlaut/trema/diaeresis to a letter in LaTeX, I use the \ command, as in: G\{o}del Unfortunately, due to the fact that Org export treats both `{}' and `' specially, this will be exported to LaTeX as: G\''\{o\}del It isn't sufficient to surround the \{o} with math mode delimiters, e.g., G\(\{o}\)del even though this will prevent Org from escaping the brackets and converting the double-quote, because the command doesn't seem to produce output in math mode. (The compiled file will read Gdel.) So, the work-around I've come up with is to use an \mbox inside math mode, which prevents Org from doing the escapes/conversions: G\(\mbox{\{o}}\)del A bit ugly, but it produces the correct output. Hope that helps someone! And again, if there's a better way, please let me know! Best, Richard ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode -- Dr. Stefan Vollmar, Dipl.-Phys. Head of IT group Max-Planck-Institut für neurologische Forschung Gleuelerstr. 50, 50931 Köln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 Email: voll...@nf.mpg.de http://www.nf.mpg.de smime.p7s Description: S/MIME cryptographic signature ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Dear Richard, Stefan Vollmar voll...@nf.mpg.de writes: Dear Richard, sitting in front of a German keyboard, writing Gödel seems to be the obvious solution for modern LaTeX and Emacs versions - you could define some shortcut to insert the appropriate Unicode character into your text (as your keyboard probably does not feature a ö key), or copy/paste the Umlauts from another Emacs file as necessary. If you do not need it very often, this might be a reasonable alternative. Although I am german, I use an american keyboard layout for coding and everything else. But there is a nice emacs solution to enter umlauts: =C-x RET C-\ german-postfix RET= This enables an input method which allows you to enter all german umlauts: ä ü ö Ä Ü Ö and ß. Entering an `a' followed immediately by an `e' generates an ä, followed by another `e' it becomes `ae`, similar for ü and ö . `s` followed by `z` generates an `ß`. Larger variants are typed by typing two large letters. Regards, Jean-Marie ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Dear Jean-Marie, this is very useful - thanks for sharing! Warm regards, Stefan On 03.11.2010, at 18:51, Jean-Marie Gaillourdet wrote: Dear Richard, Stefan Vollmar voll...@nf.mpg.de writes: Dear Richard, sitting in front of a German keyboard, writing Gödel seems to be the obvious solution for modern LaTeX and Emacs versions - you could define some shortcut to insert the appropriate Unicode character into your text (as your keyboard probably does not feature a ö key), or copy/paste the Umlauts from another Emacs file as necessary. If you do not need it very often, this might be a reasonable alternative. Although I am german, I use an american keyboard layout for coding and everything else. But there is a nice emacs solution to enter umlauts: =C-x RET C-\ german-postfix RET= This enables an input method which allows you to enter all german umlauts: ä ü ö Ä Ü Ö and ß. Entering an `a' followed immediately by an `e' generates an ä, followed by another `e' it becomes `ae`, similar for ü and ö . `s` followed by `z` generates an `ß`. Larger variants are typed by typing two large letters. Regards, Jean-Marie -- Dr. Stefan Vollmar, Dipl.-Phys. Head of IT group Max-Planck-Institut für neurologische Forschung Gleuelerstr. 50, 50931 Köln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 Email: voll...@nf.mpg.de http://www.nf.mpg.de smime.p7s Description: S/MIME cryptographic signature ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Jean-Marie Gaillourdet j...@gaillourdet.net writes: Dear Richard, Stefan Vollmar voll...@nf.mpg.de writes: Dear Richard, sitting in front of a German keyboard, writing Gödel seems to be the obvious solution for modern LaTeX and Emacs versions - you could define some shortcut to insert the appropriate Unicode character into your text (as your keyboard probably does not feature a ö key), or copy/paste the Umlauts from another Emacs file as necessary. If you do not need it very often, this might be a reasonable alternative. Although I am german, I use an american keyboard layout for coding and everything else. But there is a nice emacs solution to enter umlauts: =C-x RET C-\ german-postfix RET= This enables an input method which allows you to enter all german umlauts: ä ü ö Ä Ü Ö and ß. Entering an `a' followed immediately by an `e' generates an ä, followed by another `e' it becomes `ae`, similar for ü and ö . `s` followed by `z` generates an `ß`. Larger variants are typed by typing two large letters. Regards, Jean-Marie Even better, for the OP, is to switch to the tex input method (M-x set-input-method RET tex RET)! In this case, you can type \o to get ö. Almost all TeX and LaTeX sequences are understood (e.g. \forall to get ∀, \exists for ∃, \alpha for α, \leftrightharpoons for ⇋, and so on.) You can see all the characters with =describe-input-method=. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.02trans (release_7.3.10.g7f79.dirty) ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Very, very neat - thank you! Warm regards, Stefan On 03.11.2010, at 21:08, Eric S Fraga wrote: Jean-Marie Gaillourdet j...@gaillourdet.net writes: Dear Richard, Stefan Vollmar voll...@nf.mpg.de writes: Dear Richard, sitting in front of a German keyboard, writing Gödel seems to be the obvious solution for modern LaTeX and Emacs versions - you could define some shortcut to insert the appropriate Unicode character into your text (as your keyboard probably does not feature a ö key), or copy/paste the Umlauts from another Emacs file as necessary. If you do not need it very often, this might be a reasonable alternative. Although I am german, I use an american keyboard layout for coding and everything else. But there is a nice emacs solution to enter umlauts: =C-x RET C-\ german-postfix RET= This enables an input method which allows you to enter all german umlauts: ä ü ö Ä Ü Ö and ß. Entering an `a' followed immediately by an `e' generates an ä, followed by another `e' it becomes `ae`, similar for ü and ö . `s` followed by `z` generates an `ß`. Larger variants are typed by typing two large letters. Regards, Jean-Marie Even better, for the OP, is to switch to the tex input method (M-x set-input-method RET tex RET)! In this case, you can type \o to get ö. Almost all TeX and LaTeX sequences are understood (e.g. \forall to get ∀, \exists for ∃, \alpha for α, \leftrightharpoons for ⇋, and so on.) You can see all the characters with =describe-input-method=. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.02trans (release_7.3.10.g7f79.dirty) -- Dr. Stefan Vollmar, Dipl.-Phys. Head of IT group Max-Planck-Institut für neurologische Forschung Gleuelerstr. 50, 50931 Köln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 Email: voll...@nf.mpg.de http://www.nf.mpg.de smime.p7s Description: S/MIME cryptographic signature ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Umlauts in LaTeX export
Jean-Marie Gaillourdet j...@gaillourdet.net wrote: Dear Richard, Stefan Vollmar voll...@nf.mpg.de writes: Dear Richard, sitting in front of a German keyboard, writing Gödel seems to be the obvious solution for modern LaTeX and Emacs versions - you could define some shortcut to insert the appropriate Unicode character into your text (as your keyboard probably does not feature a ö key), or copy/paste the Umlauts from another Emacs file as necessary. If you do not need it very often, this might be a reasonable alternative. Although I am german, I use an american keyboard layout for coding and everything else. But there is a nice emacs solution to enter umlauts: =C-x RET C-\ german-postfix RET= This enables an input method which allows you to enter all german umlauts: ä ü ö Ä Ü Ö and ß. Entering an `a' followed immediately by an `e' generates an ä, followed by another `e' it becomes `ae`, similar for ü and ö . `s` followed by `z` generates an `ß`. Larger variants are typed by typing two large letters. There are a couple of assumptions here (and in Eric F.'s mail about the TeX input method as well). One is that the buffer is encoded in UTF-8: if you use e.g iso-8859-1, you can use whatever input method you want, but you'll end up with a byte in your file that LaTeX won't like. The second assumption (which is satisfied by default when an org file is exported to LaTeX) is that \usepackage[utf8]{inputenc} is used in the LaTeX file.[fn:1] Assuming that both of these assumptions are satisfied, this is indeed the best way to deal with umlauts, accented characters, cedillas and the like: the buffer *looks* like the LaTeX output. But remember that there is an encoding there nevertheless. Nevertheless that does not absolve org from dealing with \ properly. In fact, it deals with it correctly in a heading but not in the text: --8---cut here---start-8--- * G\odel G\odel --8---cut here---end---8--- gives: --8---cut here---start-8--- ... \section{G\odel} \label{sec-1} G\''odel --8---cut here---end---8--- However, surrounding the o with braces breaks things in both places. I think part of the problem is that headings and text go through different processing: e.g. text goes through org-export-latex-content, whereas headings don't. So fixing a problem like this in one place is not enough. Nick Footnotes: [fn:1] This may or may not be correct if you use omega or xetex or one of the more recent TeX variants, but I don't know much about them. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode