MP(1) MP(1) NAME mp - MetaPost, a system for drawing pictures SYNOPSIS mp [ options ] [ commands ] 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 commands given on the command line to mp are passed to it as the first input line. The first line should begin with a filename, a control sequence, or &memname. The normal usage is to say mp figs to process 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 extension, .mp, 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 can also be jobname.ps if this number is negative. The output files can be used as figures in a tex(1) document by including \special{psfile=jobname.nnn} in the 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 picture expression 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} commands. You can use the `%&' construct in the first verbatimtex block to ensure that the correct tex format is used to process the commands. Page 1 Plan 9 (printed 11/23/24) 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 (see tex(1)) can download the fonts. For self-contained PostScript output that can be used directly or included in a troff document, start your input file with the command prologues:=1 and stick to standard PostScript fonts. Tex and mp use the names in the third col- umn of the file trfonts.map, which can be found in the directories with support files for mp. Mp 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 interpreted as troff instead of tex. (This automatically sets prologues:=1). OPTIONS This version of mp understands the following command line options. --mem mem Use mem as the name of the mem to be used, instead of the name by which mp was called or a %& line. --help Print help message and exit. --ini Be inimpost, for dumping bases; this is implicitly true if the program is called as inimpost. --interaction mode Sets the interaction mode. The mode can be one of batchmode, nonstopmode, scrollmode, and errorstopmode. The meaning of these modes is the same as that of the corresponding commands. --kpathsea-debug bitmask Sets path searching debugging flags according to the bitmask. See the Kpathsea manual for details. --progname name Pretend to be program name. This affects both the for- mat used and the search paths. -T Produce TROFF output. --troff As -T. Page 2 Plan 9 (printed 11/23/24) MP(1) MP(1) --version Print version information and exit. ENVIRONMENT See the paths section of tex(1) for the details of how the environment variables are used when searching. The kpsewhich utility can be used to query the values of the variables. If the environment variable TEXMFOUTPUT is set, mp attempts to put its output files in it, if they cannot be put in the current directory. Here is a list of the environment variables affect the behavior of mp: MPINPUTS Search path for input files. MFINPUTS Auxiliary search path for input files with .mf exten- sions. MPSUPPORT Directory for various tables for handling included tex and troff. MPXCOMMAND The name of a shell script that converts embedded type- setting commands to a form that mp understands. Defaults: makempx for tex and troffmpx for troff. TEX The version of tex or latex to use when processing btex and verbatimtex commands. Default tex. This version of mp allows you to use a `%&format' line instead. TROFF The troff pipeline for btex and verbatimtex commands. Default eqn -d$$ | troff. MPEDIT A command template for invoking an editor. A .mem file is a binary file that permits fast loading of macro packages. Mp reads the default plain.mem unless another .mem file is specified at the start of the first line with an & just before it. There is also an that simu- lates plain MetaFont so that mp can read .mf fonts. Experts can create .mem files be invoking inimpost and giv- ing macro definitions followed by a dump command. Page 3 Plan 9 (printed 11/23/24) MP(1) MP(1) The MetaPost language is similar to MetaFont, but the manual A User's Manual for MetaPost assumes no knowledge of Meta- Font. Mp does not have bitmap output commands or MetaFont's online display mechanism. FILES mpost.pool Encoded text of 's messages. *.mem Predigested mem files. plain.mp The standard mem file. mfplain.mp The -compatible mem file. /sys/lib/texmf/metapost/base/*.mp The standard macros included in the original distribu- tion. /sys/lib/texmf/metapost/support/* Various tables for handling included tex and troff. /sys/lib/texmf/metapost/support/trfonts.map Table of corresponding font names for troff and PostScript. psfonts.map Table of corresponding font names for tex and PostScript. /sys/lib/texmf/doc/metapost/examples.mp The source file for a few sample figures that are part of a latex document mpintro.tex that describes the MetaPost system in a little more detail. SEE ALSO troff(1), tex(1). John D. Hobby, A User's Manual for MetaPost, CSTR 162, AT&T Bell Labs, John D. Hobby, Drawing Graphs with MetaPost, CSTR 164, AT&T Bell Labs. Donald E. Knuth, The MetaFont book. Page 4 Plan 9 (printed 11/23/24)