-1

i am using sphinx to build my latex document but everytime i run the make latexpdf command, latex stops the build and asks for user input -- latex is not running with nonstopmode. In the past i was able to put the nonstopmode in a makefile and use "-use-make" with latexmk to compile everything. Did some digging on Sphinx and can't really find what i am looking for.

mzjn
  • 48,958
  • 13
  • 128
  • 248
  • Why can't you update the Makefile now? How can we reproduce the problem? – mzjn Dec 29 '21 at 14:09
  • 1
    yeah, apologies in advance but it's a little difficult to provide a MWE. As i understand it, Sphinx write to the latex makefile. If i update the makefile, those updates will be overwritten by sphinx on my next build. And i am using sphinx to build my latexpdf. – Austin Benny Dec 29 '21 at 14:14
  • 2) yes, i am using the "make latexpdf" command by sphinx to build my pdf. 1) when making latex pdfs without sphinx, i could add the interaction mode to my makefile. I tried doing that now, but my addition disappears everytime i run "make latexpdf" – Austin Benny Dec 29 '21 at 14:29
  • 1
    Wouldn't it be better to fix the errors in your latex code instead of running in nonstopmode? – samcarter_is_at_topanswers.xyz Dec 29 '21 at 14:39
  • @samcarter_is_at_topanswers.xyz i think running without non-stop mode will still stop on the "serious errors" but the minor ones like incorrect reference, something already defined, package conflicts, etc will still need user input. – Austin Benny Dec 29 '21 at 15:00
  • @mzjn i am using sphinx to build my pdfs. It also needs to be an HTML format, therefore, sphinx makes sense. – Austin Benny Dec 29 '21 at 15:01
  • Does it work if you use `make latexpdf LATEXMKOPTS="-interaction=nonstopmode"`? – mzjn Dec 29 '21 at 15:28
  • 1
    @AustinBenny No there isn't really a concept of serious errors. In non-stop mode, latex will just syntax check the rest of the document, not necessarily producing sensible output. Just fix the errors and compile again. – samcarter_is_at_topanswers.xyz Dec 29 '21 at 15:44
  • 1
    @mzjn yes! thank you. that was the command i was looking for. Apologies for the miscommunication; very new to sphinx. – Austin Benny Dec 31 '21 at 15:14
  • @samcarter_is_at_topanswers.xyz im pretty sure running in non-stop mode only stops compilation on "fatal errors" when the PDF is not produced. However, the incorrect references, and minor errors are still in the PDF. – Austin Benny Dec 31 '21 at 15:15
  • @AustinBenny The production of a file which might or might not be a valid pdf is not a good criterion. Just look at the million of "why is my document in italic"-questions whose users ignored the error about missing math mode. Like said before, after any type or error, latex just keeps syntax checking the rest of the document, the results it produces through this might make more or less sense. – samcarter_is_at_topanswers.xyz Dec 31 '21 at 15:34

1 Answers1

0

The -interaction=nonstopmode option can be provided via the LATEXMKOPTS Makefile variable:

make latexpdf LATEXMKOPTS="-interaction=nonstopmode"

See https://www.sphinx-doc.org/en/master/usage/builders/index.html#sphinx.builders.latex.LaTeXBuilder.

mzjn
  • 48,958
  • 13
  • 128
  • 248
  • Where is this supposed to go when building under Windows ? I tried `set LATEXMKOPTS="-interaction=nonstopmode"` in `make.bat` but it's still running in interactive mode. – Arthur Attout Jan 10 '23 at 15:41
  • @ArthurAttout: I'm not sure. Maybe you are not even using latexmk since you are on Windows. See the note in the section that is linked in the answer. It says "Since 1.6, make latexpdf uses on GNU/Linux and macOS latexmk, as it makes sure the needed number of runs is automatically executed. On Windows the PDF builds execute a fix number of LaTeX runs (three, then makeindex, then two more)." – mzjn Jan 10 '23 at 15:59