Posts Tagged ‘tex’
TeX capacity exceeded
After the discovery of gnuplot’s tikz term, I have been using it for most of the plots I send to my advisor. A very nagging problem though is that when the number of data points is big, pdflatex would complain about “TeX capacity exceeded, sorry [main memory size = xxxx]” and refuse to compile. Today it has just come to a point I can’t stand this any more, so I did some googling and found a solution. Now TeX is a very messy system with fmt, sty, cnf files all over the place, so be sure to backup anything you touch in case something goes wrong.
Here’s a web page from JadeTeX that pointed me in the right direction, http://jadetex.sourceforge.net/#index-div-d18e113. The following solution is based on this.
- make changes to texmf.cnf. You may want to use `locate texmf.cnf’ to find where it is. Then in it, change `main_memory’ from 3000000 to say 8000000
- now regenerate latex.fmt for plain latex, or pdflatex.fmt for pdflatex. E.g., to recompile pdflatex.fmt:
- find where “pdflatex.ini” is
- cd to that path, then invoke “pdflatex -ini -progname=pdflatex pdflatex.ini”
Notice that this is different from what’s in the JadeTeX webpage. You need to invoke “pdflatex” instead of “tex” - now find where the original “pdflatex.fmt” is, back it up, and copy the generated “pdflatex.fmt” to there
- to regenerate “latex.fmt”, use “latex -ini -progname=latex latex.ini
Update@2011/06/08:
In gentoo, the proper way of fixing this once and for all is:
- Change the value of the corresponding field in file /etc/texmf/texmf.d/20sizes.cnf. This should persist through all future texliveupgrades.
- run texmf-update to regenerate the system-wide texmf.cnf
- run fmtutil-sys --all to regenerate the .fmt files
Update@2012/3/15:
alternatively one can compile with lualatex, which doesn’t seem to have a size limit
quick notes on using gnuplot’s lua terminal
In gnuplot,
set term tikz fulldoc color solid createstyle
set output 'tmp.tex'
p x**2 tit '$x^2$'
then in shell,
pdflatex tmp.tex
NB:
(1) ‘createstyle’ is crucial, otherwise tex will complain about missing ‘gnuplot-lua-tikz.sty’. This doesn’t seem to be mentioned in the first several google results
(2) I have to comment out the ‘utf8x’ package in the resulting tmp.tex. That may just be a problem with my tex environment