Archive for July, 2011

Today I got an weird error:

! TeX capacity exceeded, sorry [input stack size=1500].

The error text is not very helpful (not at all), but the compiler stopped at a section command of the form:

\section{Some text $\bm{d}$}

So I searched on Google and found the cause of the error. It was caused by hyperref trying to convert the mathematical expressions and symbols in the section title to a PDF link in the table of contents. Somehow hyperref does not like mathematical text in section titles, especially bold symbols. There are several solutions, but the following two are the easiest:

  • Specify an alternative title for the section, usually called short title, and hyperref will use that for the link, like this:

    \section[Some text d]{Some text $\bm{d}$}

  • Specify pure text alternatives for the special symbols in the title, like this:

    \section{Some text \texorpdfstring{$\bm{d}$}{d}}

Note that the same error can happen with not only mathematical symbols but also other special fonts, such as \verb (as some people reported).


Read Full Post »