Skip to content

Instantly share code, notes, and snippets.

@AllanLRH
Forked from djsutherland/latex-clean.sh
Last active December 18, 2015 00:58
Show Gist options
  • Save AllanLRH/5699938 to your computer and use it in GitHub Desktop.
Save AllanLRH/5699938 to your computer and use it in GitHub Desktop.
Bash script for cleaning up after a LaTeX run
#!/bin/bash
exts=".ind .out .sync .idx .ilg .fls .log .aux .fdb_latexmk .bbl .blg .brf .lof .lol .lot .nav .snm .tdo .thm .toc .synctex.gz .run.xml -blx.bib"
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment