Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multilanguage document in Latex

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...

like image 822
Etam Avatar asked Jan 11 '10 16:01

Etam


People also ask

What is Babel LaTeX?

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.

How do you make Times New Roman in LaTeX?

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 .

Does LaTeX support other languages?

It supports about 80 languages.


1 Answers

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}}
like image 76
badp Avatar answered Oct 02 '22 21:10

badp