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:
- Distributions:
MiKTeX, TeX
Live, … 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.
- Front ends and editors:
Emacs,
vim,
TeXworks,
TeXShop,
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.
- Engines: TeX,
pdfTeX, XeTeX, LuaTeX, … These are the executable
binaries which implement different TeX variants. In short:
- pdfTeX implements direct PDF output, along with a variety of
programming and other extensions.
- XeTeX does the above, and also supports Unicode natively, OpenType
and TrueType fonts, access to system fonts.
- LuaTeX does all the above, and also provides access to many internals via
the embedded Lua language. Thus it is by far the most programmable engine.
- LuaMetaTeX is tightly bound to ConTeXt (see below).
- [e][u]pTeX provide full support for Japanese typesetting.
There are other engines, but the above are by far the most commonly used
nowadays. All these engines are included in TeX Live and other
distributions, and are available on all supported platforms.
- 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.
- 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
packages are designed specifically for LaTeX, others work only with
plain TeX, etc. CTAN (the Comprehensive
TeX Archive Network) provides 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. The formats
lualatex and xelatex run LaTeX using the LuaTeX and
XeTeX engines, respectively; they output PDF by default.
No TeX engine implements native HTML output, but it is still possible
to get HTML, XML, etc., output:
- The tex4ht program can be run
(e.g., htlatex, make4ht,
tex4ebook
). TeX4ht uses TeX behind
the scenes, so user macros, etc., are generally recognized. There are
many possible output formats, including Office XML.
TUGboat article on tex4ht, and a
second
article.
- The lwarp LaTeX package causes LaTeX
to output HTML5. It hooks into many packages to create the html.
TUGboat article on lwarp.
- The LaTeXML Perl program
independently parses LaTeX documents and generates many output formats.
ConTeXt
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. The
current version of ConTeXt uses the LuaMetaTeX engine; the format and
engine are developed in tandem. This makes it feasible to support a
wide array of advanced features, such as an integrated MetaPost library and XML input.
References
This short web page is only a brief introduction.
Here are some pointers to further information.
This file is public domain.
$Date: 2026/01/15 02:00:13 $;
TUG home page;
join TUG/renew membership;
webmasters;
facebook;
x;
bluesky;
mastodon.