ArticleslgStudy

computer science

ConTeXt

ConTeXt is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand ConTeXt rather than just read about it. In short: ConTeXt, stylised as ConTeXt, is a general-purpose document processor. Like LaTeX, it is derived from the TeX typesetting system.

ConTeXt — main illustration
ConTeXt — illustration

Key takeaways

  • ConTeXt belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect ConTeXt to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of ConTeXt from memory before moving on to harder problems.

Reference excerpt

ConTeXt, stylised as ConTeXt, is a general-purpose document processor. Like LaTeX, it is derived from the TeX typesetting system. ConTeXt is especially suited for structured documents, automated document production, very fine typography, and multilingual typesetting. It is based in part on TeX, and uses a document markup language for manuscript preparation. The typographical and automated capabilities of ConTeXt are extensive, including interfaces for handling microtypography, multiple footnotes and footnote classes, and manipulating OpenType fonts and features. Moreover, ConTeXt offers extensive support for colors, backgrounds, hyperlinks, presentations, figure-text integration, and conditional compilation. It gives the user extensive control over formatting, while making it easy to create new layouts and styles without learning the low-level TeX macro language. While comparisons can be made between ConTeXt and LaTeX, the primary objectives of the two systems are distinct. From the outset, ConTeXt has been a typography and typesetting system designed to give users straightforward and consistent access to advanced typographical control, which is crucial for general-purpose typesetting. LaTeX's original vision, on the other hand, was to insulate the user from typographical decisions—an approach particularly useful for tasks such as submitting articles to a scientific journal. Although LaTeX has evolved from this original vision, ConTeXt's unified design prevents the package clashes which are often experienced with LaTeX. ConTeXt provides a multilingual user interface with support for markup in English, Dutch, German, French, and Italian, and support for output in many scripts including western European, eastern European, Arabic, Chinese, Japanese, and Korean. It also allows the user to use different TeX engines, like LuaTeX (MkIV) and LuaMetaTeX (LMTX). Older versions (MkII) worked with pdfTeX or XeTeX. As its native drawing engine, ConTeXt integrates a superset of MetaPost called MetaFun, which allows users to draw page backgrounds and ornaments with MetaPost. MetaFun can also be used directly with MetaPost. ConTeXt also supports the use of other external drawing engines, like PGF/TikZ and PSTricks. ConTeXt also provides a macro package for typesetting chemical structure diagrams with TeX, called PPCHTeX, as well as many other modules. This package can also be used with plain TeX and LaTeX. Originally titled pragmatex, ConTeXt was given its name around 1996 by Hans Hagen from PRAGMA Advanced Document Engineering (Pragma ADE), a Netherlands-based company.

License ConTeXt is free software; the program code (i.e. anything not under the /doc subtree) is distributed under the GNU GPL, and the documentation is provided under Creative Commons Attribution NonCommercial ShareAlike license. The ConTeXt official manual(2001) and ConTeXt official mini tutorial (1999) are documents copyrighted by Pragma, but there is a repository for the future manual released under the GNU Free Documentation License. As of April 2009, there is an up-to-date version of the fonts and typography chapters.

Versions The current version of ConTeXt is LMTX, introduced in April 2019 as the successor to Mark IV (MkIV). Previous versions—Mark II (MkII) and Mark I—are no longer maintained. According to the developers, the principal difference between LMTX and its predecessors is that the newest version "uses a compilation and scripting engine that is specifically developed with ConTeXt in mind: LuaMetaTeX ... [which] has been optimised heavily for ConTeXt use." Previously, MkIV used LuaTeX and MkII used pdfTeX.

History ConTeXt was created by Hans Hagen and Ton Otten of Pragma ADE in the Netherlands, around 1991, due to the need for educational typesetting material. Around 1996, Hans Hagen coined the name ConTeXt, meaning "text with tex" (con-tex-t; "con" is a Latin preposition meaning "together with"). Before 1996, ConTeXt was used only within Pragma ADE, but in 1996 it began to be adopted by a wider audience. In July 2004, the contextgarden.net wiki page was created. ConTeXt low-level code was originally written in Dutch. Around 2005, the ConTeXt developers began translating this to English, resulting in the version known as MKII, which is now stable and frozen. In August 2007, Hans Hagen presented the MKIV version; the first public beta was released later that year. During the ConTeXt User Meeting 2008, Mojca Miklavec presented ConTeXt Minimals, a distribution of ConTeXt containing the latest binaries and intended to have a small memory footprint, thus demanding less bandwidth for updates. In August 2008, this distribution was registered as a project on the Canonical Launchpad website. In June 2008, Patrick Gundlach wrote the first post in ConTeXt blog. In July 2009, ConTeXt started a git repository. In November 2010, the ConTeXt Group was created. In April 2019, LMTX (ConTeXt LuaMetaTeX) was announced.

Example of code Making ConTeXt documents is simple: make a plain text file, and compile it with the context script. The result of this process is a PDF file (ConTeXt also can generate a DVI file). An example is shown below. ConTeXt documents come with the file extension .tex, or an extension demarking the version required: .mkii, .mkiv, or .mkxl for regular TeX, .mkvi or .mklx for a dialect that supports named macro parameters in addition to TeX’s numeric ones.

See also

Comparison of TeX editors List of TeX extensions LaTeX TeX

References

Illustrations

ConTeXt illustration
ConTeXt: ConTeXt document
ConTeXt document

Worked examples

Example 1 — a first encounter with ConTeXt

Start with the simplest possible case. Write down what ConTeXt claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to ConTeXt before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about ConTeXt ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of ConTeXt

In research
ConTeXt appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses ConTeXt in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
ConTeXt is common in secondary-school and first-year university syllabi. It links to neighbouring topics Free TeX software, Page description languages, so understanding it makes those chapters shorter.
In everyday life
Look for ConTeXt outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “ConTeXt” →

How to study ConTeXt in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what ConTeXt means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain ConTeXt out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is ConTeXt in simple terms?

ConTeXt, stylised as ConTeXt, is a general-purpose document processor. Like LaTeX, it is derived from the TeX typesetting system.

Why does ConTeXt matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study ConTeXt?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on ConTeXt.

Tags

  • Free TeX software
  • Page description languages

Keep exploring