Open main menu


mtxrun is a helper script for all sorts of ConTeXt-related things, from individual runs to managing the installation tree. It is located at bin/mtxrun in the ConTeXt directory; that file is actually a merge of the scripts stored in tex/texmf-context/scripts/context/lua.

One can explicitly invoke the function of one of the scripts, e.g. mtx-script.lua, like so.

mtxrun --script script ...

Try, especially,

mtxrun --script script --help

to see the list of that script's options.

See Also

Table of Contents

Script Description
babel Babel Input To UTF Conversion 1.20
base ConTeXt TDS Management Tool 1.35 (aka luatools)
cache ConTeXt & MetaTeX Cache Management 0.10
chars MkII Character Table Generators 0.10
check Basic ConTeXt Syntax Checking 0.10
colors ConTeXt Color Management 0.10
context ConTeXt Process Management 0.60
convert ConTeXT Graphic Conversion Helpers 0.10
epub ConTeXt EPUB Helpers 0.12
fcd Fast Directory Change
flac ConTeXt Flac Helpers 0.10
fonts ConTeXt Font Database Management 0.21
grep Simple Grepper 0.10

Patterns are lua patterns and need to be escaped accordingly.

interface ConTeXt Interface Related Goodies 0.13
metapost MetaPost to PDF processor 0.10
modules ConTeXt Module Documentation Generators 1.00
package Distribution Related Goodies 0.10
patterns ConTeXt Pattern File Management 0.20
pdf ConTeXt PDF Helpers 0.10
profile ConTeXt MkIV LuaTeX Profiler 1.00
rsync Rsync Helpers 0.10
scite Scite Helper Script 1.00
server-ctx-fonttest
server-ctx-help
server-ctx-startup
server Simple Webserver For Helpers 0.10
texworks TeXworks Startup Script 1.00
timing
tools Some File Related Goodies 1.01
unzip Simple Unzipper 0.10
update ConTeXt Minimals Updater 0.30
watch ConTeXt Request Watchdog 1.00

babel

Babel Input To UTF Conversion 1.20

--language=string     conversion language (e.g. greek)
--structure=string    obey given structure (e.g. 'document', default: 'context')
--convert             convert babel codes into utf

base

ConTeXt TDS Management Tool 1.35 (aka luatools)

--generate        generate file database
--variables       show configuration variables
--configurations  show configuration order
--expand-braces   expand complex variable
--expand-path     expand variable (resolve paths)
--expand-var      expand variable (resolve references)
--show-path       show path expansion of ...
--var-value       report value of variable
--find-file       report file location
--find-path       report path of file
--make or --ini   make luatex format
--run or --fmt=   run luatex format
--compile         assemble and compile lua inifile
--verbose         give a bit more info
--all             show all found files
--format=str      filter cf format specification (default 'tex', use 'any' for any match)
--pattern=str     filter variables
--trackers=list   enable given trackers

cache

ConTeXt & MetaTeX Cache Management 0.10

--purge               remove not used files
--erase               completely remove cache
--list                show cache

--all                 all (not yet implemented)

chars

MkII Character Table Generators 0.10

--xtx                 generate xetx-*.tex (used by xetex)
--pdf                 generate pdfr-def.tex (used by pdftex)
--entities            generate entities table

check

Basic ConTeXt Syntax Checking 0.10

--convert             check tex file for errors

colors

ConTeXt Color Management 0.10

--table               show icc table

Example to list all color profiles:

mtxrun --script color --table

context

See the separate article on the context script.

convert

ConTeXT Graphic Conversion Helpers 0.10

--convertall          convert all graphics on path
--inputpath=string    original graphics path
--outputpath=string   converted graphics path
--watch               watch folders
--force               force conversion (even if older)
--delay               time between sweeps

epub

ConTeXt EPUB Helpers 0.12

--make                create epub zip file

Example:

mtxrun --script epub --make mydocument

fcd

Fast Directory Change

--clear                      clear the cache
--clear --history [entry]    clear the history
--scan                       clear the cache and add given path(s)
--add                        add given path(s)
--find                       file given path (can be substring)
--find --nohistory           file given path (can be substring) but don't use history
--stub                       print platform stub file
--list                       show roots of cached dirs
--list --history             show history of chosen dirs
--help                       show this help

Usage:

fcd --scan t:\
fcd --add f:\project
fcd [--find] whatever
fcd --list

flac

ConTeXt Flac Helpers 0.10

--collect             collect albums in xml file

Example:

mtxrun --script flac --collect somename.flac
mtxrun --script flac --collect --pattern="m:/music/**")

fonts

ConTeXt Font Database Management 0.21

--save                save open type font in raw table
--unpack              save a tma file in a more readale format

