The issue is quite simple, I have a bunch of figures being generated with tikz (which in turn calls gnuplot). In order to bypass the memory issue I externalised tikz, which was fine until I tried plotting a larger contour (around 100k points). I now get the "! TeX capacity exceeded, sorry [main memory size=10000000]." error even if I increase the main memory by editing texmf.cnf

I can plot the figure in question with gnuplot independently but would rather have it done within the latex file for easier editing.

Any suggestions?

  • 3
    This is more like a workaround but worked for me, when I had a pretty similar problem with tikzexternalize. Try putting the tikz pictures in standalone documents and include the resulting pdf afterwards.
    – Rico
    Feb 28, 2016 at 17:41
  • 1
    A path with 100k points is an heresy. Feb 28, 2016 at 23:39
  • 1
    100k is probably too much but have you tried to compile with luatex? Also consider to decimate the points, do you really need to plot 100k?
    – mirkom
    Feb 29, 2016 at 1:47
  • @Rico thanks I'll try doing that, might end up being the best option
    – Felipe
    Feb 29, 2016 at 20:07
  • 1
    @Felipe If you reduce your data to 10k points, I'm pretty sure that no one will see the difference and your PDF file will be ten times smaller. Feb 29, 2016 at 22:58

1 Answer 1


there appears to be no direct solution, the options are: - either use luatex (see @PaulGaborit's reply) - reduce the number of points to be plotted (see @mirkom's reply) - generate the plot as a standalone file and then include the pdf (see @Rico's reply)

  • Definitely LuaLaTeX! A related question here.
    – Enlico
    Apr 29, 2016 at 22:13

You must log in to answer this question.

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