I am trying to batch process a large number of files on Windows 10 generated by Mathematica using the Run command. Specifically, I am using Mathematica to create LaTeX files, then I'd like to use the Run command to compile them with XeLaTeX.

Using Run["xelatex.exe foo.tex"] works, but a command prompt window opens overtop anything else I am doing.

Following the recommendation from this post, I tried Run["!xelatex.exe foo.tex"] but that doesn't do anything but give a return code of 1. Additionally, using the "!" seems to go against some of the instructions given in this reference page.

Is there something else to do to keep the command window from opening?

  • $\begingroup$ Its good system programming philosophy, not to let start the console without notice, the more for programs that are able to learn and start other programs. This is allowed only for the user 'SYSTEM' in windows, e.g. for the Windows trusted installer, Windows Update. User apps like Mathematica, LaTeX. Word, PDF Viewer and script processors are disabled in their system management abilities in those times, when access over net became the normal some 20 years ago. $\endgroup$
    – Roland F
    Jul 9, 2023 at 12:16
  • $\begingroup$ @RolandF Interesting. My experience is definitely very LaTeX-specific; the front end that I use, TeXnicCenter, is able to run LaTeX without the console opening. That piece of software doesn't seem overly complex, so I figured there's got to be a way to get Mathematica to do it, too. Maybe it's an issue of telling the output to go somewhere else. $\endgroup$
    – GregH
    Jul 10, 2023 at 13:01


Your Answer

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

Browse other questions tagged or ask your own question.