texexec is a Perl script that provides several functions:
Process a TeX file. This includes performing as many runs as necessary of tex(1), texutil(1), and metapost(1)?. Options allow you to select the output format, the pages to process, paper size, and so forth.
Create new !ConTeXt? formats (with --format).
Run METAPOST (mpost(1)) to generate figures from METAPOST source.
Avoid calling other programs when possible. For example, --alone will prevent texexec from using fmtutil(1)? to generate formats (which can be handy when tracing installation problems).
Specify a !ConTeXt? ENVIRONMENT to use when processing the file. This option can be useful when converting from non-!ConTeXt? file formats where no environment or layout settings are present in the file.
--help [ ''SWITCH''?
Produce a summary of switches and arguments. Many switches have additional information that can be seen by typing ``texexec --help optvar(SWITCH).
Specify the language !ConTeXt? should use to communicate with you. Options are
Process a file once and only once. (By default, texexec processes the file as many times as necessary to sort out all references, typeset METAPOST code, and so forth.)
Specify the output DRIVER for use with special primitives. Defaults to the setting in the local cont-sys.tex file, but can be set to one of
Native pdftex(1) code
For dvips(1) (the default)
For dviwindo, the oldest !ConTeXt? drivers
For dviview (experimental)
There may be other supported drivers -- check the most recent !ConTeXt? documentation.
Specify the pages or page range to appear in the output file. PAGENUMBERLIST may be the keyword odd or even; one or more pages separated by commas (x,y); or a page range in the form :z.
Pass additional command-line switches and arguments to the tex(1) process run by texexec.
For example, the MikTeX TeX system (for DOS/Windows) can embed information in the DVI file that will allow you to find the line in a source code file corresponding to the line in the typeset output. It uses a switch called ``--src to activate this functionality, and can be used from texexec as
The double quotes () are required to prevent texexec from using the switch itself.
The name of the TeX program to use (tex(1), by default).
Allows you to change the basename of the output file. See --mode for an example.
Specify the number of runs to perform on a file. Overrides texexecs calculations.
Suppress diagnostic and progress messages.
Specify the suffix of the output file.
Force a run of texutil(1).
Including specifying paper sizes, formats, and so forth.
Dont perform page rearrangements (e.g., for producing a booklet) until the last run.
Process the file in batch mode -- continue to typeset the document after finding errors. More imformation about batch mode can be found in Donald E. Knuths !TeXbook?.
The name of a font to preload for use in setting the body of the text.
Center the document image on the page.
Turn on color mode. Color mode can also be set by commands embedded in the document. These commands override the --color option.
Convert the input file to !ConTeXt? format from FORMAT before processing. In most cases, this conversion will result in a TeX file. Currently supported input FORMATs are xml and sgml.
Shortcut for --output=dvi.
Typeset the document(s) as fast as possible without causing problems.
Perform a final run without skipping anything. This option is typically used with --fast.
Set the language for hyphenation. Can be specified in your source file. Options are the same as those for --interface.
Allows you to change the mode (page size and resolution) of the output file.
texexec --pdf --mode=A4 --result=pdftex-a pdftex-t texexec --pdf --mode=letter --result=pdftex-l pdftex-t texexec --pdf --mode=screen --result=pdftex-s pdftex-t
Here the mode switch tells !ConTeXt? to obey the mode directives in the layout specifications. The --result flag allows you to rename the output file.
Ignore arrangement commands in the source file.
For typesetting multiple pages on a single piece of paper. KEY can be a4a3 (for printing A4 pages on A3 paper) or a5a4 (for printing A5 pages on A4 paper). The actual layout of the pages is specified with the --print switch.
Shorthand for --output=pdftex.
Specify a FORMATFILE to use when typesetting. texexec will prepend the string cont- to the name you give, so you can type plain instead of cont-plain, as in
texexec --format=plain --program=pdftex somefile
Specify the number of pages to show on a single page. Use with --pdfcombine.
For rearranging pages in PDF files.
texexec --pdfarrange --paper=a5a4 --print=up foo.pdf
This command creates an A5 booklet from a PDF file foo.pdf. --pdfarrange is used in conjunction with the following switches:
Adjust the space between the edge of the pages and the beginning of the text block.
Adjust the inside (``gutter) margins.
Adjust the top and bottom margin.
Add crop marks.
Add empty pages after the pages specified in PAGES. (Useful for, among other things, adding blank pages after a table of contents.)
Set the width of the original text. Specifying this parameter with a single-sided original will allow !ConTeXt? to adjust the page layout for double-sided output, producing much more attractive results.
With the --pdfarrange flag, specifying more than one file will result in all of the files being combined in the final result, allowing you to add title pages, decorated part separators, and so forth.
You can also do more complex manipulations, such as adding additional text to the page by setting up a small file with layout definitions and a simple figure insertion loop.
Combine multiple pages. Requires you to specify the --combination switch.
Extract pages from a file. Use in combination with the --selection switch, as in
texexec --pdfselect --paper=S6 --selection=1,9,14 file-1
which extracts pages 1, 9, and 14 from file-1.pdf, and places them in texexec.pdf (the default output filename if an output file isnt specified).
See --pdfarrange for other options.
Produce a typeset version of the source code in FILE. You can specify the form of the output file, as in
texexec --listing --pdf readme.now
which will produce a PDF file called texexec.pdf. Without the --pdf flag, texexec will produce a DVI file.
See also --backspace and --topspace.
The name of a !MetaPost? format file.
Strips out and typesets TeX code embedded in a !MetaPost? file.
Do not run !MetaPost?, even if needed.
Specify one of three options to produce a document containing the images used in the source file:
A proof sheet with additional information provided for each figure
A proof sheet with the graphics only
One figure per page, with the page clipped to the bounding box of the figure
See also --paperoffset, which allows you to specify an offset to be added to the page, as in
Each !ConTeXt? user interface (language) has its own format. The following command generates two formats, one using the English interface for typesetting in English, and one for Dutch:
texexec --make en nl
By default, the language used for typesetting matches the user-interface language (set with --interface. Its possible to use one language for typesetting and another for messages by changing the relevant settings in cont-usr.tex, but these languages can also be changed on the command line with a command such as
texexec --make --language=pl,cz,sk --bodyfont=plr en
That command generates a !ConTeXt? format file with an English user interface, and the main language set to Polish (pl). The default body font is the Polish version of Computer Modern Roman (plr). Czech and Slovak hyphenation patterns are also loaded so that Czech and Slovak text included in a source file will be typeset properly (cz and sk).
When the appropriate formats are present, a file can be typeset by typing
texexec tries to determine what interface it should use to typeset test.tex by looking for a line such as
% interface=en tex=pdfetex output=pdftex
at the top of the file (i.e., on the very first line). This line is equivalent to TeXs format line, ``__FORMAT'').
By default, texexec will produce a DVI file. The --pdf flag tells texexec to produce a PDF file, instead (by running pdftex(1)). You can also be more specific about what drivers texexec should use, by specifying a command line such as
texexec --output=dvips,acrobat test
which specifies the use of the dvips driver (which is the default), combined with the use of Acrobat-specific PDF instructions.
After an error-free run, texexec will run texutil(1) to determine whether additional runs of tex(1) (or pdftex(1)) or any utility programs (e.g., bibtex(1), makeindex(1)) are necessary. You can suppress these additional runs by specifying the --once or --runs flags:
When starting, texexec first looks for the file texexec.ini, which specifies the location of various programs and configuration files, and specifies the programs to use. The --verbose flag causes texexec to print the information in texexec.ini to the terminal and the log file.
texexec requires Perl. On Unix and Unix-like systems, no special steps have to be taken to get texexec to work beyond installing Perl and having the perl(1) binary in your path. On Windows systems, however, you may need to run Perl by typing commands such as ``perl texexec.pl optvar(ARGS).
The fpTeX distribution comes with a program called runperl.exe that can be copied and renamed to texexec.exe. You will also have to rename a copy to texutil.exe (see texutil(1)). The teTeX and fpTeX distributions, at least, should perform the necessary steps as part of their installation sequence -- if you have problems, however, you may need to follow the advice given here.
Some languages require specific character encodings to represent their alphabets (beyond the basic ASCII encoding). Although you can use TeX commands to represent these characters, such as ``.z, its easier to use a text editor that includes direct support for these characters and let !ConTeXt? translate them to the necessary TeX commands. For some languages, this approach can also improve the performance of !TeXs? hyphenation algorithms.
web2c distributions (such as teTeX) support a mechanism to map document encodings to !ConTeXt?s internal encoding, font encodings, and hyphenation patterns. texexec provides a document option and a command-line flag to pass the necessary information to tex(1) or pdftex(1). You can add lines such as
to the beginning of your document, or specify the --translate flag on the command line, as
texexec --translate=il2pl somefile
TeXExec configuration file
The TeXExec manual, mtexexec.pdf.
The TeXExec configuration README files:
This manpage was written by Tobias Burnus TeXExec manual written by Hans Hagen
lib/main.php:944: Notice: PageInfo: Cannot find action page