Take the 2-minute tour ×
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.

We want to generate a document that contains parts in different languages (e.g. Dutch, French and English). The problem is that these languages have different hyphen patterns and notations (e.g. in French one writes a space before a colon).

Is there an elegant way to swap between languages, something like:

\documentclass{article}
\usepackage[dutch,english,french]{babel}
\begin{document}
\begin{english}
The list contains three items: one, two, and three.
\end{english}
\begin{dutch}
De lijst bevat drie elementen: \'e\'en, twee en drie.
\end{dutch}
\begin{french}
La liste contient trois \'el\'ements: un, deux et trois.
\end{french}
\end{document}
share|improve this question
3  
It's explained in the documentation. I don't know if this is the optimal way to do it, but you could use \begin{otherlanguage}{dutch} … \end{otherlanguage} instead of \begin{dutch} … \end{dutch}. EDIT: Although it recommends to enclose that environment in another pair of braces {…}… so there might be a better way. And, of course, you can define your own environments based upon these. –  Manuel Jun 12 at 12:29
    
There is no space before of the colon in your french example. Or am I blind? Beside that I'm not sure if it is true that this rule holds for french texts. Hence, this should'nt be a problem, which means that you can just go ahead with the babel environments. –  Ruben Oct 15 at 16:12

1 Answer 1

I don't know if this is the best solution, but I simply use

\selectlanguage{spanish}

and

\selectlanguage{english}

to switch between English and Spanish as needed.

share|improve this answer
    
Welcome to TeX.SX! –  Adam Liter Oct 15 at 15:04
    
Although I've just read that \begin{otherlanguage}{spanish} and \end{otherlanguage} could be preferable, but not sure yet about the difference. In both cases, text such as "Figure" and "Table" in captions will be in the selected language. –  Mike Oct 15 at 15:05
    
@Mike, you are able to edit an existing answer. As far as your comment provides additional information that is relevant for the answer, you should make use of this ability. –  Ruben Oct 15 at 16:15

Your Answer

 
discard

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.