I'm writing a package that loads babel
and which users might run under either pdflatex
or lualatex
. When babel's french
option is loaded, ":" is made active; and pdflatex
writes the following into the .aux
file:
\catcode `:\active
This is all fine for pdflatex
. However, if a user (for some reason) decides to starting running with lualatex
, the existing .aux
file is read, and an error is reported when subsequent lines of the .aux
file contain ":". For example,
\newlabel{eqn:1}{{1}{1}}
results in
Undefined control sequence.
<argument> r@eqn:
1
One can just trash the .aux
file and go again, but I'd like to prevent the message from appearing at all.
Is there a means of telling lualatex
what to do with this active character (say, read it as ":")?
I'd thought of a construction such as
\RequirePackage{iftex}
\iflualatex
\RequirePackage{etoolbox}
\AtEndPreamble{\catcode`:<someaction>}
\fi
but I am not sure what someaction ought to be...
This MWE illustrates the problem in a single document:
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage[french]{babel}
\begin{document}
Some English. \foreignlanguage{french}{Cette théorie formera désormais une des branches les plus importantes de la physique générale}. More English.
\begin{equation}\label{eqn:1}
f(x) = Ax
\end{equation}
\end{document}