first of all, I need to mention that there are 2 related threads, that I found usefull: 1, 2.

I am working with TeXstudio 2.8.8 on Win 7 64bit (i5 @3.3GHz, 8GB RAM - if this matters). My goal is to load multiple .tex files into my pdfLaTeX-document which have been created by matlab2tikz. It used to work fine, but since the datapoints have increased I and ran into the same problem as @user1996 in Link no. 1. It still says: TeX capacity exceeded, sorry [main memory size=3000000].

At the moment there are 2 documents: the fist hast 40000 lines of autogereated code and the second one 10000. (In an \tikzpicture-environment)

I tried the solution suggested by @Joseph Wright in 1 but encountered the same problem as @Alexandre Willame described in his comment. I also tried the enable-write18 -extra-mem-bot=10000000 (and higher numbers) option, suggested by @Thomas F. Sturm in 1, but without success. The message is:TeX capacity exceeded, sorry [main memory size=13000000]. At a certian point I can't allocate more memory (Virtual memory exhausted), but it still gives me this message.

Finally I tried the way @A.GH suggested in 2. But this jeust resulted in an other (different) error message

I am really hoping for an answer / a way to implement the mentioned answers. The most wanted solution is the one from @Joseph Wright. But I don't know what's missing/wrong.

Additional Info: My TeXstudio Options (I am using pdfLaTeX)

In my preamble I wrote:

% TikZ
% and optionally (as of Pgfplots 1.3):
\pgfplotsset{plot coordinates/math parser=false}
% "TeX capacity exceeded, sorry [main memory size=3000000]."
  • I think the simplest solution is to compile either the whole document using LuaLaTeX or at least put the plots responsible for the error message to a dummy file using the same/almost the same preamble and "externalize" them. Then this externalized files can be incorporated easily in your main document. The "externalization" can be done using either the external library of PGFPlots or using the standalone documentclass. (Searching here for examples will give you plenty of results, if you don't know what I am talking about.) – Stefan Pinnow Feb 14 '17 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.