[Tex/LaTex] How to call the Texshop-pdf-viewer after compilation


I'm using Mac OS X and TeXShop. I wrote a linux script which does some text substitutions and then calls the following main commands:

latex MyFile
biber MyFile
latex MyFile
latex MyFile

After the execution of the script, how can I call the TeXShop-pdf-Viewer?

Right now, I'm obliged to get back to TeXShop and to compile once again to visualize the pdf file and I'd like to automate this step.

Best Answer

The MacOS has an open command which allows you to open any application or document from the command line. So you can use

open -a TeXShop <file.pdf>

to open the PDF from your script.

Since I assume you're using an external editor to edit the source, you should set the TeXShop preferences to Configure for External Editor, and in the Preview panel of the preferences, choose Automatic Preview Update.