Sign up ×
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.

I am writing a book in two languages: a Russian version and an English version. Is it possible to do this in the same file?

Something like \tltext{Hello world!}{Здравствуй, мир!}, and mark at the start of the preamble which variant is needed.

The idea is that if I needed to change something, I wouldn't have to do it in both files.

share|improve this question

migrated from Jun 5 '11 at 22:17

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

This appears to be a near duplicate of the following question: Whether it's possible to keep translation together with original text?. If the answers there help you, we can close this question. – Alan Munn Jun 5 '11 at 22:29
Sorry. I didn't find it. – newuser Jun 6 '11 at 7:13

2 Answers 2

babel provides \iflanguage, but its usage for large parts of text is cumbersome.




  Hello world!
  Здраствуй мир!

  Thank you


In other words, you write each paragraph (or part of text in general) putting between \ifenglish and \else the English version, and between \else and \fi the Russian text.

You choose the language by commenting or uncommenting the lines after \begin{document}.

share|improve this answer

This might just work, simply comment out the version that you don't want. You might eventually want to choose a shorter name than \tltext for the command because you're going to be typing it many, many times if you're writing a book.


\newcommand{\tltext}[2]{#1}% use English version
%\newcommand{\tltext}[2]{#2}% use Russian version

\tltext{Hello world!}{Здраствуй мир!}
share|improve this answer

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.