Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeX capacity exceeded, sorry [grouping levels=255] #103

Closed
thorstengrothe opened this issue Feb 17, 2019 · 19 comments
Closed

TeX capacity exceeded, sorry [grouping levels=255] #103

thorstengrothe opened this issue Feb 17, 2019 · 19 comments
Labels
bug Something isn't working

Comments

@thorstengrothe
Copy link

I got one big file containing at least 150 exercises and a personal sty file with a lot of custom macros and environments. The file contains graphics and some larger tikz pictures. All exercises are tagged. Compiling the file with all tags enabled:

\buildtags{%
  Grundlagen,
  Bedürfnisse,
  Güter,
  Ökonomisches Prinzip,
  Wirtschaftskreislauf,
  Geld,
  Warenkorb,
  Magisches Viereck,
  Preisbildung vk. Markt,
  Elastizitäten,
  Produktionsfaktoren
}{Test}

leads to TeX capacity exceeded, sorry [grouping levels=255]. Commenting out some tags helps and the documents compiles. I searched a lot in my code but I cannot find the error. Maybe the file is too large or it is something wrong in my sty file or it is a exercisebank issue or it is tikz. I don't know.

I would be happy if someone could give me tipp how to deal with this error...

Thorsten

@Strauman
Copy link
Owner

Strauman commented Feb 17, 2019

I suspect you have already done most of these, but, here is my initial thoughts:

  1. Check out if it could be related to LaTeX crashes if newline in makeset #100.
    1a) try putting % at the end of each line
  2. Make sure it's not about the . in the file name (in e.g. Preisbildung vk. Markt)
  3. You have a some special characters (üöä), make suere it's not those
  4. In the error log it should say more. Does it say more about where it happens? Is it in a comment.cut-file.

What build number is it you are working on?

@thorstengrothe
Copy link
Author

Thanks for your fast response.

Points 1-3: I fixed them all --> same result
Point 4: nothing special in comment.cut only the last exercise before the error comes. If I comment out this exercise another one comes out :-)

This are the last lines of the log file

./KA_VWL.tex:97: TeX capacity exceeded, sorry [grouping levels=255].
\@begin@tempboxa ...tempboxa #1{\color@begingroup --> this is the  error!!
                                                  #2\color@endgroup }\def \w...
l.97 }{Test}
            
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
 
Here is how much of TeX's memory you used:
 56389 strings out of 492639
 1270139 string characters out of 6135497
 1720615 words of memory out of 5000000
 58552 multiletter control sequences out of 15000+600000
 629253 words of font info for 360 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 74i,20n,111p,9138b,21114s stack positions out of 5000i,500n,10000p,200000b,80000s
./KA_VWL.tex:97:  ==> Fatal error occurred, no output PDF file produced!

For conveniance I attached the complete log file here
KA_VWL.log

One thing I found could be to put all Tikz pictures in a separate file with the help of the standalone package Unfortunately standalone seems not to be compatible with exercisebank. Loading it produces this error:

> ERROR: LaTeX Error: Command \ClearHook already defined.
> 
> --- TeX said ---
>                Or name \end... illegal, see p.192 of the manual.
> 
> See the LaTeX manual or LaTeX Companion for explanation.
> Type  H <return>  for immediate help.
>  ...                                              
>                                                   
> l.214 }
>        
> --- HELP ---
> No help available

@Strauman
Copy link
Owner

Strauman commented Feb 18, 2019

  1. The problem seems to be in regards to some color box?

  2. When using standalone, are you loading exercisebank twice? The standalone documentclass doesn't seem to define \ClearHook? Also \ClearHook is just defined for later use, not actually used (yet). I'll rename it and make it internal at next push.

@thorstengrothe
Copy link
Author

Ok after some time of testing I found something. I attached two files for testing with enumitem and custom macro definition. If you run this the error comes. I guess it has something to do with enumitem. Can anyone test and report?

I tested with latest development release!

KA_Testing.txt

