TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

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.