ConTeXt

# ConTeXt

Discussion

Encyclopedia
ConTeXt is a general-purpose document processor
Document processor
A document processor is a document preparation system that superficially resembles a word processor. However, the emphasis in a document processor is on the arrangement of the document's components, not the formatting of the characters that compose it...

. It is especially suited for structured documents, automated document production, very fine typography, and multi-lingual typesetting. It is based in part on the TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as ....

typesetting
Typesetting
Typesetting is the composition of text by means of types.Typesetting requires the prior process of designing a font and storing it in some manner...

system, and uses a document markup language for manuscript preparation. The typographical and automated capabilities of ConTeXt are extensive, including interfaces for handling microtypography
Microtypography
Microtypography is the name given to a range of methods for improving the readability and appearance of text, especially justified text. The methods reduce the appearance of large interword spaces and create edges to the text that appear more even.- Methods :...

, multiple footnotes and footnote classes, and manipulating OpenType
OpenType
OpenType is a format for scalable computer fonts. It was built on its predecessor TrueType, retaining TrueType's basic structure and adding many intricate data structures for prescribing typographic behavior...

fonts and features. Moreover, it 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.

ConTeXt may be compared and contrasted with LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as . The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to...

, but the primary thrust of the two are rather distinct. ConTeXt from the ground up is a typography and typesetting system meant to provide users easy and consistent access to advanced typographical control—important for general-purpose typesetting tasks. The original vision of LaTeX is to insulate the user from typographical decisions—a useful approach for submitting, say, articles for a scientific journal. LaTeX has evolved from that original vision; at the same time, ConTeXt’s unified design avoids the package clashes that can happen with LaTeX.

ConTeXt provides a multi-lingual user interface with support for markup in English, Dutch, German, French, and Italian and support for output in many languages including western European, eastern European, Arabic-script, Chinese, Japanese, and Korean. It also allows the user to use different TeX engines like pdfTeX
PdfTeX
The computer program pdfTeX is an extension of Knuth's typesetting program TeX, and was originally written and developed into a publicly usable product by Hàn Thế Thành as a part of the work for his PhD thesis at the Faculty of Informatics, Masaryk University, Brno...

, XeTeX
XeTeX
XeTeX is a TeX typesetting engine using Unicode and supporting modern font technologies such as OpenType or Apple Advanced Typography...

, and LuaTeX
LuaTeX
LuaTeX is a TeX based computer typesetting system which started as a version of pdfTeX with a Lua scripting engine embedded. After some experiments it was adopted by the pdfTeX team as a successor to pdfTeX . Later in the project some functionality of Aleph was included...

without changing the user interface.

As its native drawing engine, ConTeXt integrates a superset of MetaPost
MetaPost
MetaPost refers to both a programming language and the interpreter of the MetaPost programming language. Both are derived from Donald Knuth's Metafont language and interpreter. MetaPost excels at producing diagrams in the PostScript programming language from a geometric/algebraic description...

called MetaFun which allows the users to use the drawing abilities of MetaPost for page backgrounds and ornaments. Metafun can also be used with stand alone MetaPost. ConTeXt also supports the use of other external drawing engines, like PGF/TikZ
PGF/TikZ
PGF/TikZ is a tandem of languages for producing vector graphics from a geometric/algebraic description. PGF is a lower-level language, while TikZ is a set of higher-level macros that use PGF. The top-level PGF and TikZ commands are invoked as TeX macros, but in contrast with PSTricks, the PGF/TikZ...

and PSTricks.

ConTeXt also provides a macro package for typesetting chemical structure
Chemical structure
A chemical structure includes molecular geometry, electronic structure and crystal structure of molecules. Molecular geometry refers to the spatial arrangement of atoms in a molecule and the chemical bonds that hold the atoms together. Molecular geometry can range from the very simple, such as...

diagrams with TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as ....

