hamwaves.com
;

Installing & Updating ConTeXt Standalone

Serge Y. Stroobandt

Copyright 2014–2015, licensed under Creative Commons BY-NC-SA

Introduction

The text below is a compilation of heavily edited excerpts from the pages entitled “ConTeXt Standalone” and “Ubuntu,” over at the contextgarden.net wiki. Both pages are licensed under the GNU Free Document License. Only information relevant to the system-wide GNU/Linux installation has been copied here. I have also added a bit of my own sed spice to enhance its digestion…

System-wide installation

A system wide installation is one which is located in /opt/context. At present, in order to use ConTeXt MkIV, write permissions are required1 in the installation directory.2

$ sudo mkdir /opt/context
$ sudo chown $USER /opt/context
$ cd /opt/context
$ wget http://minimals.contextgarden.net/setup/first-setup.sh
$ sh ./first-setup.sh --modules=all
$ ./tex/setuptex

The last step installs ConTeXt MkIV beta, including all modules and other third party content. This may take a considerable amount of time to complete.

Compared to LaTeX 2ε, ConTeXt MkIV is relatively new and still in active development. However, as a development version, ConTeXt MkIV beta is very stable and should not be feared for everyday use. It is not as “bleeding edge” as the nightly build of Context MkIV, available as a PPA elsewhere. If instead the stable version of ConTeXt MkIV is preferred, use:

$ sh ./first-setup.sh --modules=all --context=current

Cache

To create the required cache directory:

$ sudo mkdir /var/cache/context
$ sudo mkdir /var/cache/context/texmf-cache
$ sudo chmod 777 /var/cache/context/texmf-cache
$ sed -i 's|TEXMFCACHE\(.*\)".*"|TEXMFCACHE\1"/var/cache/context/texmf-cache"|' /opt/context/tex/texmf/web2c/texmfcnf.lua

The last line changes the value of TEXMFCACHE to "/var/cache/context/texmf-cache".

bashrc

$ nano ~/.bashrc

Add these four lines to ~/.bashrc:

# ConTeXt
export OSFONTDIR=/usr/share/fonts/:$HOME/.fonts
export TEXROOT=/opt/context/tex
PATH="/opt/context/tex/texmf-linux-64/bin:/opt/context/bin:$PATH"

On 32-bit systems, just drop the -64 from the last line. Note that the order of items in PATH is significant. Putting /usr/local/context/bin first, would produce an error at run time. Finally, in order to have the changes take effect in your current shell, issue:

$ source ~/.bashrc

Version checking

$ context --version

mtx-context     | ConTeXt Process Management 0.60
mtx-context     |
mtx-context     | main context file: /opt/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context     | current version: 2014.02.01 14:22

Updating

Updating ConTeXt to the latest version is really easy.
For convenience, a bash script called update-context is created:

$ mkdir ~/sbin
$ nano ~/sbin/update-context
# !/bin/bash
cd /opt/context
wget http://minimals.contextgarden.net/setup/first-setup.sh
./first-setup.sh --modules=all
$ chmod 700 ~/sbin/update-context

From now on, just call sbin/update-context to put ConTeXt up to date.

$ ~/sbin/update-context

  1. Actually, only write permission for $TEXMFCACHE is required.

  2. This effectively means that only one user will be able to generate the formats at installation.

5
Creative Commons Licence
This work is licensed under a Creative Commons Attribution‑NonCommercial‑ShareAlike 4.0 International License.
Other licensing available on request.
GNU GPL v3
Unless otherwise stated, all originally authored software on this site is licensed under the terms of GNU GPL version 3.
cookie
This static web site has no backend database.
Hence, no personal data is collected and GDPR compliance is met.
Moreover, this domain does not set any first party cookies.

All Google ads shown on this web site are, irrespective of your location,
restricted in data processing to meet compliance with the CCPA and GDPR.
However, Google AdSense may set third party cookies for traffic analysis and
use JavaScript to obtain a unique set of browser data.
Your browser can be configured to block third party cookies.
Furthermore, installing an ad blocker like EFF's Privacy Badger
will block the JavaScript of ads.
Google's ad policies can be found here.
This page employs a Python Bottle server‑side script.
This page includes an open-source client-side script, written in Python and
transcoded by Brython to make it run as secure JavaScript in the browser.
Static XHTML generated from Markdown by Pandoc and
the GNU/Linux make, sed and gpp commands.
LaTeXmath markup rendered with MathJax.
BibTeX references are best read with JabRef.
Unattended CSS typesetting with Prince.
This work is published at https://hamwaves.com/context.standalone/en/.
profile for Serge Stroobandt on Stack Exchange, a network of free, community-driven Q&A sites
GnuPG
Use my OpenPGP public key to encrypt messages for:

echo c2VyZ2VAc3Ryb29iYW5kdC5jb20K |base64 -d
Last update: Wednesday, September 1, 2021.