[Tex/LaTex] Equations in section heading/title

math-modesectioning

For reasons that are beyond me, the following MWE

\documentclass{scrreprt}
\usepackage{classicthesis-ldpkg}
\usepackage{bm}
\usepackage{amsmath}

\begin{document}

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

\end{document}

fails to compile with the following error:

! TeX capacity exceeded, sorry [input stack size=5000].
<to be read again>
                   \HyPsd@@LetCommand
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