Skip to content

Instantly share code, notes, and snippets.

@larsvilhuber
Created December 8, 2018 01:07
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 larsvilhuber/fdd9b5abc4d3e2355cba81024fe1e13f to your computer and use it in GitHub Desktop.
Save larsvilhuber/fdd9b5abc4d3e2355cba81024fe1e13f to your computer and use it in GitHub Desktop.
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