I want to convert a latex file to a pdf file, using Mathematica. To do that, I installed MikTex and the I can run the following command in cmd:

lualatex main.txt

It works and it creates the pdf. So now, I wanted to let it run through MAthematica.

What I did was:

SetDirectory[NotebookDirectory[] <> "...PATH"]
RunProcess[{"lualatex", "main.txt"}]

... It starts to do something, but it does not end ? When I run itfrom cmd it takes about 20s to finish.

Anyone knows how to fix it ?


1 Answer 1


It works for me. So my guess is that you have a typo: main.txt should be main.tex, and lualatex is waiting for user input to "type another input file name", which is what happens if you use the command line and the input file is not found.

  • $\begingroup$ Yes, it's almost certainly this. To force the process to quit on error, use -halt-on-error -interaction=nonstopmode. I use these in MaTeX. tex.stackexchange.com/a/451013/6302 $\endgroup$
    – Szabolcs
    Jul 8, 2019 at 8:44
  • $\begingroup$ Thanks a lot ! Very helpful. $\endgroup$
    – james
    Jul 9, 2019 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.