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.
  • A possibility is that you have a gigantic group in which many assignments to be restored after group are made.
    – egreg
    Sep 23, 2013 at 7:03

1 Answer 1


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)

  • 1
    The file to edit is /usr/local/texlive/2013/texmf.cnf, not the one in web2c.
    – egreg
    Oct 21, 2013 at 23:35
  • 1
    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. Jan 10, 2014 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. Jan 10, 2014 at 20:26
  • 2
    @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, 2014 at 16:57
  • In Linux, the file is at /usr/share/texmf/web2c/texmf.cnf To look for the other texmf.cnf files: run kpsewhich --all texmf.cnf Sep 10, 2016 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .