# [OS X TeX] TeX capacity exceeded?

Walschap, Gerard gerard at ou.edu
Wed Jul 16 19:45:04 EDT 2014

> Date: Tue, 15 Jul 2014 21:47:11 +0000
> From: "Walschap, Gerard" <gerard at ou.edu>
> To: "macosx-tex at email.esm.psu.edu" <macosx-tex at email.esm.psu.edu>
> Subject: [OS X TeX] TeX capacity exceeded?
> Message-ID: <24EDE56C-24B9-481C-A7A2-4A3A1051A3B8 at ou.edu>
> Content-Type: text/plain; charset="windows-1252"
>
> I have a brand new machine running OS 10.9.4 and TeXShop 3.36.2. I tested the installation by typesetting a simple document, and everything seemed to work. When I try to typeset a book I?m writing however, it gets stuck on chapter 2. The strange thing is that I haven?t touched chapter 2 in months. Here?s the relevant (I think) part of the console log:
>
> ./Chapter2.tex:1184: TeX capacity exceeded, sorry [main memory size=5000000].
> \rlap #1->\hb at xt@ \z@ {#1\hss }
>
>
>
> l.1184 ... can be found for example in \cite{HS74}
>                                                  . The relation between int...
>
> ./Chapter2.tex:1184:  ==> Fatal error occurred, no output PDF file produced!
> Transcript written on diffgeom.log.
> Latexmk: Index file 'diffgeom.idx' was written
> Latexmk: Reference Ex:detIsom' on page 83 undefined
> Latexmk: Summary of warnings:
>  Latex failed to resolve 1 reference(s)
> Collected error summary (may duplicate other messages):
>  pdflatex: Command for 'pdflatex' gave return code 256
> Latexmk: Use the -f option to force complete processing,
> unless error was exceeding maximum runs of latex/pdflatex.
> Latexmk: Errors, so I did not complete making targets
>
> <…>

> Howdy,
>
> This could be caused by one of several things but I'd first guess an infinite loop of some sort. Without some more information this is very difficult to diagnose. You might try using the etex package (\usepackage{etex}) but i'm not at all sure that will help.
>
> Good Luck,
>
> Herb Schulz
> (herbs at wideopenwest dot com)
>
> -----------------------------------------------------------------------
> Hi Herb, Gerard
>
> On 15/07/2014, at 3:31 PM, Herbert Schulz wrote:
> <….>
>
> Certainly an infinite loop here.
>
> Are you using any special packages for citations?
> Or any home-grown coding, related to \cite
> that is not guaranteed to be robust against changes in other packages?
>
> What happens if you run it again after a bombed-out run?
> This will have a fresh .aux  file.
> It might give a different result, at least initially; so run it
> yet again.
>
> Can you extract a minimal example that exhibits this behaviour?
>
> Hope this helps,
>
> 	Ross

Thanks, Herb and Ross, for the reply. I ran the exact same file on a different machine and it typeset without problems. So I reinstalled MacTeX on the new iMac, but got the same error again on the first typesetting. It doesn’t make much sense to me that the problem only occurs on a particular machine.

Forgetting this for the moment,  the problem seems, as Ross says, to be related to citations (no, I am not using any special package for citations): I deleted the citation "\cite{HS74}” (mentioned in the error message) from the document, ran it again, and got the exact same error message complaining about a different citation this time.

Now, I know next to nothing about how to deal with citations, so let me describe the setup briefly. I have a file, “diffgeom.bbl”, where I’m gradually putting all citations. The root document, “diffgeom.tex”,  basically contains the preamble, the \frontmatter with the preface and a line
"\nocite{*}%prints all bibliography"
(don’t ask me why). Next, another line “\tableofcontents", then the “\mainmatter" which inputs the separate chapters (“\input{Chapter1}”, etc). Finally, the “\backmatter" line, followed by:
"\printindex

\bibliographystyle{plainnat}
\bibliography{diffgeo}
\end{document}."

That’s it. I have no idea why the \bibliography entry says “diffgeo” instead of “diffgeom”, but it doesn’t seem to matter. The same error occurs if I replace it with “diffgeom”.

Thanks again,

-Gerard

`