Input and compilation/Modules

Unofficial ConTeXt Wiki mirror

Last modified: 2025-12-26

Modules are extensions to ConTeXt’s core functions.

There are not as many modules for ConTeXt as packages for LaTeX, because ConTeXt’s core already contains a lot that needs a package in LaTeX.

Installation

Basics

The installation of extra files in TeX (called modules in ConTeXt) can be difficult for people who are new to TeX or are not themselves interested in TeX programming.

According to the TDS (TeX directory structure) and the ConTeXt developers, user-written files reside under the path

 $TEXMF/tex/context/third/<modulename>/<files>

In the private TeX directory ($TEXMF), directories can have the names

but their existence depends on the TeX distribution; among these, texmf-local is the most common.

Installation by hand

When you want to install a new single-file module, create the subdirectories in the way described above and place the file there.

Most modules consist of several files though and are distributed as ZIP archives that contain the necessary TDS tree. These you can unzip in the top-level directory (e.g. texmf-local/), and all files should be in the correct place.

After the files are installed, you must update ConTeXt’s database to let it know where it can find the files:

 context --generate

(ConTeXt doesn’t use ls-R files or kpsewhich any more.)

Installation by script (LMTX)

Since 2023-05, there’s a script for mtxrun to list and install modules, usually from https://modules.contextgarden.net. Some modules, get special treatment: For the TikZ modules files are downloaded from CTAN and patches for incompatibilities are applied.

First, cd into the tex directory of your ConTeXt LMTX installation (above the texmf-* trees), the modules installer works only there.

 mtxrun --script install-modules --list

For the installation to work, you must change into the tex directory that contains the texmf-* trees.

 mtxrun --script install-modules --install filter simpleslides

If you list single modules to install, leave out the prefix (t-* or whatever)!

But since there aren’t many, you can just install all modules:

 mtxrun --script install-modules --install --all

Installation by script (old)

Previously, the ConTeXt LMTX distribution did not provide a built-in way to install or update modules. Here’s a method using rsync, to be run from the toplevel directory of the ConTeXt LMTX distribution, i.e. the directory that contains install.sh.

Because the final tex/texmf-modules must contain the union of all individual module directories, the commands create and leave an intermediate modules directory that wastes less than 50 MB.

 # Synchronize all modules from ConTeXt Garden in the 'modules' directory, which is created if it doesn’t exist.
 
 rsync --recursive --links --times --info=progress2,remove,symsafe,flist,del --human-readable --del rsync://contextgarden.net/minimals/current/modules/ modules
 
 # Create the union of all modules in tex/texmf-modules (the directory is created if it doesn’t exist).
 # If you have personal modules in tex/texmf-modules, they won’t be modified.
 mkdir -p tex
 rsync -rlt --exclude=/VERSION --del modules/*/ tex/texmf-modules
 # You may delete the 'modules' directory to reclaim some space or keep it to speed up the next update.
 # rm -rf modules
 
 # Update the ConTeXt file database.
 mtxrun --generate

Installation by script (MkIV)

Users of the ConTeXt MkIV standalone can use the first-setup script to install modules:

E.g. to install the simpleslides modules:

 first-setup.sh --modules="t-simpleslides"

To install more modules at the same time:

 first-setup.sh --modules="t-simpleslides,t-french"

TeX Live

TeX Live is a large TeX distribution for most common operating systems. It provides binaries and many other files necessary to run TeX and its flavors. Many ConTeXt modules are included.

Usage

When you load a module with \usemodule[modulename] ConTeXt looks for a file with the following names:

Once a file is found, ConTeXt stops the search and loads the found file (only once).

When you have two files with the same name but different prefixes, you can tell ConTeXt which file it should load with

\usemodule[<prefix>][modulename]

Included Modules

as of 2023-09-30

Macro modules

Style modules

in texmf-context/tex/context/modules/common:

in texmf-context/tex/context/modules/mkiv:

… many more …

Contributed Modules

(as of 2025-09-01)

For a list of contributed modules see the modules section on contextgarden.net:

Special Purpose Modules

The following modules implement special formatting requirement for journals or magazines. These modules are distributed with ConTeXt, so you don’t need to download anything.

Module writing guidelines

(Section moved to ConTeXt and Lua programming/Module writing)