how do you prepare Latex document with a translation... I need 1 multilanguage document. It should be something like:
\section{pl:Costam; en:Something}
Then I'd like to render it in Polish or English...
Babel. The Babel package presented in the introduction allows to use special characters and also translates some elements within the document. This package also automatically activates the appropriate hyphenation rules for the language you choose.
Times New Roman is a commonly-used font and here's an example of its use on Overleaf via the XeLaTeX compiler. In this example, the document font is set using \usemainfont{Times New Roman} , where the command \usemainfont{...} is provided by the package fontspec . You can also use LuaLaTeX to run the same code .
It supports about 80 languages.
If all else fails, you can go for an even more basic, almost insultingly dumb approach:
\newcommand{\dumblang}[2]{{#1}}
This defines a command with two arguments ([2]
) and spits out the first ({#1}
).
So for example you can have...
\usepackage[\dumblang{english}{italian}]{babel}
%snip
\section{\dumblang{Introduction}{Introduzione}}
\dumblang{Your introduction goes here!}{Scrivi qua la tua introduzione!}
...and when you want the document in Italian, you can just change \dumblang
to:
\newcommand{\dumblang}[2]{{#2}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With