8

Is there a standard way to manage package (.sty, etc) versions used by LaTeX documents? My company is interested in reproducibility - say 10 years from now they want to be able to take a .tex file from today, and have it compile to exactly the same PDF as it does today.

I saw this answer: Require a certain (or later) version of a package?, but this is only part way there. Ideally there would be something like Python's PIP where you include a requirements.txt that specifies acceptable versions of all packages. If the version isn't present, the package manager either tries to correct the situation or the build process dies with an appropriate warning.

At the moment, the plan is to use TeXLive as the standard distribution, so any tools that come with that would be fine as well - unfortunately, I'm more familiar with MiKTeX so apologies if there is already a builtin feature.

  • Depending on how serious you are about this, you need to consider the stability of binaries: even using plain TeX you've still got to have a working tex to compile it! – Joseph Wright Jul 7 '15 at 19:18
4

This is what I do: If you are serious about it, it is possible to save your entire LaTex distribution (including binaries) as well as your own code with every final compile. I do this in fact and it is not as much of a problem as you might think.

You could use a version control system, but I use 7zip which allows differential backups of all modified (and indeed deleted files). You can resurrect the exact status of your files for any final compile (including the exact status of your Tex binaries if you wish).

You will need the command line version of 7Zip. I'm on Windows so my command lines reflect that. First you have to create a master backup:

"C:\Pathto7Zip\App\7-Zip\7z.exe" a "X:\mybasefile.7z"  "X:\Pathofstufftosave"

I do this separately for my TexLive Distribution and for the area in which my own code is maintained

Then on each final compile, by batch file that runs the compile also runs the differential backup:

"C:\Pathto7Zip\App\7-Zip\7z.exe" u X:\mybasefile.7z "X:\Pathofstufftosave"  -ms=off -mx=9 -t7z -u- -up0q3r2x2y2z0w2!%difffile%

Where %difffile% is something that says how to name the differential backup.

As it happens I name it with the date and exact time -- easy to generate that within a batch file.

The exact status of the whole setup at any point in time can be created from the basefile and the (very small) differential backup. Every six months or so (usually aligned with a new TexLive distribution) I archive the basefile and all the differentials and start again with a new basefile.

Probably happy to help anyone wanting to set up this sort of scheme (in Windows)

  • So, "X:\Pathofstufftosave" is your TeXLive distribution folder? I suppose this is probably the only true way to do it since, as Joseph Wright mentioned it's possible that the LaTeX/TeX binaries might evolve along with the packages. – Jacob Schaer Jul 7 '15 at 21:32

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.