# [Tex/LaTex] How to increase bufsize for lualatex or pdflatex

luatexmemorypdftex

I work with large TikZ graphics for which the default bufsize of lualatex/pdflatex is too small:

Unable to read an entire line---bufsize=200000.


Is there a quick way to increase the buffer size for either lualatex or pdflatex without editing texmf.cnf?

If there is no quick solution, could someone please describe the obscure configuration mechanism of LaTeX that needs to be executed to process changes made to texmf.cf?

Also, where is texmf.cnf in a standard installation of a Ubuntu texlive package?
What happens to my changes to texmf.cf when I update the texlive package?

To find the texmf.cnf of your installation, use kpsewhich:

kpsewhich texmf.cnf


In a normal installation of texlive this will point you to a file that will probably tell you not to edit any other texmf.cnf.

You could try to increase the buf_size for one run by setting it on the cmdline:

buf_size=100000 pdflatex foo.tex


This may work, but you may also have to change texmf.cnf and recreate the formats.