[texhax] clash of babel and tableofcontents

Axel E. Retif axel.retif at mac.com
Sun Mar 26 17:41:52 CEST 2017


On 03/26/2017 05:41 AM, Axel E. Retif wrote:

> I have a problem I'd never experienced before: I have typeset a 200+
> pages book, using
>
>     \usepackage[spanish,es-nolayout,es-noshorthands]{babel}
>
> (but, please, note that *the same error below happens* if I change it to
> \usepackage[english]{babel}).
>
> Everything went fine, without any problem. Now I need to typeset the
> Contents and I get this error
>
>     ERROR: TeX capacity exceeded, sorry [input stack size=5000].
>
>     --- TeX said ---
>     \T1-cmd ...otect \@typeset at protect \@inmathwarn #1
>                                                   \else \noexpand
> #1\expanda...l.306 \tableofcontents


I found the problem and I think is rather ridiculous ---instead of the 
redefinition of ps at plain that I've always used, recommended by The LaTeX 
Companion (I have \foliosize defined in my style):

     \renewcommand\ps at plain{%
	\renewcommand\@oddhead{}%
	\let\@evenhead\@oddhead
     \renewcommand{\@oddfoot}{\hfil\foliosize{\thepage}}%
     \renewcommand{\@evenfoot}{\foliosize{\thepage}\hfil}%
     }%

(which works with babel or \tableofcontents, *but not with both*), I had 
to adapt the ps at plain definition of latex.ltx:

     \def\ps at plain{\let\@mkboth\@gobbletwo
      \let\@oddhead\@empty\def\@oddfoot{\reset at font\foliosize\hfil\thepage
 
}\let\@evenhead\@empty\def\@evenfoot{\reset at font\foliosize\thepage\hfil}
}%

Why the former works with babel without \tableofcontents or vice versa, 
is beyond my comprehension, but I think something is really wrong.


Best

Axel



More information about the texhax mailing list