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

Hefferon, James S. jhefferon at smcvt.edu
Sat Aug 12 21:13:00 CEST 2017


Is there some way to see the contents of the stack?

Just for a brief description of why I want to do that: I'm having a lot of trouble developing a document class.  It is telling me this.

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

If I look in the log I see this.
 
Here is how much of TeX's memory you used:
 36435 strings out of 493029
 635171 string characters out of 6136234
 1080452 words of memory out of 5000000
 38236 multiletter control sequences out of 15000+600000
 248887 words of font info for 486 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 5000i,19n,6867p,10383b,1882s stack positions out of 5000i,500n,10000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!

I seem to be getting the error a lot when I say \begin{answer} ... \end{answer}. I am using the answers package, but the code I'm using seems right to me.

% Name of file holding answers
\newcommand{\answerbodyfilename}{answerbody}

\usepackage{answers}
\Opensolutionfile{\answerbodyfilename}
\Newassociation{answer}{ans}{\answerbodyfilename}

The file "answerbody.tex" contains lots of prior answers surrounded by the "ans" environments, so I think it is working OK up until that point.  Moving to the spot that gives the error and putting an \endinput and \end{document} immediately before the \begin{answer} shows instead a "59i" used on the stack, so I think there is something wrong in that particular answer.  But that answer has no recursion, just text. 

So I'm stumped.  I hoped that looking  at the stack would give me a clue, but I couldn't find in Chap 27 of the TeXbook if there was a way to do that.  Any other suggestion would be gratefully received.

Thanks,
Jim

     


More information about the texhax mailing list