--reload              generate new font database
--reload --simple     generate 'luatex-fonts-names.lua' (not for context!)
--list --all                       list all installed fonts 
--list --all --name --pattern=...  list installed fonts, filter by name (pattern), all matches
--list --all --file --pattern=...  list installed fonts, filter by file (pattern), all matches
--list --all --spec --filter=...   list installed fonts, filter by spec (key=value pairs, all matches

--pattern=str         filter files using pattern
--filter=list         key-value pairs
--all                 show all found instances
--info                give more details
--track=list          enable trackers
--statistics          some info about the database

Examples of searches:

mtxrun --script font --list somename (== --pattern=*somename*)

mtxrun --script font --list --name somename
mtxrun --script font --list --name --pattern=*somename*

mtxrun --script font --list --spec somename
mtxrun --script font --list --spec somename-bold-italic
mtxrun --script font --list --spec --pattern=*somename*
mtxrun --script font --list --spec --filter="fontname=somename"
mtxrun --script font --list --spec --filter="familyname=somename,weight=bold,style=italic,width=condensed"
mtxrun --script font --list --spec --filter="familyname=crap*,weight=bold,style=italic"

mtxrun --script font --list --file somename
mtxrun --script font --list --file --pattern=*somename*

grep

Simple Grepper 0.10

--pattern             search for pattern (optional)
--count               count matches only
--nocomment           skip lines that start with %% or #
--xml                 pattern is lpath expression

Patterns are lua patterns and need to be escaped accordingly

interface

ConTeXt Interface Related Goodies 0.13

--interfaces          generate context interface files
--messages            generate context message files
--labels              generate context label files

--context             equals --interfaces --messages --languages

--scite               generate scite interface
--bbedit              generate bbedit interface files
--jedit               generate jedit interface files
--textpad             generate textpad interface files
--text                create text files for commands and environments
--raw                 report commands to the console
--check               generate check file

--toutf               replace named characters by utf
--preprocess          preprocess mkvi files to tex files [force,suffix]

--suffix              use given suffix for output files
--force               force action even when in doubt

metapost

MetaPost to PDF processor 0.10

--rawmp               raw metapost run
--metafun             use metafun instead of plain
--latex               force --tex=latex
--texexec             force texexec usage (mkii)
--split               split single result file into pages

Intended usage:

mtxrun --script metapost yourfile.mp
mtxrun --script metapost --split yourfile.mp

modules

ConTeXt Module Documentation Generators 1.00

--convert             convert source files (tex, mkii, mkiv, mp) to 'ted' files

package

Distribution Related Goodies 0.10

--merge               merge 'loadmodule' into merge file

patterns

ConTeXt Pattern File Management 0.20

--convert             generate context language files (mnemonic driven, if not given then all)
--check               check pattern file (or those used by context when no file given)
--path                source path where hyph-foo.tex files are stored
--destination         destination path

Examples of usage:

mtxrun --script pattern --check hyph-*.tex
mtxrun --script pattern --check   --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns
mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/tex --destination=e:/tmp/patterns
mtxrun --script pattern --convert --path=c:/data/develop/svn-hyphen/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/txt --destination=e:/tmp/patterns

pdf

ConTeXt PDF Helpers 0.10

--info                show some info about the given file
--metadata            show metadata xml blob
--fonts               show used fonts (--detail)

profile

ConTeXt MkIV LuaTeX Profiler 1.00

--analyze             analyze lua calls
--trace               analyze tex calls

rsync

Rsync Helpers 0.10

--job                 use given file as specification
--dryrun              show what would happen
--force               force run

scite

Scite Helper Script 1.00

--words             convert spell-*.txt into spell-*.lua

server-ctx-fonttest

...text/tex/texmf-context/tex/context/base/font-ott.lua:19: attempt to index local 'fonts' (a nil value)

server-ctx-help

server-ctx-startup

server

Simple Webserver For Helpers 0.10

--start               start server
--port                port to listen to
--root                server root
--scripts             scripts sub path
--index               index file
--auto                start on own path

texworks

TeXworks Startup Script 1.00

--start [--verbose]   start texworks
--test                report what will happen

timing

mtx-timing.lua:76: attempt to index field 'progress' (a nil value)

tools

Some File Related Goodies 1.01

--disarmutfbomb       remove utf bomb if present
    --force             remove indeed

--dirtoxml              glob directory into xml
    --pattern           glob pattern (default: *)
    --url               url attribute (no processing)
    --root              the root of the globbed path (default: .)
    --output            output filename (console by default)
    --recurse           recurse into subdirecories
    --stripname         take pathpart of given pattern
    --longname          set name attributes to full path name

--downcase
    --pattern           glob pattern (default: *)
    --recurse           recurse into subdirecories
    --force             downcase indeed

unzip

Simple Unzipper 0.10

--list                list files in archive
--junk                flatten unzipped directory structure
--extract             extract files

update

ConTeXt Minimals Updater 0.30

--platform=string     platform (windows, linux, linux-64, osx-intel, osx-ppc, linux-ppc)
--server=string       repository url (rsync://contextgarden.net)
--module=string       repository url (minimals)
--repository=string   specify version (current, experimental)
--context=string      specify version (current, latest, beta, yyyy.mm.dd)
--rsync=string        rsync binary (rsync)
--texroot=string      installation directory (not guessed for the moment)
--engine=string       tex engine (luatex, pdftex, xetex)
--modules=string      extra modules (can be list or 'all')
--fonts=string        additional fonts (can be list or 'all')
--goodies=string      extra binaries (like scite and texworks)
--force               instead of a dryrun, do the real thing
--update              update minimal tree
--make                also make formats and generate file databases
--keep                don't delete unused or obsolete files
--state               update tree using saved state

watch

ConTeXt Request Watchdog 1.00

--logpath             optional path for log files
--watch               watch given path [--delay]
--pipe                use pipe instead of execute
--delay               delay between sweeps
--automachine         replace /machine/ in path /<servername>/
--collect             condense log files
--cleanup=delay       remove files in given path [--force]
--showlog             show log data