Consider following situation: After being done with your TeX-project all included .tex-files are more or less in one subfolder next to your main .tex-file. But all figures used are spread all over your hard drive since they are used for different projects as well. The packages and documentclass are in the distribution and will be updated sooner or later.

Is there a way to copy automatically all relevant files of the TeX-project (e.g. as they are listed in the .dep-file made by the package snapshot) to a single folder or different folders distinguished what kind of file it is (figure, .sty, .cls etc.)?

In this way the project could be archived and it would be possible to re-create a pdf later.

  • pdflatex has a --recorder option to help with that Feb 23, 2018 at 21:55
  • try this package
    – touhami
    Feb 23, 2018 at 22:08

1 Answer 1


Ok, sometimes changing your search words are the key. All you need are two steps (for demonstration I chose the mainfile test.tex)

  1. Insert \RequirePackage{snapshot} before loading \documentclass. A file called test.dep will be generated which lists all required files for your document.

  2. run bundledoc test.dep in your terminal. A zip-file will be generated which contains all the files you used for test.tex (figures as well!).


I played around with the options of bundledoc:

 bundledoc --keepdirs --verbose --include="*.tex"  --include="*.bib" test.dep

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.