Skip to content

Instantly share code, notes, and snippets.

@timothyekl
Created September 14, 2011 21:44
Show Gist options
  • Save timothyekl/1217887 to your computer and use it in GitHub Desktop.
Save timothyekl/1217887 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