9

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.

lukascbossert
  • 3,015
  • 1
  • 16
  • 37

1 Answers1

10

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!).

Great!


I played around with the options of bundledoc:

 bundledoc --keepdirs --verbose --include="*.tex"  --include="*.bib" test.dep
lukascbossert
  • 3,015
  • 1
  • 16
  • 37
  • 2
    I found https://ctan.org/pkg/texdirflatten, https://ctan.org/pkg/texdeps, https://ctan.org/pkg/texdepend. Maybe the topic "archival" helps, too? --> https://ctan.org/topic/archival. See also https://tex.stackexchange.com/a/418609/9075. – koppor May 05 '20 at 15:12