-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
titlesec defines \@currentlabelname in \ttl@straight@i but doesn't sanitized the argument.
\def\ttl@straight@i#1[#2]#3{%
\def\@currentlabelname{#2}% for nameref
\gdef\ttl@savemark{\csname#1mark\endcsname{#3}}%
\let\ttl@savewrite\@empty
\def\ttl@savetitle{#3}%
\gdef\thetitle{\csname the#1\endcsname}%
\if@noskipsec \leavevmode \fi
\par
\ttl@labelling{#1}{#2}%
\ttl@startargs\ttl@straight@ii{#1}{#3}}
If nameref is loaded this more or less works, but without it it breaks in a current LaTeX which now stores the labelname too:
\documentclass{article}
\usepackage{titlesec}
\begin{document}
\section{a\label{b}}
\end{document}
gives
! TeX capacity exceeded, sorry [input stack size=10000].
\protect ->\noexpand \protect
\noexpand
l.217 \section{a\label{b}}
titlesec could load the gettitlestring package and then do:
\GetTitleString{#2}%
\let\@currentlabelname\GetTitleStringResult
kir0ul