[Tex/LaTex] Equations in section heading/title


For reasons that are beyond me, the following MWE



\section{The values of $\beta$ for which $\omega_i \mid \bm{\omega}
\mid^{-\beta}$ is defined at the origin}


fails to compile with the following error:

! TeX capacity exceeded, sorry [input stack size=5000].
<to be read again>
l.9 ...a} \mid^{-\beta}$ is defined at the origin}

I've tried increasing the amount of memory available to pdfLatex but
that doesn't solve the problem. I've also googled to no avail. Is
there a workaround for this problem.

Best Answer

It looks like classicthesis-ldpkg has loaded hyperref which is trying to bookmark your section title and, because it contains maths, is throwing the (rather cryptic) error for you. The solution is pretty simple. Rewrite your \section command this way:

\section{The values of \texorpdfstring{$\beta$}{TEXT} %
     for which \texorpdfstring{$\omega_i \mid \bm{\omega}\mid^{-\beta}$}%
     {TEXT} is defined at the origin}

including some non-math text in the two location with the word "TEXT". The section title will contain the math typeset as you want, and the generated pdf bookmarks will contain whatever you substitute for TEXT.

Related Question