Menu

#2119 Spaces break user defined chain of commands after compile error

None
wont-fix
nobody
None
1
2017-04-16
2017-03-23
Anonymous
No

Setting the PdfLaTeX command from the default of

pdflatex -synctex=1 -interaction=nonstopmode %.tex

to, say, the sequence of commands

ls | pdflatex -synctex=1 -interaction=nonstopmode %.tex,

and then compiling a file with errors using this command will cause future compiles not to work. For more details, see here

Discussion

  • Tim Hoffmann

    Tim Hoffmann - 2017-04-16

    You've setup the build system in a way that is a grey area where the behavior is not guaranteed: The commands on the command panel should only be single build system commands. Note that | chains build system command (see the manual).

    Background: Why does it fail?

    txs:///pdflatex is internally marked as a compilation command, i.e. it checks for errors in the log file and stops if there are any. For technical reasons, this is performed on every subcommand (which we expect only to be one, namely the pdflatex call). In your case, once you have an error in your log an run ls, the compilation is aborted and you never get to a new pdflatex call to update the log.

    What you should do:

    You have several ways to fix the configuration:

    • do not chain the commands in TeXstudio, but in the shell: sh -c "ls & pdflatex ...", or put all the commands in a shell script and call this.
    • Chain the commands in the build system (page "Build") by creating a user command:

    enter image description here

    The both variants differ slightly in the behavior for automatic recompilation: TXS checks if the log contains information that a rerun is necessary and then runs pdflatex again (configurable in Build -> Build Options, enabled by default). While first case runs ls with every rerun, i.e. ls pdflatex ls pdflatex ..., the second case runs ls only once ls pdflatex pdflatex.

    • Depending on what you actually want to do with the placeholder ls, there are also other variants, e.g. Build -> Meta Commands -> Precompile. Which is run only once per build (Note that compile is run twice in case of a bibliography: compile bibliography compile).
     
  • Tim Hoffmann

    Tim Hoffmann - 2017-04-16

    added a warning when running such a configuration

    hg 6506 (2260b9cd08a5)

     
  • Tim Hoffmann

    Tim Hoffmann - 2017-04-16
    • status: open --> wont-fix
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB