TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a document in LaTeX and I would like to have multiple language versions. I could just copy everything and translate, but this would lead to multiple versions that I would have to update individually every single time.

What I want is that I specify which language I want to compile (or perhaps it always compiles all the languages, so every time I run it saves for instance an english, dutch and german version). And then it only prints that language. I was thinking of something along the lines of:

\languageversion{english} %this could be changed for language specification

\dutch{some dutch text here}
\english{some english text here}
\german{some german text here}

So when I select english, only the english part would be printed. This way, if I would change the layout I don't have to do this for multiple versions, but only in one.

Is this possible?

share|improve this question

migrated from stackoverflow.com Jun 16 '12 at 18:40

This question came from our site for professional and enthusiast programmers.

possible duplicate of Is it possible to keep my translation together with original text? – Jake Jun 16 '12 at 19:13
This can work for very small snippets of text. For longer passages or an entire document maintenance would be very difficult. – egreg Jun 16 '12 at 19:22

Here's a way, but I don't think this can really be useful for long texts.






\dutch{some dutch text here}
\english{some english text here}
\german{some german text here}




\dutch{some dutch text here}
\english{some english text here}
\german{some german text here}




\dutch{some dutch text here}
\english{some english text here}
\german{some german text here}


This will use the active language (according to babel rules). The \declarelanguage has an optional argument: a string that matches the babel language name. Using this it's immaterial what name you use; for example you could say


and use \EN{English text} for inserting the English text. Take your pick; for German it's necessary.

Note: there's a strange babel feature: the language string maintained by \languagename has its first character of category code 12, that's the reason for the mysterious \edef\@tempa{\string#1}, which make your given string agree with babel's opinion on the matter.

share|improve this answer
Thanks guys, you pointed me in the right direction! (I had searched before, without any results) Eventually I used the procedure from latex-community.org/forum/… Which is not perfect, but works for me! Cheers! – user1460812 Jun 17 '12 at 9:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.