Last active
August 29, 2015 14:03
-
-
Save mguentner/3d2575d68c89b68a00cc to your computer and use it in GitHub Desktop.
Shadow build larger latex documents
This file contains hidden or 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 | |
# Shadow $TMPDIR... | |
BASEDIR=$(pwd) | |
TMPDIR=$(mktemp -d /tmp/texbuild.XXXXXX) | |
FILES=("refdb.bib" "thesis.tex") | |
DIRECTORIES=("img" "code" "sections" "data" "data-xen") | |
if [ ! -d $TMPDIR ] | |
then | |
echo "Could not create tmp directory!" | |
exit 1 | |
fi | |
for file in "${FILES[@]}" | |
do | |
cp $file $TMPDIR/ | |
done | |
for dir in "${DIRECTORIES[@]}" | |
do | |
cp -a $dir $TMPDIR/ | |
done | |
cd $TMPDIR | |
pdflatex thesis | |
bibtex thesis | |
pdflatex thesis | |
pdflatex thesis | |
cd $BASEDIR | |
cp $TMPDIR/thesis.pdf output/. | |
# Cleanup | |
rm -rf $TMPDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment