latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
125 stars 34 forks source link

Spanish babel incompatible with forloop? #165

Closed Lobz closed 2 years ago

Lobz commented 2 years ago

This issue made me loose a few good hours until I managed to pinpoint babel as the culprit. From looking at the logs, I think spanish redefines < and >, making the syntax of forloop impossible. Here's a minimal example using the very example of forloop:

\documentclass{report}
\usepackage[spanish]{babel}

\usepackage{forloop}

\begin{document}
\newcounter{ct} \forloop{ct}{0}{\value{ct}<5}{\arabic{ct} }

\end{document}
eg9 commented 2 years ago

It already breaks ifthen, which forloop is based upon.

\documentclass{report}
%\usepackage[spanish]{babel}
\usepackage{ifthen}

\begin{document}

\ifthenelse{3>2}{\typeout{YES}}{\typeout{NO}}

\end{document}

Uncommenting the babel line produces

! Missing = inserted for \ifnum.
<to be read again>
                   >
l.7 \ifthenelse{3>2}{\typeout{YES}}{\typeout{NO}}

While it's best to load babel-spanish with the es-noquoting option, nowadays, this remains a problem.

jbezos commented 2 years ago

I’m closing this issue because it’s documented in the spanish docs. This (mis)feature made sense 25 years ago, but admittedly not today. Fortunately, it can be deactivated easily.