pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
187 stars 33 forks source link

Bug with ConTeXt LMTX (2021.05.21 15:07) and pgfplots (1.18.1 2021-05-17) #398

Closed WelterDevelopment closed 3 years ago

WelterDevelopment commented 3 years ago

The following MWE (newfile.tex) fails to compile:

\usemodule[pgfplots]

\starttext

\stoptext

Output: "tex error > tex error on line 4045 in file pgfplots.code.tex: TeX capacity exceeded, sorry [token memory size=1000000]"

Logs: newfile-error.log newfile.log

I really don't know what the error means and if it's a problem in the ConTeXt distribution or in the pgfplots module.

hmenke commented 3 years ago

I had a quick look and found that line 4045 https://github.com/pgf-tikz/pgfplots/blob/3bc2f42258fbfac9fe50b2978459da7e76fc046c/tex/generic/pgfplots/pgfplots.code.tex#L4045 is part of this absolutely gigantic invocation of \pgfkeys https://github.com/pgf-tikz/pgfplots/blob/3bc2f42258fbfac9fe50b2978459da7e76fc046c/tex/generic/pgfplots/pgfplots.code.tex#L737-L4831 which has more than 4000 lines in the argument to \pgfkeys. Apparently LuaMetaTeX has a much smaller stack size for macro arguments than LuaTeX and that is what you hit here. I will ask on the ConTeXt mailing list to increase the limit.

hmenke commented 3 years ago

https://mailman.ntg.nl/pipermail/ntg-context/2021/102281.html

hmenke commented 3 years ago

Answer is here: https://mailman.ntg.nl/pipermail/ntg-context/2021/102282.html Quoted below for simplicity.

Next lmtx upload will fix the issue (a configuration file that has not been updated). Hans told me to do this:

cp ./tex/texmf-context/web2c/contextcnf.lua ./tex/texmf/web2c/texmfcnf.lua mtxrun --generate context --make

in lmtx base dir. It should fix the issue until next upload.

Massi