1
$\begingroup$

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 ?

$\endgroup$
3
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • $\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 '19 at 8:44
  • $\begingroup$ Thanks a lot ! Very helpful. $\endgroup$ – james Jul 9 '19 at 7:39

Your Answer

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

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