[Tex/LaTex] Multi-OS Portable TeX system

distributionsinstallingtexlive

I'm looking to treat myself to a totally portable TeX system and was wondering: is it possible to devise an installation scheme that would run on Windows, Linux and MacOS at the "same" time?

I think TeXLive is the best choice here, but I'd much rather avoid having to maintain three separate TeXLive installations. I'd like the three installations to share the package databases for instance.

I'll be using a 32Gb USB stick, in case it matters.

PS: I think I'm onto something here… will post back when I have a working prototype.

Edit: after reading this note I managed to format a USB stick with UDF and have it read and written in Linux and Windows (need to perform some tests on Mac yet). This is the first step towards interoperability.

Edit 2: well, as it turns out, the previous note was useless (the partition table breaks under Windows), I've found this question on superuser and it works like a charm. The only remaining step is writing a couple of scripts to set the environmental variables and we're done 😉

Best Answer

What you want is possible to achieve with TeX Live to some extent, but there are some caveats. People often want multi-OS setup on a network share and this is well supported. On a USB stick things are more complicated, because of symlinks which are not supported on Windows file systems[*] (FAT32 is the one usually found on USB sticks).

One way around it is to install with --portable option, add any platforms you require afterwards (Windows, OS X, etc.; this can be done only when installed on a Unix-like OS, again, due to symlinks problem), and finally copy everything to a USB stick with dereferencing symlinks to copy the linked files instead.

You won't be able to update such an installation afterwards, though (or to be more specific, updates of binary packages with symlinks won't work[*]). However, binaries are usually not updated between yearly releases, so you might in fact get away with this, but there is no guarantee [**].

A possible further hack would be to remove all platforms but the Windows one, but only from the TL database and not their actual files, so tlmgr is effectively fooled and won't do any updates to the "problematic" packages. Such a setup may be fragile under certain circumstances [**] and requires hand-editing of TL database, which I don't recommend to anyone unless they know exactly what they are doing and can recover from possible breakage.

Yet another approach to updateable system on a stick could be to keep updating the original "source" installation and sync it with the USB one afterwards, which is a bit less convenient and also means no updates on the go, but OTOH shouldn't cause any problems (the last famous words).

[*] Edit: To clarify the issue with symlinks - TL packages are stored simply as compressed tar archives (+ some meta data about the package). Symlinks are archived together with regular files and everything is extracted during package installation and/or update. If the file system doesn't support symlinks, this extraction will fail and therefore package installation/update will fail.

[**] Edit 2: TL makes package backup before its update, so update failure should not be fatal (the old version will be restored), but this can be fragile if the old version has some incompatibility with dependent packages.