0

I have been creating vector graphics with the matlab2tikz tool and got the error message ! TeX capacity exceeded, sorry [main memory size=5000000]. As I found out on the matlab2tikz github page page I might be able to resolve the issue by running the lualatex command to remove the strict memory limitation. It is suggested to type into the system prompt:

lualatex main.tex

I am using a mac and therefore type this into the Terminal.

I get the following response:

enter image description here

MY QUESTION IS: What do I need to do to successfully run the command?

Mico
  • 506,678
Timon
  • 127
  • 2
    Is main.tex in your home directory? You need to navigate into the folder containing main.tex with cd. You can check if your are in the correct directory by typing ls in the command line. If main.tex is listed in the output of ls you are in the right place. – moewe May 31 '20 at 09:08
  • Just to be clear, the main.tex should be my preamble LaTeX file, correct? If I go the the folder which contains the preamble document using cd ~/Documents/Studium/Masterstudium\ Medizintechnik/Masterarbeit/Ausarbeitung and try to use ls I get ls: .: Operation not permitted. :( Trying to use lualatex Ausarbeitung.tex, where Ausarbeitung.tex is my main.tex filename I get ! I can't find file Ausarbeitung.tex. – Timon May 31 '20 at 11:10
  • 1
    No main.tex needs to be your main document file. Usually that is the file starting with \documentclass, but depending on your setup (if you have an externalised preamble that also externalises the document class) it may start differently. If main.tex contains only your preamble code, it is quite probably not the right file to compile. I don't know anything about Macs, but I always thought there were Unixoid and ls should work... (maybe this explains the ls thingy? https://apple.stackexchange.com/q/339862) – moewe May 31 '20 at 11:14
  • What Editor or Front End are you using? Did you typeset from within your editor before? – Herb Schulz May 31 '20 at 19:27
  • @moewe this helped a great bit! I was able to use the ls command and run the lualatex on my main.tex file. It ran through with me pressing enter at each ? popping up. I hope this was the right thing to do. While my LaTeX file does run through with this specific vector graphic not included it sill crashes with ! TeX capacity exceeded, sorry [main memory size=5000000]. if it's included. Did I do something wrong or does this just not work for me? One vector graphic with 2KB works but this with 32KB does not. Jpegs with 900+KB work fine though. How can this be? – Timon Jun 01 '20 at 11:28
  • @HerbSchulz I am using Texmaker. I unfortunately don't know what a Front End is and neither what you mean by typesetting. – Timon Jun 01 '20 at 11:30
  • 1
    Mhhh, normally you only get ? prompts when there is an error. In that case you should investigate why that error appears, fix it and re-run LuaLaTeX. – moewe Jun 01 '20 at 12:15
  • @moewe I got rid of all my errors and reran LuaLaTeX. I am still getting the exact same error message. What would you suggest to do now? I am trying to use the clean cleanfigure() command of matlab2tikz now. – Timon Jun 02 '20 at 09:52
  • 1
    Sorry, I don't know. I thought that LuaTeX does dynamic allocation, so I would not have expected the error. Maybe you want to think about externalising your figures. See https://tex.stackexchange.com/q/7953/35864 – moewe Jun 02 '20 at 09:54
  • Thank you for your help though. I will describe below that using the cleanfigure command was a workaround for me. – Timon Jun 03 '20 at 07:58

1 Answers1

0

LuaTeX did not work for me, even after I deleted all of my Errors, which showed up in my log-file.

However the cleanfigure command suggested under "2." on the GitHub Page did the job for me. This is a snippet of the Matlab code I use now:

cleanfigure
matlab2tikz('/Users/timonschulz/Documents/Studium/Masterstudium Medizintechnik/Masterarbeit/Ausarbeitung/Figures/Ergebnisse/MS1_P3_standardisiert_mg_pro_mW.tikz')
Timon
  • 127