0

Is it possible to have further lines in a TexShop engine which copy the resulting PDF to a different folder? (The reasoning: The new location would be a shared folder so only when the PDF-run was successful new versions get shared)?

  • 1
    You can write your own shell script which checks the exit code of the LaTeX compiler and copies the file if it is 0 (i.e., success), see, e.g., https://tex.stackexchange.com/questions/284849/do-we-need-to-manually-invoke-pythontex-texshop-engine-pythontex-with-xelatex, https://stackoverflow.com/questions/26675681/how-to-check-the-exit-status-using-an-if-statement-using-bash. – Marijn Dec 10 '18 at 08:47
  • Right now I don't know how to do such a check. But I can manage to create a shell-script to copy the file. – Martin Mueller Dec 10 '18 at 09:24
  • 1
    In the second link from my previous comment there are some examples of this check, e.g., https://stackoverflow.com/a/26675811/5763564 (this checks for value 1, i.e., an error, in your case you should change this to if [ $exit_status -eq 0 ]). When you put the check in your TexShop engine script directly below the call to pdflatex then the $? variable will contain the exit code from pdflatex (or xelatex, lualatex, latexmk, or whichever you use). – Marijn Dec 10 '18 at 09:33

0 Answers0