Skip to main content
Tweeted twitter.com/#!/askdifferent/status/470149730907873280
Added links and formatting.
Source Link
Graham Miln
  • 44.6k
  • 8
  • 94
  • 127

I'm using Mac OS 10.9.3Mac OS X 10.9.3, TeXLive-2013TeXLive-2013 and ScrivenerScrivener to write my papers. 

I'd like to use Apple's Automator in order to create a service (available from the Finder's right-click menu over a file) called "Compile TeX file" that runs a simple command using the selected file as an input.

ExempleExample:

  1. Inside a folder (/Volumes/Data/TeX_docs/) I've an exemple.tex file created by Scrivener that is ready for compiling with LaTeX.
  2. I'd like to right click this file and from the Finder's Service menu choose the option "Compile TeX file"
  3. Once chosen, this service will execute the command latexmk -pdf -bibtex exemple.tex and so compile the .tex file inside the same folder, creating a .pdf file (This Terminal command is working perfectly right now, so the need to automate this action!)
  4. After compiling the .tex file, a dialog box appears and asks if I want to delete all the temporary files with a Yes or No option. If Yes is chosen, it deletes all TeX temp files (.aux,.bbl,.bcf,.fdb_latexmk,.fls,.log,.out,.run.xml) and keep only the original exemple.tex and the new exemple.pdf file. Otherwise, it does nothing more and I have all the files in the end!

I'm using Mac OS 10.9.3, TeXLive-2013 and Scrivener to write my papers. I'd like to use Apple's Automator in order to create a service (available from the Finder's right-click menu over a file) called "Compile TeX file" that runs a simple command using the selected file as an input.

Exemple:

  1. Inside a folder (/Volumes/Data/TeX_docs/) I've an exemple.tex file created by Scrivener that is ready for compiling with LaTeX.
  2. I'd like to right click this file and from the Finder's Service menu choose the option "Compile TeX file"
  3. Once chosen, this service will execute the command latexmk -pdf -bibtex exemple.tex and so compile the .tex file inside the same folder, creating a .pdf file (This Terminal command is working perfectly right now, so the need to automate this action!)
  4. After compiling the .tex file, a dialog box appears and asks if I want to delete all the temporary files with a Yes or No option. If Yes is chosen, it deletes all TeX temp files (.aux,.bbl,.bcf,.fdb_latexmk,.fls,.log,.out,.run.xml) and keep only the original exemple.tex and the new exemple.pdf file. Otherwise, it does nothing more and I have all the files in the end!

I'm using Mac OS X 10.9.3, TeXLive-2013 and Scrivener to write my papers. 

I'd like to use Apple's Automator in order to create a service (available from the Finder's right-click menu over a file) called "Compile TeX file" that runs a simple command using the selected file as an input.

Example:

  1. Inside a folder (/Volumes/Data/TeX_docs/) I've an exemple.tex file created by Scrivener that is ready for compiling with LaTeX.
  2. I'd like to right click this file and from the Finder's Service menu choose the option "Compile TeX file"
  3. Once chosen, this service will execute the command latexmk -pdf -bibtex exemple.tex and so compile the .tex file inside the same folder, creating a .pdf file (This Terminal command is working perfectly right now, so the need to automate this action!)
  4. After compiling the .tex file, a dialog box appears and asks if I want to delete all the temporary files with a Yes or No option. If Yes is chosen, it deletes all TeX temp files (.aux,.bbl,.bcf,.fdb_latexmk,.fls,.log,.out,.run.xml) and keep only the original exemple.tex and the new exemple.pdf file. Otherwise, it does nothing more and I have all the files in the end!
Source Link

Create a service using Automator to compile .tex file in Mac

I'm using Mac OS 10.9.3, TeXLive-2013 and Scrivener to write my papers. I'd like to use Apple's Automator in order to create a service (available from the Finder's right-click menu over a file) called "Compile TeX file" that runs a simple command using the selected file as an input.

Exemple:

  1. Inside a folder (/Volumes/Data/TeX_docs/) I've an exemple.tex file created by Scrivener that is ready for compiling with LaTeX.
  2. I'd like to right click this file and from the Finder's Service menu choose the option "Compile TeX file"
  3. Once chosen, this service will execute the command latexmk -pdf -bibtex exemple.tex and so compile the .tex file inside the same folder, creating a .pdf file (This Terminal command is working perfectly right now, so the need to automate this action!)
  4. After compiling the .tex file, a dialog box appears and asks if I want to delete all the temporary files with a Yes or No option. If Yes is chosen, it deletes all TeX temp files (.aux,.bbl,.bcf,.fdb_latexmk,.fls,.log,.out,.run.xml) and keep only the original exemple.tex and the new exemple.pdf file. Otherwise, it does nothing more and I have all the files in the end!