10

I just started the TeX Live Update utility and saw that quite some packages were updated on the server. I proceeded to update all outdated packages, but this takes a while.

Is it safe (in terms of data-loss and file corruption) to keep working on my LaTeX documents and keep compiling? Or should I stop and wait for the update to complete?

I'm on OS X 10.8.5 with the TeXLive-2013 distribution.

3
  • 2
    Since latex only read packages etc, it should not do any harm
    – daleif
    Dec 10, 2013 at 19:01
  • When you update frequently (assume everyday like me), you might not need much time(few mins) to do a full update and eventually you come to know names and status of packages byheart. Dec 10, 2013 at 23:21
  • Update will fail if it wants to replace a package you are reading. Dec 11, 2013 at 0:46

4 Answers 4

8

Contra other posters, you can overwrite or modify an open file on OS X (as on any UNIX, as far as I know), so the update will succeed.

The only potential problem I see is a small race condition where e.g., a style file that you are using has been unpacked and moved into place, but other dependent files are not yet in place or font maps haven't been updated. This could result in a failure to compile your document or weird output.

2
  • 3
    (+1) re Unix-type systems. It is definitely possible to overwrite or modify open files on such systems. My workflow more-or-less depends on this behaviour. (Can Windows really not do this? It just seems... alien, I guess.)
    – cfr
    Sep 4, 2014 at 3:04
  • 3
    From a quick search, it appears that it can overwrite if the opening/creating application specifies a certain flag, but I don't think any of the Windows software I use does that. It's super annoying if you're coming from a UNIX background. Sep 4, 2014 at 3:33
6

I would wait for the update to be finished.

  1. There might be bugfixes for the packages you use in your documents. Hence working with old packages might result in errors already resolved.
  2. LaTeX may read the packages when you build your documents while they are being updated. This will also stop the building process, since you can't read and write on the same file at the same time.
1
  • 2
    This just isn't true for OS X or similar systems. Point (1) is marginally possible but point (2) is false and potentially extremely misleading to users who don't understand the way their systems work very well. Perhaps you could clarify that (2) is a concern only on certain systems, such as Windows, and inapplicable to others, including the OP's system?
    – cfr
    Sep 4, 2014 at 3:07
6

You asked two distinct questions and it is important to separate them. There is a very big difference between

  1. editing your documents while updating;
  2. compiling your documents while updating.

It is definitely perfectly safe to keep working on your documents during an update. The only potential problems involve compiling them during the update. I avoid this since it could easily get messy. (If compilation failed badly, I might have to stop and clear out corrupted auxiliary files which would require me to compile again, rerun helper programmes such as biber or makeglossaries and then compile again. Nothing terrible but potentially annoying.)

The only problem with editing during an update would be if you had your editor configured to continuously recompile. In that case, merely editing would also be compiling.

It is true, as Keks Dose's answer points out, that even editing your document potentially confuses things in case of an error since it may take some time to determine whether it was your edits or the update which caused the problem.

However, it is extremely straightforward to take precautions against this. Keeping your documents under version control has many advantages, including the ability to return your source to a known-good state easily and without fuss. If you don't wish to use version control, though, just save a copy of the document before updating so that you can test compilation of that version if you run into problems.

3

Do not update while working on your document (at least if you aren't a professional LaTeX user)

Some years ago, we had the case that an innocent update to a package (libertine) removed support for pdftex. I run the texlive update happily during the morning while working on a large document and all of a sudden compiling was impossible!

Naturally, I searched my document up and down for a mistake, naturally without result.

So: Do not edit your document while running an update of texlive. In case of an error you have two possible sources: the update and your work. Because it takes a lot of time to check the origin of the error, since that incident a couple of years ago I don't write and update the same time.


There may be a workaround -- see the comment of cfr below: e.g. to make a backup in time --, but usually I'm not that cool when my file does not compile. I want it to, now! And starting to search for differences between saved file and current (new packages? changed options? make a diff?, oops, how old is this backup?) -- all this takes much more time and effort than simply postpone the update to the lunch break.

2
  • (+1) but easy to work around. If you don't use version control, make a backup copy before you update so you can return to a known-good state for testing if necessary. (If you do use version control, of course, you can revert to such a state easily in any case.)
    – cfr
    Sep 4, 2014 at 12:09
  • This is a good argument for not updating before a document is submitted for publication (if ever!), and also why you should not disable backups in tlmgr or TeX Live Utility if you're a compulsive updater. It seems separate from the data loss/file corruption issue that the OP asked about, though. Sep 4, 2014 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .