Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get all files used by a LaTeX compile
#/bin/sh
# from https://tex.stackexchange.com/questions/24542/create-list-of-all-external-files-used-by-master-latex-document
# use the perl script mkjobtexmf available with every TeX distribution and run it like
latex_file=test
mkjobtexmf --jobname $latex_file --cmd-tex pdflatex
#
#it creates an file <latex file>.fls which shows all used files, e.g. for a testfile named latex6:
#
#PWD /home/voss/Documents
#INPUT /usr/local/texlive/2011/texmf.cnf
#INPUT /usr/local/texlive/2011/texmf/web2c/texmf.cnf
#INPUT /usr/local/texlive/2011/texmf-var/web2c/pdftex/latex.fmt
#INPUT latex6.tex
#OUTPUT latex6.log
#INPUT /usr/local/texlive/2011/texmf-dist/tex/latex/base/article.cls
#INPUT /usr/local/texlive/2011/texmf-dist/tex/latex/base/article.cls
#INPUT /usr/local/texlive/2011/texmf-dist/tex/latex/base/size10.clo
#INPUT /usr/local/texlive/2011/texmf-dist/tex/latex/base/size10.clo
# my post-processing
zip $latex_file.zip $(grep INPUT *fls | egrep -v '/usr/|/etc/|/var/|\.aux|\.out|\.run.xml' | sort | uniq | sed 's/INPUT //') *bib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.