Skip to content

Instantly share code, notes, and snippets.

@Klexx
Forked from djsutherland/latex-clean.sh
Created November 8, 2018 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Klexx/f8c02f571e35f0404f8f214a6e393aec to your computer and use it in GitHub Desktop.
Save Klexx/f8c02f571e35f0404f8f214a6e393aec to your computer and use it in GitHub Desktop.
A bash script to clean latex temp files
#!/bin/bash
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys"
for x in "${@:-.}"; do
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//')
if [[ -d "$arg" ]]; then
for ext in $exts; do
rm -f "$arg"/*$ext
done
else
for ext in $exts; do
rm -f "$arg"$ext
done
fi
done
rm -rf $(biber --cache) # gross biber bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment