Created
February 27, 2012 18:45
-
-
Save kersny/1926118 to your computer and use it in GitHub Desktop.
reload pdf in Skim on compile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# the first argument should be the tex file, either with or without extension | |
file="$1" | |
# run pdflatex and bibtex, and open or reload the pdf in Skim | |
#pdflatex "${file}" && bibtex "${file}" && pdflatex "${file}" && pdflatex "${file}" && \ | |
/usr/bin/osascript \ | |
-e "set theFile to POSIX file \"${file}\" as alias" \ | |
-e "set thePath to POSIX path of theFile" \ | |
-e "tell application \"Skim\"" \ | |
-e " activate" \ | |
-e " set theDocs to get documents whose path is thePath" \ | |
-e " try" \ | |
-e " if (count of theDocs) > 0 then revert theDocs" \ | |
-e " end try" \ | |
-e " open theFile" \ | |
-e "end tell" \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment