Juan Manuel Macías <maciasch...@posteo.net> writes:
> Hi Jean-Christophe, > > Jean-Christophe Helary writes: > >> I had given up on Latex because mixing languages sounded like a huge >> pain in the butt but I see that without some org-level infrastructure >> it is not possible to achieve much when exporting to Latex/PDF (unless >> I missed something). > > Well, LaTeX has excellent (typographic and orthotypographic) > multilingual support, using the babel or polyglossia packages. I > especially recommend babel: > http://mirrors.ctan.org/macros/latex/required/babel/base/babel.pdf > > And LaTeX also has very good support for oriental languages or languages > with complex writing, especially in LuaTeX. In LuaTeX and XeTeX you can > also use opentype fonts and opentype features. > > The problem is how to translate that from Org --in an org-centric way-- > to LaTeX. Currently, you can apply LaTeX commands for multilingual > management directly in your Org document. For example: > > #+LaTeX_Header: \usepackage[several langs]{babel} > > @@latex:\begin{otherlanguage*}{german}@@ > > ... some text in german ... > > @@latex:\end{otherlanguage*}@@ > > Recently, I submitted a patch here that allows adding LaTeX attributes > to `quote' blocks. Then, you could do something like this: > > #+LaTeX_Header:\usepackage[german,english]{babel} > #+LaTeX_Header:\usepackage{quoting} > #+LaTeX_Header:\usepackage[babel=true,autostyle=true,german=quotes]{csquotes} > #+LaTeX_Header:\SetBlockEnvironment{quoting} Just FYI for those who don't know, you can use the org-latex-classes variable to define your own pseudo document classes, possibly using the DEFAULT_PACKAGES, PACKAGES, EXTRA_PACKAGES macros and other latex settings. So for example, you can add the babel or other packages you want and either make that the 'default' class or specify which class you want with the #+LATEX_CLASS header. I use this quite a bit because then I don't have to remember which LATEX_HEADER lines to include in the document, the specific option settings etc. I don't need support for multilingual documents, but I do have a number of 'special' documents (such as one with colours, logos and specific fonts for an employer to match their 'style guide'. I also have ones for generating project documents, letters, meeting minutes etc. They all use various different Latex extensions (particularly ones which don't mix well and cannot be included with other packages). The LATEX_HEADER: options are useful for 'one off' documents, but become a real pain to include all the time. however, I see this quite a lot and just wanted to highlight that when you need to customise the latex process, you do have these other options which can be very useful and I suspect would be good for things like setting up support for multilingual environments. I also use luatex rather than the default plain 'latex' (mainly because of better/more flexible font support). I could be wrong as I've not looked at this in a long time, but one of the problems with multilingual support in Latex was that it was somewhat 'fragile'. There were a number of packages which did not work well when combined with certain fonts required for multilingual support and (from memory) issues with hyphenation and packages which extended some environments. While it was generally possible to tweak things to get them to work, it was somewhat challenging to get them to work 'across the board'. I don't know if this is still the case as it has been some years incde I've needed to dig into Latex (mainly because now I do almost everything just in org mode and don't need to!). This, combined with a smaller user base for multilingual documents, may partly explain the difficulty in gaining traction in this area. I do recall that getting a stable general latex environment working for org exports was somewhat challenging originally.