- I have a bilingual document.
- The main language is English.
- Throughout the document, I switch between the two languages.
- I have noticed that
babelwrites language-specific commands in the toc file (e. g.\babel@toc {english}{}). - I provide an artificial MWE, see below. The actual document is Chinese and English.
- Where the trouble begins...: In my real use case I use
\todayin the footline of the document. - Problem: In the footline of the toc chapter, the
\todaycommand produces (randomly) different outputs (language-specific). - Question: Can I prevent that
\babel@tocis written to the toc file?
Content of the toc file.
\babel@toc {english}{}
\babel@toc {english}{}
\contentsline {section}{\numberline {1}English}{1}%
\babel@toc {spanish}{}
\contentsline {section}{\numberline {2}Spanish}{1}%
\babel@toc {english}{}
\contentsline {section}{\numberline {3}English}{1}%
\documentclass{article}
\usepackage[spanish, english]{babel}
\begin{document}
\tableofcontents
%% English -------------------------
\selectlanguage{english}
\section{English}
Test \today
%% Spanish -------------------------
\selectlanguage{spanish}
\section{Spanish}
Test \today
%% English -------------------------
\selectlanguage{english}
\section{English}
Test \today
\end{document}
Even when I use
\begin{otherlanguage}{english}
Text.
\end{otherlanguage}
and
\begin{otherlanguage}{spanish}
Text.
\end{otherlanguage}
the problem occurs.
\selectlanguage{english}\todaythere. ā Ulrike Fischer Dec 29 '19 at 12:20