Man Pages

makempx - phpMan makempx - phpMan

Command: man perldoc info search(apropos)  

File:,  Node: makempx invocation,  Next: dvitomp invocation,  Prev: Initial MetaPost,  Up: MetaPost

6.3 MakeMPX: Support MetaPost labels

In MetaPost, labels can be typeset using any document processor; the
Web2c implementation supports TeX and Troff.  MakeMPX translates the
labels from the typesetting language back into low-level MetaPost
commands in a so-called "mpx file", so text can be manipulated like
other graphic objects.  It is invoked automatically by MetaPost.

     makempx [-troff] MPFILE MPXFILE

The input comes from MPFILE (no path searching is done), and the output
goes to MPXFILE.  However, if the file MPXFILE already exists, and is
newer than MPFILE, then nothing is done (presumably the file is

  1. MPto is run to extract the label text from the MetaPost source
     file MPFILE (*note mpto invocation::).

  2. The typesetting program itself is run, either TeX or Troff (see
     below).  If TeX, and the file named by the `MPTEXPRE' environment
     variable exists (`mptexpre.tex' by default), that file is
     prepended to the input from the MetaPost file.

  3. The typesetter output (a DVI file in the case of TeX, Ditroff
     output for Troff) is translated back to MetaPost, by DVItoMP
     (*note dvitomp invocation::) or DMP (*note dmp invocation::)

   If any of the above steps fail, for example if there was a
typesetting mistake in the original MPFILE, output may be left in files
named `mpxerr.{log,tex,dvi}' (TeX) or `mpxerr{,.t}' (Troff), so you can
diagnose the problem.

   The `-troff' option to MPto selects the Troff commands, rather than
TeX.  MetaPost supplies this automatically if the `-T' or `-troff'
option was specified to MetaPost.

   The MPX file created by MakeMPX is a sequence of MetaPost picture
expressions, one for every label in the original MetaPost input file.

   The names of the commands run by MakeMPX, and the directory added to
the shell search `PATH' for the commands' location, are overridden by
environment variables.  Here is a list:

     The directory added to the `PATH'.  Default is the `$(bindir)'
     Make directory, which in turn is set from the configure-time
     `--bindir', `--exec-prefix' and `--prefix' options; if nothing
     else is specified, the default is file `/usr/local'.

     The command run to determine if MPXFILE is out of date with respect
     to MPFILE; default is `newer'.

     The command run to extract MetaPost labels in TeX format; default
     is `mpto -tex'.

     Likewise, for Troff; default is `mpto -troff'.

     The command run to convert TeX output back to MetaPost; default is

     Likewise, for Troff; default is `dmp'.

     The command run to typeset the labels in TeX; the default is
     `etex', set in `texmf.cnf'.  If you use LaTeX, set this to
     `latex', and supply an appropriate `verbatimtex' header in the MP
     source (*note mpost invocation::).  Or put `%&latex' as the first
     line of your LaTeX source.

     Likewise, for Troff; default is `'eqn -d\$\$ | troff -Tpost''.  You
     may need to replace `-Tpost' by `-TTERM', where TERM is the
     PostScript device name for your Troff implementation, e.g., `ps'
     or `psc'; see troff(1).

     If you change this, you will also need to set the `TRFONTS'
     environment variable or configuration value to point to the
     appropriate font directory, traditionally `/usr/lib/font/devTERM'.

     One more complication is whether the troff programs have a `g'
     prefix.  On Windows, TeX Live supports both ways: `makempx.exe' is
     built to use `gsoelim.exe', `geqn.exe', and `gtroff.exe', while
     `makempx-without-g-prefix.exe' is built to use `soelim.exe',
     `eqn.exe', and `troff.exe'.  MetaPost users on Windows using troff
     for their labels should arrange to run the proper binary.