## LaTeX forum ⇒ General ⇒ TeX capacity exceeded !? Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
Cham
Posts: 904
Joined: Sat Apr 02, 2011 4:06 pm

### TeX capacity exceeded !?

I'm experiencing an error which I never got before.

Here's the simple line of code which apparently gives the error in my main code, while it's woking with any simple MWE code :

\subsubsection{Variables indépendantes $\tilde{Q}$}

The problem appears to be related to the tilde command inside a subsubsection, since everything compiles fine without it. The error message is this one :

TeX capacity exceeded, sorry
[input stack size = 5000]

The document has about 80 pages and contains lots of equations, but not THAT much. So I don't understand why the tilde inside a subsubsection gives any trouble in my main code file (and the tilde do works elsewhere in the same code file !).

Again, take note that this problematic code line DO works in any MWE that I tried.

Any idea ?

Tags:

Stefan Kottwitz
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm
Hi Cham,

Cham wrote:this problematic code line DO works in any MWE that I tried.

you just did not go the perfect way to am MWE. Generating an MWE from scratch may often work, but not always.

There's the way which works always: start with the copy of the problem document, and reduce it step by step, testing during each step. Either you end up with a perfect MWE, or you isolated it within one step, which also can be made a perfect MWE.

I'm sure we will find the cause with such an MWE.

Stefan

Cham
Posts: 904
Joined: Sat Apr 02, 2011 4:06 pm
Thanks Stefan.

Isolating the cause and creating a MWE (which triggers the "bug") will be difficult, since my main code preamble is really HUGE ! Yet, everything is working very nicely, except that pesky tilde inside a subsubsection title (what the ... !?).

In the preamble, I didn't changed the subsubsection settings, except the font style (using textsf instead of the default style). Or course, I tested this too, and it doesn't appears to be related to my issue.

I'll try to make a MWE which triggers the bug. May take some time...

Cham
Posts: 904
Joined: Sat Apr 02, 2011 4:06 pm
Wew ! It was much faster that what I thought.

Here's a simple MWE which triggers the bug. Very weird to me. Appears as a kind of packages clash or conflict.

\documentclass[12pt,letterpaper,twoside]{book}\usepackage[T1]{fontenc}\usepackage{amsmath}\usepackage{tocloft}	\setcounter{tocdepth}{3}\usepackage{hyperref}\usepackage{accents} \begin{document}\subsubsection{Test title $\tilde{Q}$}Bla bla bla\end{document}

As soon as I remove any of the lines in that preamble, under \usepackage{amsmath}, the bug disappears !

EDIT : Ah ! I think the issue is related to the ToC. LaTeX may have a problem showing the tilde in the ToC, for a small subsubsection title. I think it's a three ways issue, since the ToC is also clickable (from hyperref).

Cham
Posts: 904
Joined: Sat Apr 02, 2011 4:06 pm
I'm closing much faster to the cause and a solution !

The ToC is showing in the PDF viewer (on the side of the PDF document), and the tilde (or any mathematical expression, actually) can't be drawn correctly, there.

Using the command \texorpdfstring{}{} in the title solves the issue.

Is my interpretation right ?

Stefan Kottwitz
Posts: 9434
Joined: Mon Mar 10, 2008 9:44 pm
That's correct, the PDF standard doesn't support special symbols in bookmarks. You found it!

Stefan

Cham
Posts: 904
Joined: Sat Apr 02, 2011 4:06 pm
Ok, case solved then.

Thanks !