Created
February 7, 2016 13:09
-
-
Save RGreinacher/ec4dd13f18124d37fc89 to your computer and use it in GitHub Desktop.
Create PDF from a .tex file
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 | |
#title :makepdf.sh | |
#description :This script (double) compiles a tex file into a pdf and cleans up everything afterwards. | |
#author :Arik Grahl, Robert Greinacher | |
#date :2014-07-18 | |
#version :0.1 | |
#usage :bash makepdf.sh FILENAME.TEX | |
#notes :Install latex, pdflatex to use this script. The one liner ca be used in e.g. your .vimrc to automatically compile a tex file right out of vim | |
#bash_version :any | |
#==================================================================== | |
# check for given arguments | |
if [ "$1" != "" ]; then | |
# check if the biber citation management tool is used | |
if file *.bib; then | |
pdflatex -shell-escape -halt-on-error -file-line-error $1 | |
biber `basename $1 .tex` | |
pdflatex -shell-escape -halt-on-error -file-line-error $1 | |
fi; | |
#compile and clean up | |
pdflatex -shell-escape -halt-on-error -file-line-error $1 | |
rm -f *.aux *.log *gnuplot* *.bbl *.bcf *.blg *.fdb *.fdb_latexmk *.fls *.lof *.out *.xml *.toc | |
else | |
echo "usage: $0 TEXFILE" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment