ConTeXt is a second, full-fledged document-preparation system built on TeX. It belongs to the same family as LaTeX — both are “formats” — but its design philosophy is quite different: a consistent family of \setup... commands gives fine control over appearance, and MetaPost drawing is deeply integrated. It is an alternative to LaTeX, favored especially for elaborate layouts and automated typesetting.
What is ConTeXt
The pdfTeX, XeTeX, and LuaTeX we have seen so far are engines — the programs that do the processing. ConTeXt sits at a different layer: like LaTeX, it is a format, a system of commands assembled from TeX macros. It has been developed since the 1990s by Hans Hagen of the Netherlands and his company PRAGMA ADE (Advanced Document Engineering), originally as a production tool for their own publishing work. The name comes from “text with TeX” — con-tex-t.
Its place is a little confusing: although ConTeXt is not an “engine” in the pdfTeX/XeTeX sense, introductory material often lists it alongside the engines and formats. It is more accurate to think of it as a sibling of LaTeX that runs on top of an engine. Built on the same TeX foundation, it offers a different way of writing documents.
How it differs from LaTeX
Where LaTeX is a culture of bolting features together from a vast collection of third-party packages, ConTeXt is highly integrated and monolithic. Color, layout, fonts, tables of contents, footnotes — they are all designed together from the start. So you spend less time wondering “which package do I add for this, and will it clash with another?”, and complex page layouts are easier to control cleanly. That integration is its central strength.
The interface is consistent too. Almost all appearance is specified through **setup commands that begin with \setup..., combined with key=value** options. The body font size is \setupbodyfont, the paper size is \setuppapersize, paragraph spacing is \setupwhitespace, and so on — the naming and syntax are strongly regular. There is little ad-hoc “grammar” to memorize, and settings stay legible.
The markup itself also differs from LaTeX. The body — LaTeX’s \begin{document}…\end{document} — is wrapped in \starttext … \stoptext, and a section is \startsection … \stopsection (or just \section for the heading alone). Environments are expressed with **matched \start…/\stop… pairs**, which is the ConTeXt idiom.
The learning material gathers differently, too. LaTeX knowledge is scattered across countless books, Q&A sites, and package manuals worldwide, whereas ConTeXt documentation is comparatively centralized — the official ConTeXt wiki (contextgarden) and primers such as *ConTeXt: an excursion*.
The MkII / MkIV / LMTX lineage
ConTeXt comes in three main lines, each matched to a generation of the underlying engine. All of them are “ConTeXt,” but they run on different engines with different internals.
- MkII — the oldest line, running on pdfTeX (and on XeTeX for scripts such as Japanese). It is now frozen and only maintained.
- MkIV — the Lua-era rewrite running on LuaTeX. Introduced in 2007, it exploits Unicode, OpenType fonts, and Lua scripting. It too is largely frozen.
- LMTX (internally MkXL) — the current, recommended line, running on LuaMetaTeX. Available since 2019, it is where active development continues.
The key piece here is LuaMetaTeX. It is a lean engine that Hans Hagen and the ConTeXt developers rebuilt specifically for ConTeXt, as the successor to LuaTeX. It deliberately strips out PDF output (the backend), font handling, and many primitives from LuaTeX, leaving those to be implemented on the ConTeXt (Lua) side — a bold design. It has no dependencies on external libraries, needs no complex build ecosystem, and ports across operating systems with minimal effort: a stripped-down, self-contained successor.
LuaMetaTeX is maintained by the ConTeXt group itself, and for now ConTeXt (LMTX) is effectively the only thing that puts it to real use. If you are starting fresh with ConTeXt, LMTX is the standard choice.
Deep MetaPost integration
No account of ConTeXt is complete without its fusion with MetaPost. MetaPost is a programming language for precise figures, descended from Knuth’s METAFONT. ConTeXt embeds MPlib at its core — MetaPost turned into a reusable library, separated out by Taco Hoekwater and Hans Hagen in 2007 — so you can write MetaPost code directly inside a document and draw figures on the fly, during the same compile.
In the older MkII, drawing figures at run time either slowed the TeX run or required generating intermediate PostScript files between runs. MPlib made this possible directly at run time, giving rise to a distinctly ConTeXt drawing culture in which even page elements — rules, backgrounds, ornaments — are generated dynamically with MetaPost.
A minimal example
To get a feel for it, here is the smallest ConTeXt document that compiles. The body runs from \starttext to \stoptext. There is no mandatory document-class declaration as in LaTeX’s \documentclass; you set up whatever appearance you need at the top with \setup... commands.
\setuppapersize[A4]
\setupbodyfont[12pt]
\starttext
\startsection[title=はじめに]
Hello, \ConTeXt! 数式もそのまま組めます:
\startformula
E = mc^2
\stopformula
\stopsection
\stoptextHere \setuppapersize selects A4, \setupbodyfont sets a 12pt body, and \startsection opens a section titled “Introduction.” A displayed equation goes in \startformula … \stopformula. The roles match LaTeX’s \section{…} and \[ … \], but you can see the writing style follows the \start…/\stop… idiom.
LaTeX and ConTeXt side by side
For those used to LaTeX, here are some representative idioms side by side. The thinking is similar, but the vocabulary and conventions differ.
| LaTeX | ConTeXt | Goal |
|---|---|---|
\begin{document} | \starttext | Begin the body |
\section{…} | \section{…} / \startsection | A section heading |
\[ … \] | \startformula … \stopformula | A displayed equation |
geometry など | \setuppapersize and other \setup... | Paper and layout |
When to choose it
- Elaborate or automated layouts. Complex page designs, or typesetting generated in bulk from data, benefit from its consistent control.
- Presentations. It has dedicated slide modes, and MetaPost can build dynamic ornamentation.
- Publishing from XML. ConTeXt has a strong XML-processing facility and is good at workflows that read and typeset XML directly.
- Embedding drawings. With MetaPost integrated, figures and text can live in a single source.
There are caveats, though. The community is much smaller than LaTeX’s, and there are fewer third-party packages. Journal templates, tutorials, and the accumulated Q&A are more limited than for LaTeX. So in practice most academic users still pick LaTeX for papers and theses. Think of ConTeXt as a specialized option that fits its kind of work superbly.
How to get it
ConTeXt ships with the standard distribution TeX Live, and the LuaMetaTeX engine has been included since TeX Live 2023, so a normal TeX Live install gives you LMTX as well (the current TeX Live is the 2026 edition). If instead you want to track the very latest ConTeXt, the usual route is the group’s own ConTeXt Standalone (now distributed as LMTX) — a lightweight, ConTeXt-only bundle that updates frequently.