TeXExec

From ConTeXt wiki

TODO: On this page I'd like to see some texexec trickery and explanations. --pg (See: To-Do List)



NOTE: This page documents the Perl version of TeXExec, which has (relatively recently) been replaced by a ruby re-implementation

Command-Line Options

--alone bypass utilities (e.g. fmtutil for non-standard fmt)
--arrange process and arrange
--automprun MetaPost at runtime when needed
--autopdf Open the pdf viewer after the texexec run. See below.
--batch run in batch mode (don't pause)
--centerpage center the page on the paper
--color enable color (when not yet enabled)
--environment=name load some environments first. Name is: list of environments
--fast skip as much as possible
--figures=(a|b|c) typeset figure directory
room for corrections
just graphics
one (cropped) per page
--final add a final run without skipping
--format=name fmt file. name: format file (memory dump)
--help show this or more, e.g. '--help interface'
--input=name input file (if used). name: filename
--interface=(cz|de|en|it|nl|uk) user interface
--language=lang main hyphenation language. lang: standard abbreviation
--listing produce a verbatim listing
--make build format files
--mode=list running mode. list: modes to set
--module typeset tex/pl/mp module
--mpgraphic process mp file to stand-alone graphics
--mpformat=name mem file. name: format file (memory dump)
--mptex run an MetaPost plus btex-etex cycle
--mpxtex generatet an MetaPostmpx file
--noarrange process but ignore arrange
--nomp don't run MetaPost at all
--nomprun don't run MetaPost at runtime
--nonstop run in non stop mode (don't pause)
--once run TeX only once (no TeXUtil either)
--output specials to use. Can be one of
dvipdfm  
Mark Wicks' dvi to pdf converter
dvipdfmx 
Jin-Hwan Cho's extended dvipdfm
dvips  
Thomas Rokicky's dvi to ps converter
dvipsone 
YandY's dvi to ps converter
dviwindo 
YandY's windows previewer
pdftex  
Han The Than's pdf backend
--pages=(even|odd|x,y:z) pages to output. x,y:z: pages x and y to z
--paperformat=(AB|A:B|A*B) paper input and output format. a4a3: A4 printed on A3, a5a4: A5 printed on A4
--paperoffset=dim extra offset
--passon switches to pass to TeX (--src for MikTeX)
--path=string document source path. string: path
--pdf produce PDF directly using pdf(e)tex
--pdfarrange arrange pdf pages
--pdfcombine combine pages to one page
--pdfcopy scale pages down/up
--pdfselect select pdf pages
--pdfsplit split pdf file into pages
--print=(up|down) page imposition scheme. down=2 rotated pages per sheet doubleside, up=2 pages per sheet doublesided
--result=filename resulting file will have that filename
--runs=n maximum number of TeX runs. n: number of runs
--screensaver turn graphic file into a (pdf) full screen file
--setfile load environment (batch) file
--silent minimize (status) messages
--suffix=string resulting file suffix. string: suffix
--tex=name TeX binary. name: binary of executable
--texroot=path root of tex trees. path: tex root
--textree=path additional texmf tree to be used. path: subpath of tex root
--texutil force TeXUtil run
--usemodule=name load some modules first name: list of modules
--verbose shows some additional info
--version display various version information
--xmlfilter=name apply XML filter. name: list of filters

Some features explained in detail

autopdf

Currently works only on Windows and Linux. On Mac OS X there is no way to do this for Acrobat Reader 7.0 and Preview.app in a sophisticated way (= keep view), since they are not (apple-)scriptable. You can use TeXniscope, TeXshop or iTeXMac that does that automatically.

nonstopmode

Useful when running texexec from an editor and do not want it to stop for errors.

mpgraphic

texexec --mpgraphic file.mp

creates a temporary tex file, with

\setoutput[pdftex]
\setupcolors[state=start]
% Some lines for font maps
\starttext
\startTEXpage
\convertMPtoPDF{file.1}{1}{1}
\stopTEXpage
\startTEXpage
\convertMPtoPDF{file.2}{1}{1}
\stopTEXpage

% etc....

\stoptext

So, in the end you get a single pdf with each figure on different page.

Examples

Produce dvi output

By default --dvi also produces a ps file. If you just want a dvi file

 texexec --dvi test --nobackend

Select n pages from a pdf file

 texexec --pdfselect --select=1:5 blabla.pdf

Split pdf file

 texexec --pdfsplit somefile.pdf

Combine two or more PDF files into one file

 texexec --pdfcombine --nobanner --result=result.pdf 1.pdf 2.pdf

Concatenate two or more PDF files into one file

 texexec --pdfcopy --result=result.pdf 1.pdf 2.pdf

Check the status of various scripts

 texexec --check 

This should give an output like

 TeXExec | current distribution: web2c
 TeXExec | context source date: 2006.10.27 15:16
 TeXExec | format path: E:/isoimage/usr/local/context/tex/texmf-mswin/web2c/unsetengine E:/isoimage/usr/local/context/tex/texmf-mswin/web2c
 TeXExec | start of analysis
 TeXExec | processing document 'texexec'
 TeXExec | tex processing method: context
 TeXExec | writing option file texexec.top
 TeXExec | using randomseed 1306
 TeXExec | tex engine: pdftex
 TeXExec | tex format: cont-en
 TeXExec | progname: context
 This is pdfTeX, Version 3.141592-1.40.0-beta-20060213 (Web2c 7.5.5)
  \write18 enabled.
  (e:\isoimage\usr\local\context\tex\texmf-local/web2c/natural.tcx)
 entering extended mode
 (./texexec.tex
 ConTeXt  ver: 2006.10.27 15:16 MK II  fmt: 2006.10.29  int: english/english
 language        : language en is active
 system          : cont-new loaded
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-new.tex
 systems         : beware: some patches loaded from cont-new.tex
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-new.mkii))
 system          : cont-old loaded
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-old.tex
 loading         : Context Old Macros
 )
 system          : cont-fil loaded
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-fil.tex
 loading         : Context File Synonyms
 )
 system          : cont-sys loaded
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/user/cont-sys.tex)
 bodyfont        : 12pt rm is loaded
 language        : patterns nl->texnansi:texnansi->1->2:3 nl->ec:ec->2->2:3 fr->
 texnansi:texnansi->3->2:3 fr->ec:ec->4->2:3 de->texnansi:texnansi->5->2:3 de->e
 c:ec->6->2:3 it->texnansi:texnansi->7->2:3 it->ec:ec->8->2:3 pt->texnansi:texna
 nsi->9->2:3 pt->ec:ec->10->2:3 hr->ec:ec->11->2:3 pl->pl0:pl0->12->2:3 pl->ec:e
 c->13->2:3 pl->qx:qx->14->2:3 cz->il2:il2->15->2:3 cz->ec:ec->16->2:3 sk->il2:i
 l2->17->2:3 sk->ec:ec->18->2:3 sl->ec:ec->19->2:3 ru->t2a:t2a->21->2:3 en->ec:e
 c->22->2:3 uk->ec:ec->23->2:3 us->ec:ec->24->2:3 agr->agr:agr->25->2:3 da->ec:e
 c->26->2:3 sv->ec:ec->27->2:3 af->ec:ec->28->2:3 no->ec:ec->29->2:3 deo->ec:ec-
 >30->2:3 es->ec:ec->31->2:3 ca->ec:ec->32->2:3 la->ec:ec->33->2:3 ro->ec:ec->34
 ->2:3 tr->ec:ec->35->2:3 fi->ec:ec->37->2:3 hu->ec:ec->38->2:3 loaded
 specials        : tex,postscript,rokicki loaded
 system          : texexec.top loaded
 (./texexec.top
 specials        : loading definition file tpd
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/spec-tpd.tex
 specials        : loading definition file fdf
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/spec-fdf.tex
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/spec-fdf.mkii))
 specials        : fdf loaded
 )
 specials        : fdf,tpd loaded
 )
 systems         : system commands are enabled
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/sort-def.tex)
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/sort-lan.tex)
 systems         : begin file texexec at line 1
 fonts           : resetting map file list
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-empty.map}
 fonts           : using map file: texnansi-public-lm
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/texnans
 i-public-lm.map}
 fonts           : using map file: original-base
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-base.map}
 fonts           : using map file: ec-public-lm
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/ec-publ
 ic-lm.map}
 fonts           : using map file: ec-base
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/ec-base
 .map}
 fonts           : using map file: original-ams-base
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-ams-base.map}
 fonts           : using map file: original-ams-euler
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-ams-euler.map}
 fonts           : using map file: original-public-lm
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-public-lm.map}
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/pdfr-ec.tex)
 [1.1]
 systems         : end file texexec at line 3
  ){e:\isoimage\usr\local\context\tex\texmf/fonts/enc/dvips/lm/lm-ec.enc}<e:\iso
 image\usr\local\context\tex\texmf/fonts/type1/public/lm/lmr12.pfb>
 Output written on texexec.pdf (1 page, 23276 bytes).
 Transcript written on texexec.log.
 TeXExec | runtime: 0.47
 TeXExec | processing document 'texexec'
 TeXExec | tex processing method: context
 TeXExec | writing option file texexec.top
 TeXExec | using randomseed 498
 TeXExec | tex engine: pdftex
 TeXExec | tex format: cont-nl
 TeXExec | progname: context
 This is pdfTeX, Version 3.141592-1.40.0-beta-20060213 (Web2c 7.5.5)
  \write18 enabled.
  (e:\isoimage\usr\local\context\tex\texmf-local/web2c/natural.tcx)
 entering extended mode
 (./texexec.tex
 ConTeXt  ver: 2006.10.27 15:16 MK II  fmt: 2006.10.29  int: dutch/dutch
 taal            : taal nl is actief
 systeem         : cont-new geladen
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-new.tex
 systems         : beware: some patches loaded from cont-new.tex
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-new.mkii))
 systeem         : cont-old geladen
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-old.tex
 loading         : Context Old Macros
 )
 systeem         : cont-fil geladen
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/cont-fil.tex
 loading         : Context File Synonyms
 )
 systeem         : cont-sys geladen
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/user/cont-sys.tex)
 korps           : 12pt rm wordt geladen
 taal            : patronen nl->texnansi:texnansi->1->2:2 nl->ec:ec->2->2:2 fr->
 texnansi:texnansi->3->2:2 fr->ec:ec->4->2:2 de->texnansi:texnansi->5->2:2 de->e
 c:ec->6->2:2 it->texnansi:texnansi->7->2:2 it->ec:ec->8->2:2 pt->texnansi:texna
 nsi->9->2:2 pt->ec:ec->10->2:2 hr->ec:ec->11->2:2 pl->pl0:pl0->12->2:2 pl->ec:e
 c->13->2:2 pl->qx:qx->14->2:2 cz->il2:il2->15->2:2 cz->ec:ec->16->2:2 sk->il2:i
 l2->17->2:2 sk->ec:ec->18->2:2 sl->ec:ec->19->2:2 ru->t2a:t2a->21->2:2 en->ec:e
 c->22->2:2 uk->ec:ec->23->2:2 us->ec:ec->24->2:2 agr->agr:agr->25->2:2 da->ec:e
 c->26->2:2 sv->ec:ec->27->2:2 af->ec:ec->28->2:2 no->ec:ec->29->2:2 deo->ec:ec-
 >30->2:2 es->ec:ec->31->2:2 ca->ec:ec->32->2:2 la->ec:ec->33->2:2 ro->ec:ec->34
 ->2:2 tr->ec:ec->35->2:2 fi->ec:ec->37->2:2 hu->ec:ec->38->2:2 geladen
 specials        : tex,postscript,rokicki geladen
 systeem         : texexec.top geladen
 (./texexec.top
 specials        : definitiefile tpd wordt geladen
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/spec-tpd.tex
 specials        : definitiefile fdf wordt geladen
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/spec-fdf.tex
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/spec-fdf.mkii))
 specials        : fdf geladen
 )
 specials        : fdf,tpd geladen
 )
 systems         : system commands are enabled
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/sort-def.tex)
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/sort-lan.tex)
 systems         : begin file texexec at line 1
 fonts           : resetting map file list
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-empty.map}
 fonts           : using map file: texnansi-public-lm
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/texnans
 i-public-lm.map}
 fonts           : using map file: original-base
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-base.map}
 fonts           : using map file: ec-public-lm
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/ec-publ
 ic-lm.map}
 fonts           : using map file: ec-base
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/ec-base
 .map}
 fonts           : using map file: original-ams-base
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-ams-base.map}
 fonts           : using map file: original-ams-euler
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-ams-euler.map}
 fonts           : using map file: original-public-lm
 {e:\isoimage\usr\local\context\tex\texmf-local/fonts/map/pdftex/context/origina
 l-public-lm.map}
 (e:\isoimage\usr\local\context\tex\texmf-local/tex/context/base/pdfr-ec.tex)
 [1.1]
 systems         : end file texexec at line 3
  ){e:\isoimage\usr\local\context\tex\texmf/fonts/enc/dvips/lm/lm-ec.enc}<e:\iso
 image\usr\local\context\tex\texmf/fonts/type1/public/lm/lmr12.pfb>
 Output written on texexec.pdf (1 page, 23276 bytes).
 Transcript written on texexec.log.
 TeXExec | runtime: 0.441
 TeXExec | end of analysis
 TeXExec | 
 TeXExec | TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD
 TeXExec | TeXUtil   | version 9.1.0 - 1997-2005 - PRAGMA ADE/POD
 TeXExec | CtxTools | version 1.3.3 - 2004/2006 - PRAGMA ADE/POD
 TeXExec | 
 TeXExec | testing interface en
 TeXExec | pdfTeX Version 3.141592-1.40.0-beta-20060213 (Web2c 7.5.5)
 TeXExec | ConTeXt ver: 2006.10.27 15:16 MK II fmt: 2006.10.29 int: english/english
 TeXExec | 
 TeXExec | testing interface nl
 TeXExec | pdfTeX Version 3.141592-1.40.0-beta-20060213 (Web2c 7.5.5)
 TeXExec | ConTeXt ver: 2006.10.27 15:16 MK II fmt: 2006.10.29 int: dutch/dutch

TeXTools

(should be moved on a separate page, but it's stil almost empty anyway)

To update your TeX tree to the most recent version of kurier fonts for example, you can use

textools --updatetree kurier-tex e:\tex\texmf

with kurier-tex being the new content for your old TEXMF tree (if it were) located under e:\tex\texmf (change folder names accordingly). This will tell you what will be updated, merged and deleted (use --force to really do it)