American Mathematical Society

My Account · My Cart · Customer Services · FAQ  

The snapshot package

The snapshot package helps the owner of a LaTeX document obtain a list of the external dependencies of the document in a form that can be embedded at the top of the document. In other words, it provides a snapshot of the current processing context of the document, insofar as it can be determined from inside LaTeX.

If a document contains such a dependency list, then it becomes possible to arrange that the document be processed always with the same versions of everything, in order to ensure the same output. This could be useful for someone wanting to keep a LaTeX document on hand and consistently reproduce an identical DVI file from it, on the fly; or for someone wanting to shield a document during the final stages of its production cycle from unexpected side effects of routine upgrades to the TeX system.

Normal usage involves the following steps:

  1. Add a \RequirePackage statement at the top of the document:
    1. \RequirePackage{snapshot} \documentclass{article} ...
  2. Run LaTeX on the document. This will produce a dependency list in a file \jobname.dep.
  3. Insert the .dep file at the top of the document, before the \documentclass statement. The following example shows what you would typically end up with for a document that used the article documentclass and the graphicx package:
    • \RequirePackage{snapshot} \RequireVersions{ *{application}{TeX} {1990/03/25 3.x} *{format} {LaTeX2e} {1999/06/01 v2.e} *{package}{snapshot} {1999/11/03 v1.02} *{class} {article} {1999/01/07 v1.4a} *{file} {size10.clo} {1999/01/07 v1.4a} *{package}{graphicx} {1999/02/16 v1.0f} *{package}{keyval} {1999/03/16 v1.13} *{package}{graphics} {1999/02/16 v1.0l} *{package}{trig} {1999/03/16 v1.09} *{file} {graphics.cfg}{0000/00/00 v0.0} *{file} {dvips.def} {1999/02/16 v3.0i} } \documentclass{article} \usepackage[dvips]{graphicx} ...

Making the necessary arrangements to ensure that future LaTeX runs of the document actually call in the specified versions is left to be handled separately, since the best way to go about this is highly system-dependent. The snapshot package only provides a way to generate the dependency list.

However, the \RequireVersions statement does record the given information in a form that can be accessed from within LaTeX. (It is for this purpose that it is not simply a comment.) In principle a package could be set up so that a later version would automatically attempt to emulate an earlier version if an earlier version was specified---much as LaTeX currently switches to 2.09 compatibility mode if it sees \documentstyle instead of \documentclass.

The package is included on the current TeX Live CD; it can also be downloaded from CTAN (the Comprehensive TeX Archive Network) or from the AMS:
   snapshot.zip
   snapshot.tgz
   snapshot.tar.Z