Skip to content

Instantly share code, notes, and snippets.

@bjensen
Forked from timothyekl/gist:1217887
Created July 4, 2012 19:14
Show Gist options
  • Save bjensen/3049038 to your computer and use it in GitHub Desktop.
Save bjensen/3049038 to your computer and use it in GitHub Desktop.
Cross-platform: recompile LaTeX documents using Ruby, Guard
# Tested with Ruby 1.9
# Needs gem "guard" (https://github.com/guard/guard)
# Needs gem "guard-shell" (https://github.com/guard/guard-shell)
# Uses process "growlnotify" (http://growl.info/extras.php)
# Uses process "pdflatex" from standard TeXLive distribution
guard 'shell' do
watch(%r{(.+)\.tex}) do |m|
`growlnotify -m #{m[0]} Recompiling`
`pdflatex -interaction=batchmode #{m[0]} >/dev/null`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment