Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created April 24, 2015 12:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sciss/9fd5ac76d9b60c7d1bd3 to your computer and use it in GitHub Desktop.
Save Sciss/9fd5ac76d9b60c7d1bd3 to your computer and use it in GitHub Desktop.
Make a clean build via pdflatex, including biblatex and nomenclature
#!/bin/bash
echo ":::: CLEAN BUILD OF $1 ::::"
cd "$(dirname "$0")" # go into directory of script
rm -f ${1}.toc
rm -f ${1}.run.xml
rm -f ${1}.out
rm -f ${1}.nlo
rm -f ${1}.log
rm -f ${1}.bcf
rm -f ${1}.aux
rm -f ${1}.nls
rm -f ${1}.ilg
rm -f ${1}.idx
rm -f ${1}.blg
rm -f ${1}.bbl
pdflatex ${1}.tex > /dev/null
if [ -e "${1}.bcf" ]
then
biber -q $1
fi
if [ -e "${1}.nlo" ]
then
makeindex -q ${1}.nlo -s nomencl.ist -o ${1}.nls
fi
pdflatex ${1}.tex > /dev/null
pdflatex ${1}.tex > /dev/null
# cf. https://tex.stackexchange.com/questions/27878
pdflatex -shell-escape -interaction=nonstopmode -file-line-error "${1}.tex" | grep -i ".*:[0-9]*:.*\|warning"
# xdg-open ${1}.pdf
@elarivi
Copy link

elarivi commented Feb 19, 2021

Where do you run this code?

@Sciss
Copy link
Author

Sciss commented Feb 19, 2021

Oh gosh, this must be some old script; I think I used it for my PhD thesis, since it also builds bibliography, index, and nomenclature. Or do you mean, how to run it? It should work on Linux or Mac from the terminal. Like ./mkpdf.sh my-document when my-document.tex is the main latex document. Assuming a normal tex distribution (TexLive) is installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment