LaTeX formats

pdflatex, lualatex, platex… the command names look alike and breed confusion, but each is really a combination of a “format” and an “engine.” A format is a precompiled bundle of macros; an engine is the program that actually runs it. LaTeX is one such format, and it runs on top of several different engines. This page sorts out LaTeX2e, pLaTeX/upLaTeX, LuaLaTeX, and XeLaTeX along exactly that axis.

Format vs. engine

An engine is the executable that reads a .tex file and typesets it (TeX, pdfTeX, XeTeX, LuaTeX, e-pTeX, and so on). A format, by contrast, is a huge collection of macros — \documentclass, \section, and the rest — read in ahead of time and **precompiled into a single dump (a .fmt file)**. At startup the engine loads that .fmt in an instant, sparing itself from redefining every macro each run.

So “LaTeX” is the name of a format, not of an engine. The same LaTeX format can be run on different engines, and the command you type encodes which engine + format you want. pdflatex means “pdfTeX engine + LaTeX format”; lualatex means “LuaTeX engine + LaTeX format.”

LaTeX is not the only format. Knuth’s own bare-bones plain TeX, and ConTeXt, are other formats entirely. This page narrows to the most widely used one — LaTeX — and walks through the major engines you can run it on.

LaTeX (2e)

Today “LaTeX” means, almost without exception, LaTeX2e. It is the current version of Leslie Lamport’s LaTeX macros, now maintained by the LaTeX Project, and it arrived in 1994. The 2e was meant to signal a “small revision” of the earlier LaTeX 2.09, an interim step on the way to the long-planned LaTeX3.

But LaTeX3 never materialized as a standalone new kernel; its work was instead layered on top of LaTeX2e as expl3 (the LaTeX3 programming layer). Since 2020 expl3 is loaded as part of the format by default, and it is increasingly used inside the kernel to implement new features. The upshot: we still run plain LaTeX2e day to day, yet its internals keep being modernized with LaTeX3 technology.

The LaTeX2e kernel is now updated on a regular twice-yearly cadence (roughly June and November). The authoring model is consistent: pick a document class with \documentclass at the top, do package loading and configuration in the preamble up to \begin{document}, then write the body — the familiar “class + preamble” model.

Running this format on the pdfTeX engine is the most classic, standard pairing. The same pdfTeX splits into two commands by output target: latex runs pdfTeX in DVI mode and emits the intermediate DVI format (converted to PDF later by a separate tool), while pdflatex has pdfTeX emit PDF directly. For today’s mostly-Western-text documents, pdflatex is the de facto default.

pLaTeX / upLaTeX

pLaTeX and upLaTeX put the LaTeX format on engines built for Japanese typesetting. Japan-specific work — vertical writing, ruby (furigana), Japanese line composition — is handled by the pTeX family of engines, originally extended at ASCII Corporation. platex runs on the e-pTeX engine, and uplatex on the internally-Unicode e-upTeX engine.

This family always outputs DVI, then converts the Japanese-bearing DVI to PDF with **dvipdfmx** — a two-step pipeline (uplatex file.tex followed by dvipdfmx file.dvi). Pair it with upmendex for a Japanese index. For document classes, Haruhiko Okumura’s jsarticle/jsbook (for pLaTeX) and their Unicode counterparts such as ujarticle are common, as is the more recent, JIS X 4051-conformant **jlreq**.

The difference between platex and uplatex is internal character handling. The older platex is constrained in its internal encoding and weak on external characters and multilingual text, whereas uplatex is internally Unicode and handles Japanese mixed with Hangul or Cyrillic well. (Since 2023, platex has switched its underlying engine to e-upTeX while preserving backward compatibility.) For new Japanese papers, uplatex is the standard choice.

When to use it: when a Japanese society or publisher ships a class or style for pLaTeX, or when you want pTeX’s mature Japanese composition (vertical writing and the like), pLaTeX/upLaTeX is the solid pick. Conversely, if you want to use system fonts as-is or pour in Unicode directly, LuaLaTeX-ja (below) fits better.

LuaLaTeX

LuaLaTeX puts the LaTeX format on the LuaTeX engine; the command is lualatex. LuaTeX is an engine descended from pdfTeX that handles Unicode input directly and can load OpenType / TrueType system fonts installed on your OS via the fontspec package. It produces PDF directly, with no intermediate format.

As the name says, its hallmark is that the Lua scripting language is embedded in the engine. With \directlua{...} you can write Lua that reaches into TeX’s internals, making extensions that were once hard much easier. Japanese typesetting is handled by the **luatexja** package, delivering composition on par with pLaTeX while staying in system fonts and Unicode.

This modernity is why the LaTeX team increasingly points to LuaLaTeX as the modern engine and recommends it as a default for new projects. Its drawback is speed: compilation is heavier than pdflatex or xelatex (sometimes about twice as slow as XeLaTeX). If you want one engine that does Japanese, multilingual text, elaborate font handling, and programmatic typesetting, LuaLaTeX is the first candidate.

XeLaTeX

XeLaTeX puts the LaTeX format on the XeTeX engine; the command is xelatex. Like LuaLaTeX it supports Unicode input and direct use of system fonts via fontspec. For output it produces PDF through its built-in **xdvipdfmx** (a driver derived from dvipdfmx).

XeLaTeX’s strength is simplicity. For “I just want to use my system fonts,” it tends to be lighter to configure and faster to compile than LuaLaTeX. It can also select fonts by non-Latin names (e.g. fonts with Japanese names), which LuaLaTeX cannot. On the other hand it lacks Lua’s deep programmability, and the center of gravity for new development has been shifting to LuaTeX.

Command cheat sheet

Even with the same LaTeX format, the command name decides the engine behind it, the output format, and how fonts work. In the table below, read left to right starting from the command name.

CommandEngineOutputUnicode / system fonts
latexpdfTeX (DVI mode)DVI → needs conversionNo (needs inputenc etc.)
pdflatexpdfTeXPDF (direct)No (needs inputenc etc.)
platexe-pTeXDVI → dvipdfmxJapanese; legacy fonts
uplatexe-upTeXDVI → dvipdfmxInternal Unicode; legacy fonts
lualatexLuaTeXPDF (direct)Yes — fontspec / luatexja
xelatexXeTeXPDF (via xdvipdfmx)Yes — fontspec

In terms of the actual commands, the engines that emit PDF directly finish in one step, while the DVI-based ones add a conversion step.

console
# pdfTeX: PDF を直接出力 / emits PDF directly
$ pdflatex main.tex      # → main.pdf

# LuaTeX: PDF を直接出力 / emits PDF directly
$ lualatex main.tex      # → main.pdf

# upLaTeX: DVI を出力し、dvipdfmx で PDF へ変換
# upLaTeX emits DVI, then dvipdfmx converts to PDF
$ uplatex main.tex       # → main.dvi
$ dvipdfmx main.dvi      # → main.pdf

Which one to choose

A rough guide follows. The detailed criteria — speed, package compatibility, the Japanese situation, and so on — are explored on the “Choosing an engine” page.

  • Mostly Western text, quicklypdflatex. The most mature, with the widest package support.
  • Japanese papers / a required existing classuplatex (or platex when needed). DVI → dvipdfmx.
  • A modern do-everything engine, Japanese includedlualatex. Unicode + system fonts + luatexja.
  • Use system fonts with minimal fussxelatex. Light to configure and faster to compile.