3

How can I have several (La)TeX distributions co-existing on the same computer and easily switch between them using one editor? I am using Windows but it would be interesting to see answers for *nix and OS X as well.

Edit: I guess the editor needs to be able to give priority to one distribution.

Edit2: I am using TeXstudio but I am open to try a new editor.

phell
  • 183
  • In my opinion, this is a waste of disk space, because which one you compile with should have no effect on the pdf produced. But since I'm sure you have your reasons, I'll just say this: it should be easy. I'm only familiar with TeXworks, but the procedure for other editors should be simple. There is a dropdown menu that allows you to select a "compiler", so you can easily switch from, say, pdfLaTeX to XeTeX or whatever. Just add a compiler from whatever distributions you like. MikTeX bundles its own copy of TeXworks and sets up a few MikTeX specific things; you can just expand that list. – Mark May 03 '16 at 15:52
  • If your editor can find latex via the system path, you only need to change that and then restart your editor. On my Linux systems I have several versions of tex live, I've defined a short cut (soft link), such that current points to the tex live year I want to use. Then I can just move the short cut without having to restart anything (works because the lower bin levels in tex live below the year, all have the same name) – daleif May 03 '16 at 16:51
  • 2
    @Mark: Well, if somebody develops packages/class files it's quite convenient to have multiple distributions for crosschecking. It's necessary to check also for older versions, say, having TL 2013 etc. and TL 2015 in parallel –  May 03 '16 at 16:52
  • Ah, okay, I guess that makes sense. – Mark May 03 '16 at 16:55
  • 1
    @Mark As a 'core' dev., not only do I have TL2009-2016 (inclusive) on my Mac but also Windows TL14/15/16, MiKTeX 2.9 and Ubuntu LTS with TL09 :-) What exactly you need available depends on your normal work! – Joseph Wright May 03 '16 at 17:17
  • 1
    It would help to say which editor you use. In e.g. TeXworks you can set a search path independent of the system, so I have each TL release there in order, and when I want to alter which is in use I just reorder the entries in the path. – Joseph Wright May 03 '16 at 17:19
  • @ Joseph Wright: yikes! – Mark May 03 '16 at 17:37
  • I use notepad++ as my editor, compile by running a .bat-file from notepad++ that calls the TeX engine. By using the notepad++ plugin nppexec the bat-file can be run directly from notepad++.

    You could easily setup two different .bat-files that calls different distributions and use different shortcuts for the two commands. See for example this answer for more information on how to setup notepad++.

    –  May 03 '16 at 18:29
  • @Joseph Wright I updated my question. I use TeXstudio. – phell May 03 '16 at 18:34
  • With TeXstudio you can comfortably switch between distributions. Configure all the paths/commands/etc. with your primary distribution and add the others in the preferences under Build->User Commands. – samcarter_is_at_topanswers.xyz May 03 '16 at 19:15

1 Answers1

5

I have up four tex systems on my laptop and 6 on my PC (+ the context minimals). In my editor (winedt) I have setup a pop-up menu which I can call with Alt+Q which allows me to switch between the systems:

enter image description here

The entries of the pop-up are bound to winedt macro files which change the PATH environment variable: (xPATH is a variable which contains the original PATH)

 SetEnvVar('PATH','%$(`UFTeXLivePath16`);%$(`xPATH`);'); 

The macro also changes the status line of winedt so that I know which system I'm currently using. That works very fine and allows me to compare and test different tex system very easily with 4 keystrokes.

Ulrike Fischer
  • 327,261