Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
3  
may be related Using MiKTeX and TeX Live on the same computer? –  texenthusiast Jan 7 '13 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 '13 at 18:55
2  
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 ...). –  Kurt Jan 7 '13 at 20:21

1 Answer 1

up vote 14 down vote accepted

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).

share|improve this answer
    
I have now uninstalled MikTeX, but TeX still successfully compiles, so it appears to have worked. Thanks a lot. :-) –  Gaussler Jan 8 '13 at 21:00
    
@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 '13 at 21:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.