called PPCHTeX, as well as many other modules. This package can also be used with plain TeX and LaTeX.

ConTeXt was developed from 1990 by Hans Hagen from PRAGMA Advanced Document Engineering (Pragma ADE), a Netherlands-based company.

ConTeXt is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

: the program code (i.e. anything not under the /doc subtree) is distributed under the GNU GPL; the documentation is provided under Creative Commons
Creative Commons
Creative Commons is a non-profit organization headquartered in Mountain View, California, United States devoted to expanding the range of creative works available for others to build upon legally and to share. The organization has released several copyright-licenses known as Creative Commons...

The ConTeXt official manual (2001) and ConTeXt official mini tutorial (1999) are documents copyrighted by Pragma, but there is a repository of the future new manual released under the GNU Free Documentation License. As of April 2009 there is an uptodate version of the Fonts and Typography chapters.

## Versions

Mark IV (abbreviated MKIV) is the current version of ConTeXt. It's a development version and new features are being added constantly, although it is fully usable. There is also a frozen version called Mark II (abbreviated MKII) which is still maintained. The main difference between MKII and MKIV is that MKIV is based on the LuaTeX
LuaTeX
LuaTeX is a TeX based computer typesetting system which started as a version of pdfTeX with a Lua scripting engine embedded. After some experiments it was adopted by the pdfTeX team as a successor to pdfTeX . Later in the project some functionality of Aleph was included...

engine and MKII is based on pdfTeX and XeTeX (although one could select the TeX engine used in ConTeXt). There are some documents describing the necessity of this change, how the process is being carried out, and its benefits. There are other minor differences between MKII and MKIV.

Apart from the new features of MKIV, the changes between the code of MKII and MKIV are not visible in the user interface (in syntax document level). Both MKIV and MKII were released at the same time

The oldest version of ConTeXt is Mark I, in which all the low-level code is written in Dutch. It is unmaintained.

## 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. The first users outside Pragma were Taco Hoekwater, Berend de Boer and Gilbert van den Dobbelsteen, and the first user outside the Netherlands was Tobias Burnus.

In July 2004, 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, and 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 in launchpad web site.

In June 2008, Patrick Gundlach wrote the first post in ConTeXt blog.

In July 2009, ConTeXt started git repository.

## Example of code

Making ConTeXt documents is simple: one makes a plain text file (typically with .tex extension), and compiles it with the texexec script. The result of this process is a PDF
Portable Document Format
Portable Document Format is an open standard for document exchange. This file format, created by Adobe Systems in 1993, is used for representing documents in a manner independent of application software, hardware, and operating systems....

file (ConTeXt also can generate a DVI
DVI (file format)
The Device independent file format is the output file format of the TeX typesetting program, designed by David R. Fuchs in 1979. Unlike the TeX markup files used to generate them, DVI files are not intended to be human-readable; they consist of binary data describing the visual layout of a...

file). An example is shown below.
 source lang="latex"> % This line is a comment because % precedes it. % It specifies the format of head named 'title' % Specifically the style of the font: sans serif % + bold + big font. \setuphead[title][style={\ss\bfd}, before={\begingroup}, after={John Doe, the author\smallskip\currentdate\bigskip\endgroup}] \starttext \title{\CONTEXT} \section{Text} \CONTEXT\ is a document preparation system for the \TEX\ typesetting program. It offers programmable desktop publishing features and extensive facilities for automating most aspects of typesetting and desktop publishing, including numbering and cross-referencing (for example to equation \in[eqn:famous-emc]), tables and figures, page layout, bibliographies, and much more. It was originally written around 1990 by Hans Hagen. It could be an alternative or complement to \LATEX. \section{Maths} With \CONTEXT\ we could write maths. Equations can be automatically numbered. \placeformula[eqn:famous-emc] \startformula E = mc^2 \stopformula with \placeformula[eqn:def-m] \startformula m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}} \stopformula \stoptext