4

I am wondering, what might be the best way to switch a language in a Xetex document for a whole chapter. The specific problem is, that in the chapter the language is switched (say from English, which is the default language, to German) might be some quotations in a third language or the default language. What I tried is the following:

\begin{german}
\chapter[]{A title}

\section{Introduction}
Das ist ein deutscher Text mit einem englischen Zitat: \textenglish{»To be or not to be, that is the questions. Whether 'tis nobler…«} Und hier geht der deutsche Text weiter, ist aber nicht mehr als deutscher gesetzt.

\end{german}

But the problem is, that after ´\textenglish´ the language isn't switched back to German again in spite of the fact, that the whole chapter is included in ´\begin{english} … \end{english}´. So I assume, that this might not be the correct way to do it. But how than?

Here is a working example:

\documentclass[10pt,twoside]{memoir}
\usepackage[english,german]{babel}
\usepackage{polyglossia} % Vgl. http://tex.stackexchange.com/questions/135185
\setmainlanguage[spelling=old,babelshorthands=true,script=latin]{english}
\setotherlanguage{german}
\usepackage{fontspec}
\setmainfont[Numbers={OldStyle},Ligatures={Common, Historic}]{Adobe Garamond Pro}
\begin{document}

\begin{german}
\chapter[]{A title}

\section{Introduction}
Das ist ein deutscher Text mit einem englischen Zitat: \textenglish{»To be or not to be, that is the questions. Whether 'tis nobler…«} Und hier geht der deutsche Text weiter, ist aber nicht mehr als deutscher gesetzt.

\end{german}

\end{document}
Mico
  • 506,678
user5950
  • 1,456

1 Answers1

5

You shouldn't use both babel and polyglossia. You're also mixing up the options to the languages.

\documentclass[10pt,twoside]{memoir}

\usepackage{polyglossia} % Vgl. http://tex.stackexchange.com/questions/135185
\setmainlanguage{english}
\setotherlanguage[spelling=old,babelshorthands=true]{german}
\usepackage{fontspec}
\setmainfont[Numbers={OldStyle},Ligatures={Common, Historic}]{Linux Libertine O} % I don't have Adobe Garamond Pro

\begin{document}

\begin{german}
\chapter{A title}

\section{Introduction}

Das ist ein deutscher Text mit einem englischen Zitat: \textenglish{»To be or not to be,
that is the question. Whether 'tis nobler…« (\languagename)} Und hier geht der deutsche
Text weiter, ist aber nicht mehr als deutscher gesetzt.

\languagename

\end{german}

\end{document}

I added two \languagename commands to show what's the current language in both places.

enter image description here

egreg
  • 1,121,712