Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
May I also suggest using \DeclarePairedDelimiters instead of that pair of \mid? –  Federico Poloni Apr 6 '12 at 21:26
    
Please use the upvote button to thank other people. Discussion about a site should go to the meta site. –  Masroor Jun 22 at 23:32

5 Answers 5

up vote 28 down vote accepted

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.

share|improve this answer

I would suggest to supply an alternative section title for the table of contents via

\section[alternative title goes here]{The values of $\beta$ for which
        $\omega_i \mid \bm{\omega} \mid^{-\beta}$ is defined at the origin}

(As explained already, this alternative title mustn't contain any math.)

share|improve this answer

Welcome! This is maybe not the answer you want, but I think if you can avoid math expressions in section titles you should. First, arguments to \section move around which makes \section one of the so-called fragile commands. Also, fonts usually change between regular text, section headers, and TOC text, which could make it a headache to select the right math fonts. Finally, if your notation is defined in the previous section, someone scanning the TOC would not have any idea what that section is about. So I would just write it out in English if you can. "The best notation is no notation," says Halmos.

share|improve this answer

Just posted this here, as a variant of @HendrikVogt's answer - try also this in your preamble:

\let\oldsection\section
\def\tmpl{\oldsection[]}
\let\section\tmpl

Cheers!


EDIT: here's a slightly better snippet - the starred section should show up correctly (if it doesn't have math, that is); the non-starred version will show "TOC-ENTRY:x" in the TOC index (but otherwise sections will be typeset as they are in the document):

% http://www.tug.org/applications/hyperref/manual.html
% http://www.tex.ac.uk/cgi-bin/texfaq2html?label=cmdstar
% http://wiki.contextgarden.net/Commands_with_optional_arguments
% TeX tricks - Listing macros - http://www.volkerschatz.com/tex/show.html
% http://zoonek.free.fr/LaTeX/LaTeX_samples_section/0.html
\makeatletter

\let\oldsection\section
\renewcommand{\section}{\@ifstar
                     \mysectionStar%
                     \mysectionNoStar%
}
\newcommand{\mysectionStar}[1]{  % no two arguments here?
\typeout{AAAA}% debug
\oldsection{#1} }
\newcommand{\mysectionNoStar}[1]{ %
\typeout{BBBB}% debug
\oldsection[TOC-ENTRY:\thesection]{#1} }

\makeatother
share|improve this answer
1  
This has the side effect of a blank entry in the TOC. –  Matthew Leingang Apr 5 '12 at 17:41
    
Thanks, @MatthewLeingang - didn't think of that when I posted - Cheers! –  sdaau Apr 6 '12 at 8:06

Try protect'ing the section, as in \section\protect{This title contains mathematics such as $\beta_i$}

share|improve this answer
    
That doesn't work for me: it creates a blank entry in the table of contents, instead of the title of the indicated section. –  Benjamin McKay Mar 9 at 13:48
    
It also doesn't create a section heading, and instead treats the protected text as just part of the running text of the paper, not as a title of a section. –  Benjamin McKay Mar 9 at 13:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.