Difference between revisions of "ConTeXt Standalone/Structure"

From Wiki
Jump to navigation Jump to search
m (Added category)
m (category sort)
Line 237: Line 237:

Revision as of 04:28, 8 October 2010

< ConTeXt Minimals

Top Level:

  • current: main files
  • experimental: experimental luatex and other binaries - doesn't work at the moment



Base TeX and metapost files, stored as


There are currently files for:

  • tex - plain TeX
  • metapost - plain metapost (including metaobj - for unknown reason - they were in Hans's distribution, sa I took them as well)
  • xetex - XeTeX: only tex-text font mapping

Hans has asked me several times why there is tex/tex/something and metapost/metapost/something (instead of one metapost less). This is because that's the only way to split TeX and Metapost while still allowing one to use (an obscure example)

rsync -av rsync://contextgarden.net'/minimals/current/base/xetex/ /minimals/current/base/metapost/' destination

leaving the plain TeX files on the server and not loosing TDS compliance. Also, once I add the documentation, there will be more than just metapost/metapost, but also metapost/doc.

One little problem: base metapost files are behind time compared to the binaries. Should anyone need newer files, feel free to complain and we will add them.


Binaries, stored as


where platform can be mswin, linux, linux-64, osx-intel, osx-ppc, sun, and engine is

  • context: stubs, mtxrun, luatools, texmfstart
  • common: most not-so-fast-changing binaries from TeX Live
  • luatex
  • metapost
  • pdftex
  • xetex


  • man: man pages
  • mswin: rsync, unzip


ConTeXt distributions, stored as


where version could be

  • current
  • beta (preferred one for testers, will default to current if not present)
  • alpha (rarely released, will default to beta if not present)
  • experimental (not to be used)
  • YYY.MM.DD (but not all of them are available)

You can fetch a specific version with


in mtx-update.lua.


Fonts will be reorganized!

Fonts, currently stored as


where type is:

  • common: to be used with both pdfTeX, LuaTeX and XeTeX (mostly math & some other fonts)
  • old: tfm, enc, map files: only for pdftex
  • new: opentype fonts: only for LuaTeX & XeTeX
  • other: pxfonts, txfonts, ... optional (not downloaded by default)


A special one. Currently has:

  • setuptex: to setup a distribution, usually needs to be put on the top of TeX trees hierarchy
  • web2c: setup files (texmf.cnf) - may change location in future


Third-party modules, stored ass


where the available modules are synced from http://modules.contextgarden.net. If you would like your module to be added, request it on the mailing list.

Example installation (on Windows)

Here’s how I (Joel Salomon) am installing ConTeXt on my machine. It works for me; your mileage may vary.

First I created a root directory for the installation; I install “personal” programs under %USERPROFILE%\Programs, so I create the directory USERPROFILE%\Programs\ConTeXt. If you’re working from the command-line, you might want to set an environment variable for this, e.g.,


—just be aware that if you’re setting the variables below in the Windows dialog box, you’ll have to expand all uses of %CONTEXTROOT% yourself. (A ‘portable apps’ version of ConTeXt would set those variables in the launcher/wrapper.) I’m going to phrase the rest of this section in terms of the command-line.

This effort is closely related to [GUI installer]; I hope this makes explicit all the installer does.

Note that my system has Ruby installed; I don’t yet understand how to include a minimal Ruby.

Create the directories

Following the arrangement from mswincontext.zip and the ConTeXt Minimals’s download script, generate the following TDS trees, and add the binaries’ installation directory to the system path:


mkdir texmf texmf-context texmf-extra texmf-fonts texmf-local texmf-mswin texmf-mswin\bin texmf-project texmf-var %TEMP%\texmf-cache

set PATH=%PATH%;%CONTEXTROOT%\texmf-mswin\bin;

set OSFONTDIR=%SystemRoot%\Fonts

set TEXMFCACHE=%TEMP%\texmf-cache
set TEXMFOS=%CONTEXTROOT%\texmf-mswin

TODO: Some of these might not be needed; will someone who knows which please edit this list? (See: To-Do List)

Also, tell the programs what directories have TDS trees, and where to look for configuration settings:

set TEXMFCNF=%CONTEXTROOT%\texmf{-local,-context,}\web2c

(As stated above, you may need to expand these, e.g., replace %TEXMFMAIN% with %USERPROFILE%\Programs\ConTeXt\texmf.


I’ve broken the rsync commands into multiple lines for readability, but you need everything on one line, space-separated. Note also that each TDS tree has its own rsync call; that lets me add the --delete option safely.

Begin the download

I need rsync, so I download it to the binaries directory, which I’ve already put on the path. Note that rsync runs under the Cygwin subsystem, so I need to set an environment variable telling it to play nicely with Windows’s ideas of file ownership. This variable doesn’t need to be permanently set (and if you run Cygwin, it probably shouldn’t be); set it temporarily before you run rsync. My system has wget installed so I’ll use that, but any method of downloading should work fine.

set CYGWIN=nontsec

wget -P texmf-mswin\bin http://minimals.contextgarden.net/setup/mswin/bin/rsync.exe
wget -P texmf-mswin\bin http://minimals.contextgarden.net/setup/mswin/bin/cygwin1.dll

If I were using mtx-update to manage the install, I’d run

rsync -rpztlv --exclude 'rsync.exe' --exclude 'cygwin1.dll' rsync://contextgarden.net/minimals/setup/mswin/bin/ texmf-mswin/bin
texlua texmf-mswin\bin\mtxrun.lua --verbose --script texmf-mswin\bin\mtx-update.lua --update --force --engine=all --texroot=%CONTEXTROOT%

but I’m going to try to exercise much finer control than mtx-update allows for. I did adapt the output of an mtx-update run (without --force) to generate the rsync calls below.


Download the base TeX files, as mentioned above. I moved web2c here from the miscellanea section, so the tree is updated in a single run. Note that the web2c directory does not have a trailing ‘/’. That’s because it goes into a TDS tree, rather than containing (part of) one; omitting the ‘/’ gives us the directory …/texmf/web2c.

rsync -rpztlv --stats contextgarden.net::'minimals/current/base/tex/
                                          minimals/current/misc/web2c' texmf


Download binaries for all engines, plus the specials, for the mswin platform. For a “legacy-free” installation, omitting the line with PDFTeX should work—but I haven’t tested it.

rsync -rpztlv --stats contextgarden.net::'minimals/current/bin/context/mswin/
                                          minimals/current/bin/man/' texmf-mswin

(Perhaps the man tree should be placed elsewhere; texmf, or maybe texmf-extra?)


The more adventurous can replace current with alpha, beta, experimental, or latest.

rsync -rpztlv --stats contextgarden.net::'minimals/current/context/current/
                                          minimals/current/context/config/' texmf-context


Directory other is optional; old can perhaps be omitted for a “legacy-free” (i.e., PDFTeX-free) setup.

rsync -rpztlv --stats contextgarden.net::'minimals/current/fonts/new/
                                          minimals/current/fonts/old/' texmf-fonts


On the initial run, you may want to download the setuptex.* files; I adapted the list of directory trees from there.

rsync -rpztlv --stats contextgarden.net::minimals/current/misc/setuptex/ .


My guess is that texmf-extra is a good place to put the various modules mentioned above—at which point the installation can no longer be called “minimal”. The invocation would look something like this:

rsync -rpztlv --stats contextgarden.net::'minimals/current/modules/f-urwgaramond/
                                          minimals/current/modules/…/' texmf-extra

Include whatever modules you’d like.


I have no idea what goes into texmf-project, nor where it comes from; I’m including this directory only because the installation scripts refer to it.

Building the formats

The commands below were excerpted from a run of texlua texmf-mswin\bin\mtxrun.lua --verbose --script texmf-mswin\bin\mtx-update.lua --make --engine=all --texroot=%CONTEXTROOT%.


PDFTeX and XeTeX use Kpathsea and its ls-r databases to find files. Also, I let texexechandle the generating of formats. I don’t know what the --all option does; I want a minimal (necessary and sufficient) set of formats, which I think this is:

texexec --make --all --pdftex metafun cont-en
texexec --make --all --xetex metafun cont-en


LuaTeX has its own databases, and its own way of generating formats:

luatools --generate
luatools --ini --compile cont-en


I haven’t tried this yet, but repeating the rsync calls for the Base, Binaries, ConTeXt, Fonts, and Extras trees, perhaps including the --delete option, followed by rebuilding the databases & formats, should work.