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

David Carlisle d.p.carlisle at gmail.com
Sat Aug 12 22:16:39 CEST 2017

not really the stack directly but if you stick `\tracingall` at the
last point before the error, you should see macros expanding and
almost certainly getting in a loop somewere

On 12 August 2017 at 20:13, Hefferon, James S. <jhefferon at smcvt.edu> wrote:
> 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
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org

More information about the texhax mailing list