13

Is there a way to save the "current state" of my TeX installation, the various packages etc. that allow a document to be compiled into a pdf at this moment? In a year or two, I'll probably have a lot of package updates, etc. and it's questionable whether all of my documents will re-compile in the same way. Is there some way to save a format that will allow an identical recompile, or to save a snapshot of my installation in some way, or some other method?

Daniel
  • 730
  • 5
    you can zip up your tex input tree, and if really paranoid, all the binaries as well, but actually most latex documents do workthe same way after 10 or 20 years. – David Carlisle May 17 '15 at 10:11
  • 2
    You can copy/move the relevant package files (.sty) to a different location in your computer or external HD. – Alenanno May 17 '15 at 10:11
  • 2
    But like David said, most cases won't have this problem. Also, many packages have the ability to support old features/behaviours (see pgfplots for example). – Alenanno May 17 '15 at 10:13
  • 2
    If you are really really paranoid, you would need to save your current operating system as well. This won't be a troublemaker within the next 2 years, but think of 50 years. Possible, that the OS then cannot run current TeX or you need some kind of emulator. – Johannes_B May 17 '15 at 10:20
  • 1
    Who knows what the dominant file format will be for typeset material? It may well not be the "pdf" format. Being able to compile to pdf format in 20 years or more may be pointless if screen drivers and printer drivers for pdf-formatted files aren't around anymore... – Mico May 17 '15 at 10:53
  • Thanks for the comments. It appears this question may have been too broad. I was mostly worried about needing to re-use documents (I'm currently working with policy documents) within a 5-year or so time-span and not being able to re-compile correctly and was wondering if there is standard practice for this but it seems this isn't really an issue based on your responses. – Daniel May 17 '15 at 12:13
  • Packages change, sometimes there are changes that break compatibility. You should definitely get the ISO the current ISO from TeX Live that is updated regulary and hence always has a nice little screenshot. This ISO can be burnt on a DVD and you can put it in a drawer. Easy storing. No later changes needed (or just minimal changes). The OS and pdf stuff, who knows what will happen? – Johannes_B May 17 '15 at 12:41
  • 7
    There is in fact a package called snapshot, which can be combined with bundledoc and, if you like, arlatex to meet most or all of your needs. For example, see these two related answers: 1, 2. – jon May 17 '15 at 17:26
  • @jon those packages seem to be pretty close to the functionality that I'm looking for. If you'd like to post them below I will accept that as an answer. – Daniel May 17 '15 at 21:02
  • @jon I concur, snapshot is the best option. If your bib file is shared between several documents, think to "freeze" its current version. – Clément May 18 '15 at 08:17
  • I'm not big on the policy stuff on this site, but it might be better to close this question as a duplicate and provide links to one or two of those answers. However, if there is something missing from those answers that you want, I'm very happy to post a new answer below. – jon May 18 '15 at 15:04
  • @jon I don't currently have enough reputation to close as duplicate with providing links but if you want to, I think that's acceptable as I was able to get the explanation, understanding, and functionality I was looking for from the two links. – Daniel May 18 '15 at 17:39
  • No problem. Added a close vote. (Also upvoted your question earlier.) – jon May 18 '15 at 18:45

2 Answers2

4

One solution you might want to consider is compiling your own format that includes all the packages you are using and keeping this special compiled format with your latex file. In this case, when packages get updated, you will still maintain the same state that you have now.

You can read about compiling styles here:

  1. Using mylatexformat with this how to, probably the easiest and least disruptive to your actual document file.
  2. This post, which requires to split your document into a static preamble and dynamic contents.

The good news is that, once you start compiling your preamble this way, you will tremendously save on compilation time of the document. This is the glorious of this technique. (I personalize use that, with externalization for tikz graphics and I can compile very complicated journal papers in less than 10s).

If you really feel paranoid about it, you might want to keep a snapshot of your tex and latex binaries along with their fonts.

Bichoy
  • 1,369
  • The first howto link bitrotted, but here's a Wayback Machine archive version: https://web.archive.org/web/20160704053028/http://www.howtotex.com/tips-tricks/faster-latex-part-iv-use-a-precompiled-preamble Alternative step-by-step howto: https://tex.stackexchange.com/a/266279/1340 2nd howto: http://web.archive.org/web/20150406152732/http://magic.aladdin.cs.cmu.edu/2007/11/02/precompiled-preamble-for-latex/ (I've submitted an edit to inline the updated links). – Blaisorblade Jul 18 '17 at 16:14
1

You could try compiling within a virtual machine - popular "emulators" support open image formats, which could easily mean 10-15 years of support

Leo
  • 143