GeneralTeX capacity exceeded !?

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

TeX capacity exceeded !?

Post by Cham »

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 :

Code: Select all

\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 ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

TeX capacity exceeded !?

Post by Stefan Kottwitz »

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
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

TeX capacity exceeded !?

Post by Cham »

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... :x
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

TeX capacity exceeded !?

Post by Cham »

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.

Code: Select all

\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).
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

TeX capacity exceeded !?

Post by Cham »

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. 8-)

Is my interpretation right ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Re: TeX capacity exceeded !?

Post by Stefan Kottwitz »

That's correct, the PDF standard doesn't support special symbols in bookmarks. You found it!

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: TeX capacity exceeded !?

Post by Cham »

Ok, case solved then.

Thanks !
Post Reply