Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am generating a fairly large index of .txt, .tex, and .pdf files. This process has worked for a long time, and the size of the index is not the issue. I have added logic to insert additional links in the index and now am running into:

TeX capacity exceeded, sorry [save size=80000]


  1. What are the typical causes of this kind of problem, and any suggestions on how to determine the cause of this.
  2. Can the save size be increased?

Of course any solution that just allows me to increase the save size would be preferable if it works, the first question is only important if the size can't be increased or I run into this problem again.


  • Generating smaller indices seems to work just fine, only when I attempt to generate the entire index do I run into problems, so coming up with a MWE will be difficult.
share|improve this question
A possibility is that you have a gigantic group in which many assignments to be restored after group are made. –  egreg Sep 23 '13 at 7:03

1 Answer 1

up vote 9 down vote accepted

You can set the save size in texmf.cnf, eg TL2013 default setup has

save_size  = 100000     % for saving values outside current group

It will be somewhere like



kpsewhich texmf.cnf

But 99 times out of 100 if you are using a save stack of more than a few hundred, you are repeatedly setting the same token with both local and global assignments and using arbitrarily large save stack. (It is to avoid this problem that plain tex introduces the convention of using odd scratch registers for global assignments and even ones for local)

share|improve this answer
The file to edit is /usr/local/texlive/2013/texmf.cnf, not the one in web2c. –  egreg Oct 21 '13 at 23:35
FYI, in case others encounter this issue, I discovered that changing \MyToken=... to \global \MyToken=... resolved most of the issues. But, also using global assignments such as \xdef instead of an \edef helped. My thinking originally was that using local assignments instead of global would be better as the local variable could be reclaimed, but this was not the case. –  Peter Grill Jan 10 at 19:46
@PeterGrilla a csname only used with assignment only requires one value to be stored, but if you use local assignments it has to store more, so it can restore old values at end of group, and the implementation means that if you mix local and global assignments on the same token you can use a lot more space. –  David Carlisle Jan 10 at 20:26
@DavidCarlisle Running under Windows, I see 2 texmf.cnf files: under 2013 and 2013\texmf-dist\web2c. The first file did not have save size option and I added a value of 160000, while the second file had it set to 100000 and I changed to 160000. But still getting the same error that says 80000! What am I doing wrong? (Have no control of the assignments as they are inside Forest/PGF. –  ajeh Jun 13 at 16:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.