emacs-orgmode
[Top][All Lists]
Advanced

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

About multilingual documents


From: Juan Manuel Macías
Subject: About multilingual documents
Date: Sun, 02 May 2021 20:20:49 +0000

Hi all,

I'm curious to see how other Org users deal with multilingual documents,
that is, those documents (for example, philology or linguistics texts)
that contain a significant number of online quotes in other languages.
Naturally, this makes more sense in the LaTeX backend, since it is
convenient to enclose these quotes in a \foreignlanguage command to
ensure that LaTeX at least apply the correct hyphenation patterns for
words in other languages.

Luckily, in the latest versions of Babel (the Babel of LaTeX) you don't
need to do this when it comes to languages whose script is different
from Latin (e.g. Greek, languages with Cyrillic, Arabic, Hindi, etc.).
We can, for example, define Russian and Greek as:

#+begin_src latex
\babelprovide[onchar=ids fonts,hyphenrules=russian]{russian}
\babelprovide[onchar=ids fonts,hyphenrules=ancientgreek]{greek}
#+end_src

And also the fonts for both languages:

#+begin_src latex
\babelfont[russian]{rm}{Linux Libertine O}
\babelfont[greek]{rm}]{Free Serif}
#+end_src

For Latin-based scripts it is still necessary enclose the text in the
\foreignlanguage command. And now comes the question: how do Org users
who work in multilingual documents to obtain this command when exporting
to Latex?

I usually use macros, which always tend to work fine. But lately I have
been testing an alternative markup system using an export filter. The
idea would be something like:

%(lang) lorem ipsum dolor %()

I start from a list of the most used languages:

#+begin_src emacs-lisp
(langs '(("en" "english")
         ("fr" "french")
         ("de" "german")
         ("it" "italian")
         ("pt" "portuguese")))
#+end_src

And other possible languages that Babel supports can be indicated
explicitly, by prepending "--":

%(fr) ... %()

%(--esperanto) ... %()

(If someone wants to try it, I attach a small Org document).

Best regards,

Juan Manuel

Attachment: test-langs.org
Description: Lotus Organizer


reply via email to

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