Skip to content

Instantly share code, notes, and snippets.

@yig
Created January 15, 2016 04:36
Show Gist options
  • Save yig/ba124dfbc8f63762f222 to your computer and use it in GitHub Desktop.
Save yig/ba124dfbc8f63762f222 to your computer and use it in GitHub Desktop.
Runs latexmk in draft mode (fastest) followed by a batch mode (actually generate the PDF).
#!/bin/bash
## Simple draft mode followed by pdflatex once by using the print hook.
## With no arguments, it will follow a 'latexmkrc' file if there is one.
## You still get the nice error messages at the end:
latexmk -pdf -pdflatex='pdflatex -draftmode %O %S && touch %D' -print=pdf -e '$lpr_pdf=q|pdflatex -interaction=batchmode -synctex=1 %R|' "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment