man(1) Manual page archive


     MP(1)                                                       MP(1)

     NAME
          mp, MetaPost - system for drawing pictures

     SYNOPSIS
          mp [ -I ] [ -T ] [ first-line ]

     DESCRIPTION
          Mp interprets the MetaPost language and produces PostScript
          pictures.  The MetaPost language is similar to Knuth's Meta-
          font with additional features for including tex(1) or
          troff(1) commands and accessing features of PostScript not
          found in Metafont.  The -T flag selects troff instead of
          tex.

          An argument given on the command line behaves as the first
          input line.  That can be either a (possibly truncated) file
          name or a sequence MetaPost commands starting with `\' and
          including an `input' command.  Thus `mp figs' processes the
          file `figs.mp'.  The basename of `figs' becomes the jobname,
          and is used in forming output file names.  If no file is
          named, the jobname becomes `mpout'.  The default `.mp'
          extension can be overridden by specifying an extension
          explicitly.

          There is normally one output file for each picture gener-
          ated, and the output files are named jobname.nnn, where nnn
          is a number passed to the `beginfig' macro.  The output file
          name is jobname.ps if this number is negative.

          The output files can be used as figures in a TeX document by
          including

               \special{psfile=jobname.nnn}

          in the TeX document.  Alternatively, one can `\input
          epsf.tex' and then use the macro \epsfbox{jobname.nnn} to
          produce a box of the appropriate size containing the figure.

          btex TeX commands etex
               This causes mp to generate a MetaPost picture expres-
               sion that corresponds to the TeX commands.  If the TeX
               commands generate more than one line of text, it must
               be in a `\vbox' or a minipage environment.

          verbatimtex TeX commands etex
               This is ignored by mp except that the TeX commands are
               passed on to TeX.  When using LaTeX instead of TeX the
               input file must start with a `verbatimtex' block that
               gives the `\documentstyle' and `\begin{document}' com-
               mands.

     MP(1)                                                       MP(1)

          Since most TeX fonts have to be downloaded as bitmaps, the
          `btex' feature works best when the output of `mp' is to be
          included in a TeX document so that dvips(1) can download the
          fonts.  For self-contained PostScript output that can be
          used directly or included in a troff document, start your
          MetaPost input file with the command `prologues:=1' and
          stick to standard PostScript fonts.  TeX and MetaPost use
          the names in the third column of the file
          `/usr/lib/mp/trfonts.map'.

          MetaPost output can be included in a troff document via the
          mpictures(6) macro package.  In this case mp should be
          invoked with the -T flag so that the commands between `btex'
          and `etex' or between `verbatimtex' and `etex' are inter-
          preted as troff instead of TeX.  (This automatically sets
          `prologues:=1' ).

          Here is a list of the environment variables affect the
          behavior of mp:

          MPINPUTS    Search path for `\input' files.  It should be
                      colon-separated, and start with dot.  Default:
                      `.:/usr/lib/mp'
          MFINPUTS    Auxiliary search path for `\input' files with
                      `.mf' extensions.  Default: `.:/usr/lib/mf'
          TEXFONTS    Search path for font metric files.  Default:
                      `.:/usr/lib/tex/fonts/tfm'
          MPXCOMMAND  The name of a shell script that converts embed-
                      ded typesetting commands to a form that mp
                      understands.  Defaults:
                      `/usr/lib/mp/bin/makempx' for tex and
                      `/usr/lib/mp/bin/troffmpx' for troff
          TEX         The version of TeX to use when processing `btex'
                      and `verbatimtex' commands.  Default: `tex'
          TROFF       The troff pipeline for `btex' and `verbatimtex'
                      commands.  Default: eqn -d\$\$ | troff -Tpost
          MPMEMS      Search path for `.mem' files. Default:
                      `.:/usr/lib/mp'
          MPPOOL      Search path for strings.  Default:
                      `.:/usr/lib/mp'
          MPEDITOR    A command for invoking an editor with `%s' in
                      place of the file name and `%d' in place of the
                      line number.  Default: `/bin/ed %s'
          TEXVFONTS   Search path for virtual fonts.  Default:
                      `/usr/lib/tex/fonts/psvf'

          A `.mem' file is a binary file that permits fast loading of
          fonts and macro packages.  Mp reads the default unless
          another `.mem' file is specified at the start of the first
          line with an `&' just before it.  There is also an that sim-
          ulates plain Metafont so that mp can read `.mf' fonts.
          (Plain Metafont is described in The METAFONTbook).

     MP(1)                                                       MP(1)

          Experts can create `.mem' files be invoking mp with the -I
          switch and giving macro definitions followed by a `dump'
          command.

          The MetaPost language is similar to Metafont, but the manual
          A User's Manual for MetaPost assumes no knowledge of Meta-
          font.  MetaPost does not have bitmap output commands or
          Metafont's online display mechanism.  Use dvips(1) and
          psi(9.1) to see the results before printing.

     FILES
          macros,                              `.mem' files, and
                                               tables for handling
                                               included tex and troff
          Directory for programs that handle included
                                               tex and troff. table of
                                               corresponding font
                                               names for troff,
                                               PostScript, and TeX
          The TeX input file where the         `\epsfbox' macro is
                                               defined
          TeX input for a document that describes the MetaPost language
          The source file for the figures used in
          More information on using MetaPost with
                                               troff.

     SEE ALSO
          tex(1), lp(1), psi(9.1),
          Donald E. Knuth, The METAFONTbook, Addison Wesley, 1986,
          John D. Hobby, A User's Manual for MetaPost AT&T Bell Labs
          Computing Science Technical Report 162, 1991.