0

I'm using the Tikz package to create a series of plots directly in my main .tex file. I opted for this method because the labels match perfectly the font and size of my main file even if I scale or not the plot. Now I encountered a common problem that is the one related to the TeX capacity exceeded. The suggestion to overcome this problem seems to be to externalize the plots. About that I have two problems

  1. If I create the plot outside my main .tex file, will the font and size of the labels be math with the main .tex file even if I scale the figure?
  2. If yes, can someone describe the procedure to follow? I searched on other threads but I didn't fully understand the procedure. To write my .tex files I use TexMaker.
Stefan Pinnow
  • 29,535
Fly
  • 315
  • You should have very big diagram to have a TeX capacity exceeded. The TikZ manual can be compiled in one go... The more probable problem is a bug somewhere in your diagram. The faster approach is to try to use tikzexternalize library, which is automatic (see TikZ manual around page 666) – Rmano Mar 07 '21 at 11:39
  • Hello Rmano, thank you for your reply. The problem is that I have many plots (around 16). I could reduce the number of points for each graph but I'm afraid it could lead to lower quality of the plots. – Fly Mar 07 '21 at 11:43
  • 2
    The other option is using a standalone class file manually (this is handy too), be sure to use the same fonts of your main file, and do not scale the generated .pdf when you load it via \includegraphics. – Rmano Mar 07 '21 at 11:43
  • 1
    in the pgfplots manual there are hundreds of plots. Are you sure you are not overdoing with point density? Over a certain number is even bad for the plot: https://tex.stackexchange.com/a/318524/38080 – Rmano Mar 07 '21 at 11:47
  • Yes, this could be an option, but one of the reasons why I came to use inline tikz is because it's exactly match the font – Fly Mar 07 '21 at 11:47
  • Using tikzexternalize the font is matched too, and also if you use standalone correctly --- the only thing you have to check is that you do not scale anything. – Rmano Mar 07 '21 at 11:49
  • Probably you are right, one of the plots has 13000 points. – Fly Mar 07 '21 at 11:49
  • 1
    If printed/viewed 20cm wide, 13000 points mean one point every 15 μm. ;-) – Rmano Mar 07 '21 at 11:54
  • Are you changing the font size frequently? In that case externalize is probably the way to go. (Personally, I have never gotten shell escapes to work.) – John Kormylo Mar 07 '21 at 17:25
  • If you want to see how the external library can be used, have a look at e.g. https://tex.stackexchange.com/q/253181/95441 and the duplicate question that it links to. – Stefan Pinnow Mar 08 '21 at 15:58

0 Answers0