Mtxrun

From Wiki
Revision as of 09:45, 3 October 2012 by Esteis (talk | contribs) (Add documentation of various scripts)
Jump to navigation Jump to search

mtxrun is a helper script for ConTeXt and its tree. There are goodies stored in sub-scripts in tex/texmf-context/scripts/context/lua in your ConTeXt directory. You can use e.g. mtx-interface.lua like so:

mtxrun --script interface ...

Try, especially,

mtxrun --script interface --help

to see the list of that script's options.

See Also

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:

mtxrun --script color --table somename

context

ConTeXt Process Management 0.60

--run                 process (one or more) files (default action)
--make                create context formats

--ctx=name            use ctx file (process management specification)
--interface           use specified user interface (default: en)

--autopdf             close pdf file in viewer and start pdf viewer afterwards
--purge(all)          purge files either or not after a run (--pattern=...)

--usemodule=list      load the given module or style, normally part o fthe distribution
--environment=list    load the given environment file first (document styles)
--mode=list           enable given the modes (conditional processing in styles)
--path=list           also consult the given paths when files are looked for
--arguments=list      set variables that can be consulted during a run (key/value pairs)
--randomseed=number   set the randomseed
--result=name         rename the resulting output to the given name
--trackers=list       set tracker variables (show list with --showtrackers)
--directives=list     set directive variables (show list with --showdirectives)
--silent=list         disable logcatgories (show list with --showlogcategories)
--noconsole           disable logging to the console (logfile only)
--purgeresult         purge result file before run

--forcexml            force xml stub
--forcecld            force cld (context lua document) stub

--arrange             run extra imposition pass, given that the style sets up imposition
--noarrange           ignore imposition specifications in the style

--once                only run once (no multipass data file is produced)
--batchmode           run without stopping and don't show messages on the console
--nonstopmode         run without stopping

--generate            generate file database etc. (as luatools does)
--paranoid            don't descend to .. and ../..
--version             report installed context version

--global              assume given file present elsewhere
--nofile              use dummy file as jobname

--expert              expert options

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 --name         list installed fonts, filter by name [--pattern]
--list --spec         list installed fonts, filter by spec [--filter]
--list --file         list installed fonts, filter by file [--pattern]

--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