enumitem_bug.txt

@thorstengrothe
Copy link
Author

2\. When using `standalone`, are you loading exercisebank twice? The standalone documentclass doesn't seem to define `\ClearHook`? Also `\ClearHook` is just defined for later use, not actually used (yet). I'll rename it and make it internal at next push.

It works now with the latest release, thank you!

@Strauman
Copy link
Owner

Strauman commented Feb 20, 2019

  • Everything worked now, or just the standalone?
  • Did you check if you loaded exercisebank twice?
  • Can you provide the files using only essential content? That is - reduce to the minimum of what's necessary to reproduce

@thorstengrothe
Copy link
Author

@Strauman
Standalone works now, the other thing not :-)

  • The first file KA_Testing.txt is just necessary to see the error.
  • The second one enumitem_bug.txt repeats 150 times the same exercise. I did that because I want to save you to copy the exercise 150 times and I do not know how to write a loop to do this, should I make is smaller?

@thorstengrothe
Copy link
Author

I reduced the size of the file enumitem-bug.txt but you have to repeat it. I tested with 150 times and the error comes maybe it comes earlier. Here are the two files again.

KA_Testing.txt
enumitem-bug.txt

@Strauman
Copy link
Owner

I think you might just have so many exercises that LaTeX runs out of memory?

@thorstengrothe
Copy link
Author

@Strauman
ok I guess this is a bug. I got here to simple files without any personal macro definition and standard article class. If you repeat the exercises in Testing.tex exactly 123 times the error comes. It's a problem with pdlatex and exercisebank, I'm pretty sure. I got documents here which are about 300 pages and more, this is one of the great benefits of latex in my opinion. For me this is a problem, because I often have very long exams. I attached two modified files again. Please look at it !

KA_Testing.txt

Testing.txt

@Strauman
Copy link
Owner

123, but not 124?

@Strauman
Copy link
Owner

I will look at it, but later :)

@Strauman Strauman added the bug Something isn't working label Feb 23, 2019
@thorstengrothe
Copy link
Author

123, but not 124?

123 is the last repetition possible everything above will fail :-)

@Strauman
Copy link
Owner

Okay. I assume that there is something that is nested. It could be that I forgot a \egroup in the code somewhere. I'll have a lokk later.

Strauman added a commit that referenced this issue Feb 24, 2019
@Strauman
Copy link
Owner

Please try build 130?

@Vouivre
Copy link

Vouivre commented Feb 24, 2019

Hi,

today I got exactly the same error. Before I also had big files, one had more than 300 exercises. There was no problem. To include the exercises, I used:

\makeset[nohead]{databaseexercises}

where databaseexercises.tex contains all exercises.

Now all my problems are split and to collect them I use:

\xdef\exercisefiles{exerciceGm1}
\foreach\i in {2,...,136}{%
\xdef\exercisefiles{\unexpanded\expandafter{\exercisefiles},exerciceGm\i}
}
\edef\makesetargs{{myExerciseSet}{\exercisefiles}}
\expandafter\makeset\makesetargs

With build 130 there is no more problems. Thank you thorstengrothe for reporting it! I hope it also solve your problem!

@thorstengrothe
Copy link
Author

@Strauman
I tested with 146 exercises and version 130 - it works until now without erros :-)

@tristelune1
I'm thinking about how to organize my exercises. I like the one-big-file-strategie because it's simpler but it's harder to debug if something goes wrong. I do not fully understand how you organize your files now. Do you have one big file or do you have several files?

@Vouivre
Copy link

Vouivre commented Feb 24, 2019

@thorstengrothe
At the moment I have big files, but I will split them. There are pros and cons, but probably Andreas can help us. It's not the same issue, are you interested to open an issue to discuss it ?

@Strauman
Copy link
Owner

It is now #107
I think this is an important discussion. It might require big changes on the core of the program, but it's important that we can figure out a good way of doing this. Let's discuss it further in #107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants