LaTeX vs. MiKTeX: The levels of TeX

A friend once asked us, “Should I use LaTeX or MiKTeX?” In various guises, this is a common question, seemingly innocent, but actually betraying a fundamental confusion about the levels of operation in the TeX world. As a further confusion, the word “TeX” can be used to refer to any of a myriad of items at any level. Starting at the top:

  1. Distributions: MiKTeX, TeX Live, W32TeX, … These are the large, coherent collections of TeX-related software to be downloaded and installed. When someone says “I need to install TeX on my machine”, they're usually looking for a distribution.
  2. Front ends and editors: Emacs, vim, TeXworks, TeXShop, TeXnicCenter, WinEdt, … These editors are what you use to create a document file. Some (e.g., TeXShop) are devoted specifically to TeX, others (e.g., Emacs) can be used to edit any sort of file. TeX documents are independent of any particular editor; the TeX typesetting program itself does not include an editor.
  3. Engines: TeX, pdfTeX, XeTeX, LuaTeX, … These are the executable binaries which implement different TeX variants. In short: There are other engines, but the above are by far the most commonly used nowadays.
  4. Formats: LaTeX, plain TeX, OpTeX, … These are the TeX-based languages in which one actually writes documents. When someone says “TeX is giving me a mysterious error”, they usually mean a format.
  5. Packages: geometry, lm, … These are add-ons to the basic TeX system, developed independently, providing additional typesetting features, fonts, documentation, etc. A package might or might not work with any given format and/or engine; for example, many are designed specifically for LaTeX, but there are plenty of others, too. The CTAN sites provide access to the vast majority of packages in the TeX world; CTAN is generally the source used by the distributions.

Output formats

TeX source files can be typeset into several different output formats, depending on the engine. Notably, the pdfTeX engine (despite its name) can output both DVI and PDF files.

At a high level, the output format that gets used depends on the program you invoke. If you run latex (which implements the LaTeX format), you will get DVI; if you run pdflatex (which also implements the LaTeX format), you will get PDF.

No TeX engine implements native HTML output, but it is still possible to get HTML, XML, etc., output:


ConTeXt is a special case, straddling levels. It contains a format at the level of plain TeX and LaTeX, but unlike the other formats, it is invoked via a separate program (e.g., context) which then runs a TeX engine. This makes it possible to support a wide array of advanced features, such as integrated graphics and XML input, since the control program can determine the flow of processing.


Of course, this short web page is only a brief introduction to the basics. Here are some pointers to further information.

This file is public domain. $Date: 2021/11/26 02:09:37 $;
TUG home page; webmaster; facebook; twitter; mastodon;   (via DuckDuckGo)