23

I'm basically a noob when it comes to dealing with packages and TeX distributions. I currently have both MiKTeX and TeX Live installed with MiKTeX as the default distribution (I think), but I would like to change to TeX Live. The problem is: How exactly do I change this?

I am using Windows, and the editors I use are Texmaker and TeXstudio.

3
  • 4
    may be related Using MiKTeX and TeX Live on the same computer? Jan 7, 2013 at 18:38
  • I suppose the obvious thing to do is select the root for the tex executables like C:\texlive\2012\bin\win32\latex.exe in the Texmaker configuration.
    – azetina
    Jan 7, 2013 at 18:55
  • 3
    Perhaps (with low knowledge of computers) the easiest way is to uninstall TeXStudio, MiKTeX and TeXLive. After a new start of the computer install first TeXLive, then TeXstudio (so TeXStudio can recognize TeXLive and prepare the correct configuration ...).
    – Mensch
    Jan 7, 2013 at 20:21

2 Answers 2

28

When you compile a document foo.tex with, say, pdflatex through Texmaker, what happens “internally” is that in foo.tex’s directory, pdflatex foo.tex (probably with a few options) is called, as if on the command line. But how does Windows know where pdflatex is? Odds are your document is not in the same directory as your *TeX binaries. The answer is the PATH. The PATH is a system variable containing a list of directories in which Windows will search for something executable called pdflatex, starting with the first one, until it found something.

Assuming you have both TeX Live and MiKTeX installed, they would each have a directory in the PATH. You can find out which one is your “default” by typing tex --version in the command line. Whichever one is your “default” comes first in the PATH. To change the default, you need to switch the order of these two directories in the PATH. Whenever you’re meddling with the PATH, be extremely careful! Here are two ways of doing this:

Manually changing the PATH

Follow Paulo’s great description to your path (probably the admin path) and look for the two TeX entries; mine are C:\texlive\2012\bin\win32 and C:\Program Files\MiKTeX 2.9\miktex\bin\x64. To reverse the order, it might be helpful to copy the entire PATH into a text editor since the miniscule one-line text field in the Windows dialog is just uncomfortable to deal with. Then, simply switch the order of the two directories by copy-pasting, copy the entire PATH back into the Windows dialog and click “OK”. In my experience, you have to restart your editor (or the command line) in order for the changes to take effect. Calling tex --version again should confirm your change.

Changing the PATH with Path Editor

If you want to switch distributions more than once, the manual way might be a little tedious. A Super User Question showed me Path Editor (free and not affiliated with me), which gives you a graphic user interface:

Path Editor Screen Shot

Simply change the order of the two entries with “Up” or “Down”, click “Save”, and you’re all set (after the editor restart).

3
  • I have now uninstalled MikTeX, but TeX still successfully compiles, so it appears to have worked. Thanks a lot. :-)
    – Gaussler
    Jan 8, 2013 at 21:00
  • 1
    @Gaussler I’m glad everything worked out for you. I was actually assuming that you wanted to keep both distributions and switch between them. If you just want one, uninstalling the other should remove the uninstalled from the PATH, so that’s probably what happened.
    – doncherry
    Jan 8, 2013 at 21:04
  • Sound interesting! If we just change the "MiKTeX 2.9" fold in Program File to "MiKTeX-disable", does it still work?
    – Say OL
    Aug 12, 2015 at 15:58
-1

I need to change commands in TexLive, otherwise it still uses MikeTex even if TexLive is in PATH and is before MikeTex.

enter image description here

1
  • 2
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 7, 2021 at 16:41

You must log in to answer this question.

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