Sunday, December 30, 2012

TeX capacity exceeded

The desktop at home has some old TeX components from 2007 installed on it.

Trying to build a 2674-page PDF caused TeX to crash with the message "TeX capacity exceeded!" and a notice that [save size = 5000].

Googling around showed that the necessary file to change is texmf.cnf which find then showed to be at /usr/local/textlive/2007/texmf/web2c/texmf.cnf on my machine.

The first line that needed to be changed was this:

save_size = 5000 % for saving values outside current group %%% OLD
save_size = 50000 % for saving values outside current group %%% NEW

Rebuilding then caused TeX to fail later in the process with the same "TeX capacity exceeded!" message but pointer to the pool size. So the next line that needed to be changed was this:

pool_size = 1250000 %%% OLD
pool_size = 3250000 %%% NEW

(In both cases the values were taken from the newer (2009) TeX install on the laptop at home.)

Making the two changes above enabled the 2674-page PDF to build perfectly.

Note that now commands were necessary to make the texmf.cnf changes take effect. Just save the file and rerun TeX.