TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to check from command line whether tex and other commands belong to MiKTeX or some other distribution (I want to only (require 'tex-mik) in Emacs initialization if it's needed)?

share|improve this question
Do you want to check if miktex is installed or if it is the active tex system at the emacs startup? (I have miktex and 3 texlive systems and constantly switch the pathes to use or another). – Ulrike Fischer Jul 16 '14 at 14:38
@UlrikeFischer To check the active system at startup. Out of curiosity, why are you switching? Are you developing packages or styles and testing them for compatibility? – Alexey Romanov Jul 16 '14 at 15:29
I'm switching mostly for debugging. If there is an error in one system but not in the other one can search for differences. Also my customers have all sorts of texsystems, so it is good to know something about everyone. – Ulrike Fischer Jul 16 '14 at 15:38
up vote 8 down vote accepted

You can use pdflatex for that. If you call pdflatex --version you get which distribution is used, in my case TeX Live:

pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014/W32TeX)

kpathsea version 6.2.0

Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).


Or you can use the latex command, which works the same.

share|improve this answer

Your Answer


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.