6

Please why does etex.sty fail to load with active =?

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[turkish]{babel}
\catcode`\==13
\makeatletter
\bbl@activate{=}
\makeatother
\usepackage[style=authortitle-icomp]{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}

\section*{The \texttt{authortitle-icomp} style}

This style combines the features of \texttt{authortitle-ibid} and
\texttt{authortitle-comp}. It will implicitly enable the
\texttt{sortcites} package option at load time. This style is
intended for citations given in footnotes.

\footcite{aristotle:rhetoric,averroes/bland,aristotle:physics,aristotle:poetics}
\printbibliography

\end{document}

I get the error:

! Undefined control sequence.
\globmarks ->\et@xglob 
                       6\marks \mathchardef 
l.240 \let\newmarks=\globmarks

Moving

\catcode`\=\string=13
\makeatletter
\bbl@activate{=}
\makeatother

into the document body works, but I am still interested in why etex won't load with active =. Beyond etex, biblatex can't process its options when = is active.

  • = is used in the syntax rules of TeX and in those cases it must have category code 12; so any assignment such as \let\a=\b will fail if = is active and its replacement text is not a category code 12 =. – egreg Nov 12 '12 at 14:20
6

You have discovered why babel delays activating its shorthand characters when LaTeX is executing \begin{document}.

The character = is used in the syntax rules of TeX and in those cases it must have category code 12; so any assignment such as \let\a=\b will fail if = is active. In the specific case TeX finds

\let\newmarks=\globmarks

but the = is active, so what happens is that TeX makes \newmarks equivalent to the active = and then finds \globmarks, so it expands it because it's not part of an assignment where expansion is suppressed. Since the replacement text of \globmarks contains \et@xglob which is defined only later, the error message is issued. But even if \et@xglob had been defined earlier, the reading of etex.sty would have already been compromised.

  • The moral: Heiko Oberdiek is right with his apparent "paranoia" about securing catcodes within a package. – Ahmed Musa Nov 12 '12 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.