titlesec problem

Zdenek Wagner zdenek.wagner at gmail.com
Mon Apr 8 22:46:34 CEST 2024


Probably the version of titlesec has changed. Remember, if you put
\label inside a sectioning macro, it then gets to:

1. Running head/foot
2. Table of contents
3. PDF bookmarks

In order to work, \label must be declared as robust and must be
redefined to \@gobble (or an equivalent macro) in all these contexts.
Looking at the error message it seems to me that it is not robust
enough and gets expanded to something different from \@gobble in one
of the hooks. The same can happen inside \caption.

Zdeněk Wagner
https://www.zdenek-wagner.eu/

po 8. 4. 2024 v 22:14 odesílatel Hartmut Henkel via tex-live
<tex-live at tug.org> napsal:
>
> Hi,
>
> here is some weird error when using the titlesec package (TL 2024 SVN
> from yesterday):
>
> ! TeX capacity exceeded, sorry [input stack size=10000].
> \hook_use:nnw #1#2->\cs:w \if_cs_exist:w __hook #1
>                                                   \cs_end: __hook #1\else: u...
>
> Here a demo file for the problem; run e. g., with pdflatex:
>
> \documentclass{article}
> \usepackage{titlesec}
> \begin{document}
>
> % does not work in TL2024, but worked "earlier":
> \section{\label{sec:foo}Hello}
>
> % works:
> %\section{Hello}\label{sec:foo}
>
> \end{document}
>
> Colleagues using an older TL (2022?) did not have any problem, when the
> label macro is used within the section argument. Without titlesec the
> label is allowed there, traditionally. But new titlesec requires to have
> the label after the sectioning macro.
>
> Best Regards
> Hartmut



More information about the tex-live mailing list.