Managing multi-language LaTeX documents
I’d like to maintain one of my presentation in German as well as in English without having to deal with multiple documents. As I use babel
anyway, I of course want to use the language defined for it.
I asked in TSX and egreg came up with the perfect solution, Heiko Oberdiek’s iflang
package.
\documentclass[ngerman]{scrartcl} \usepackage{babel,iflang} \newcommand{\tr}[2]{\IfLanguageName{ngerman}{#1}{#2}} \begin{document} \tr{Deutscher Text}{English text} \end{document} |
This solution works well, in the case of five or ten languages I’d probably use a template engine.