Skip to content

Instantly share code, notes, and snippets.

@noqqe
Created December 23, 2010 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noqqe/753005 to your computer and use it in GitHub Desktop.
Save noqqe/753005 to your computer and use it in GitHub Desktop.
Fraise App LaTeX Command
#!/bin/sh
# change to directory
cd %%d
# create pdf from .tex
/usr/texbin/pdflatex --output-directory %%d %%p
# get name
tex=%%p
# cleanup
if [ -e ${tex%.tex}.log ]; then
rm ${tex%.tex}.log
else
echo "Error. Trash files not found."
fi
# open generated file
if [ -e ${tex%.tex}.pdf ]; then
open ${tex%.tex}.pdf
else
echo "Error. Can't find generated PDF"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment