MP(1) User Commands MP(1) NAME mp, inimp, virmp - MetaPost, a system for drawing pictures SYNOPSIS mp [ -T ] [ first-line ] inimp [ -T ] [ first-line ] virmp [ -T ] [ first-line ] DESCRIPTION MetaPost interprets the MetaPost language and produces PostScript pictures. The MetaPost language is similar to Knuth's Metafont with additional features for including tex(1) or troff(1) commands and accessing features of PostScript not found in Metafont. The -T flag selects _t_r_o_f_f instead of _t_e_x. Like TeX and Metafont, MetaPost is normally used with a large body of precompiled macros. The basic program as com- piled is called inimp; it can be used to precompile macros into a ._m_e_m file. The virmp variant is used to reload the ._m_e_m files quickly. Typically, virmp has links to it by the names of the various mem files. For example, if you link virmp to mp and then execute the program mp, you get the mem file _m_p._m_e_m. You can load a different base by saying, e.g., _v_i_r_m_p &_m_y_m_e_m. 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 _i_n_p_u_t command. Thus _m_p _f_i_g_s processes the file _f_i_g_s._m_p. The basename of _f_i_g_s becomes the ``jobname'', and is used in forming output file names. If no file is named, the jobname becomes _m_p_o_u_t. The default extension, ._m_p, can be overridden by specifying an extension explicitly. There is normally one output file for each picture gen- erated, and the output files are named _j_o_b_n_a_m_e._n_n_n, where _n_n_n is a number passed to the _b_e_g_i_n_f_i_g macro. The output file name can also be _j_o_b_n_a_m_e._p_s if this number is negative. The output files can be used as figures in a TeX document by including \special{psfile=_j_o_b_n_a_m_e._n_n_n} in the TeX document. Alternatively, one can \input epsf.tex and then use the macro \epsfbox{_j_o_b_n_a_m_e._n_n_n} to produce a box of the appropriate size containing the fig- ure. btex _T_e_X _c_o_m_m_a_n_d_s etex SunOS 5.5 Last change: 28 April 1995 1 MP(1) User Commands MP(1) This causes _m_p 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 \_v_b_o_x or a minipage environment. verbatimtex _T_e_X _c_o_m_m_a_n_d_s etex This is ignored by _m_p except that the TeX commands are passed on to TeX. When using LaTeX instead of TeX the input file must start with a _v_e_r_b_a_t_i_m_t_e_x block that gives the \_d_o_c_u_m_e_n_t_s_t_y_l_e and \_b_e_g_i_n{_d_o_c_u_m_e_n_t} commands. Since most TeX fonts have to be downloaded as bitmaps, the _b_t_e_x feature works best when the output of _m_p 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 _t_r_o_f_f document, start your MetaPost input file with the command _p_r_o_l_o_g_u_e_s:=_1 and stick to standard PostScript fonts. TeX and MetaPost use the names in the third column of the file /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t/_s_u_p_p_o_r_t/_t_r_f_o_n_t_s._m_a_p. MetaPost output can be included in a _t_r_o_f_f document via the -_m _p_i_c_t_u_r_e_s macro package. In this case _m_p should be invoked with the -T flag so that the commands between _b_t_e_x and _e_t_e_x or between _v_e_r_b_a_t_i_m_t_e_x and _e_t_e_x are interpreted as _t_r_o_f_f instead of TeX. (This automatically sets _p_r_o_l_o_g_u_e_s:=_1 ). ENVIRONMENT The default values for all environment variables are set at the time of compilation in the file _k_p_a_t_h_s_e_a/_p_a_t_h_s._h. See the Kpathsearch library documentation (the `Path specifica- tions' node) for the details of the searching. If the environment variable TEXMFOUTPUT is set, MetaPost 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 _m_p: MPINPUTS Search path for _i_n_p_u_t files. It should be colon-separated, and start with dot. Default: .:!!/_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t// MFINPUTS Auxiliary search path for _i_n_p_u_t files with ._m_f extensions. Default: .:!!/_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_f_o_n_t//:!!/_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_f_o_n_t_s/_s_o_u_r_c_e//:/_v_a_r/_t_m_p/_t_e_x_f_o_n_t_s/_s_o_u_r_c_e// TEXFONTS Search path for font metric (._t_f_m) files. Default: !!/_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_f_o_n_t_s/_t_f_m//:/_v_a_r/_t_m_p/_t_e_x_f_o_n_t_s/_t_f_m//:. SunOS 5.5 Last change: 28 April 1995 2 MP(1) User Commands MP(1) VFONTS Search path for virtual font (._v_f) files. Default: !!/_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_f_o_n_t_s/_v_f//:. MPMEMS Search path for ._m_e_m files. Default: .:!!/_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_w_e_b_2_c MPPOOL Search path for internal MetaPost strings. (Used by inimp only.) Default: .:!!/_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_w_e_b_2_c MPSUPPORT Directory for various tables for handling included _t_e_x and _t_r_o_f_f. Default: /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t/_s_u_p_p_o_r_t MPXCOMMAND The name of a shell script that converts embed- ded typesetting commands to a form that MetaPost understands. Defaults: _m_a_k_e_m_p_x for _t_e_x and _t_r_o_f_f_m_p_x for _t_r_o_f_f. TEX The version of TeX - or LaTeX - to use when pro- cessing _b_t_e_x and _v_e_r_b_a_t_i_m_t_e_x commands. Default: _t_e_x TROFF The _t_r_o_f_f pipeline for _b_t_e_x and _v_e_r_b_a_t_i_m_t_e_x com- mands. Default: _e_q_n -_d\$\$ | _t_r_o_f_f MPEDIT A command template for invoking an editor. Default: _v_i +%_d %_s A ._m_e_m file is a binary file that permits fast loading of macro packages. _m_p reads the default _p_l_a_i_n._m_e_m unless another ._m_e_m 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 _m_p can read ._m_f fonts. (Plain Metafont is described in _T_h_e _M_e_t_a_f_o_n_t_b_o_o_k). Experts can create ._m_e_m files be invoking _i_n_i_m_p and giving macro definitions followed by a _d_u_m_p command. The MetaPost language is similar to Metafont, but the manual _A _U_s_e_r'_s _M_a_n_u_a_l _f_o_r _M_e_t_a_P_o_s_t assumes no knowledge of Metafont. MetaPost does not have bitmap output commands or Metafont's online display mechanism. FILES /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_w_e_b_2_c/_m_p._p_o_o_l Encoded text of MetaPost's messages. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_w_e_b_2_c/*._m_e_m Predigested MetaPost mem files. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t/_b_a_s_e/_p_l_a_i_n._m_p SunOS 5.5 Last change: 28 April 1995 3 MP(1) User Commands MP(1) The standard mem file. This is loaded when _v_i_r_m_p is invoked via a symbolic link as _m_p. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t/_b_a_s_e/_m_f_p_l_a_i_n._m_p The Metafont-compatible mem file. This is loaded when _v_i_r_m_p is invoked via a symbolic link as _m_f_m_p. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t/_b_a_s_e/*._m_p The standard MetaPost macros included in the original distribu- tion. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t/_s_u_p_p_o_r_t/* Various tables for handling included _t_e_x and _t_r_o_f_f. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_m_e_t_a_p_o_s_t/_s_u_p_p_o_r_t/_t_r_f_o_n_t_s._m_a_p Table of corresponding font names for _t_r_o_f_f and PostScript. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_d_v_i_p_s/_p_s_f_o_n_t_s._m_a_p Table of corresponding font names for _t_e_x and PostScript. /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_d_o_c/_m_p/_e_x_a_m_p_l_e_s._m_p The source file for a few sample figures that are part of a LaTeX document /_u_s_r/_l_o_c_a_l/_t_e_T_e_X/_t_e_x_m_f/_d_o_c/_m_p/_m_p_i_n_t_r_o._t_e_x that describes the MetaPost system in a little more detail. SUGGESTED READING Donald E. Knuth, _T_h_e _M_e_t_a_f_o_n_t_b_o_o_k (Volume C of _C_o_m_p_u_t_e_r_s _a_n_d _T_y_p_e_s_e_t_t_i_n_g), Addison-Wesley, 1986, ISBN 0-201-13445-4. John D. Hobby, _A _U_s_e_r'_s _M_a_n_u_a_l _f_o_r _M_e_t_a_P_o_s_t, CSTR 162, AT&T Bell Labs, John D. Hobby, _D_r_a_w_i_n_g _G_r_a_p_h_s _w_i_t_h _M_e_t_a_P_o_s_t, CSTR 164, AT&T Bell Labs, _T_U_G_b_o_a_t (the journal of the TeX Users Group). SEE ALSO tex(1), mf(1), dvips(1). AUTHORS MetaPost was designed by John D. Hobby, incorporating algo- rithms from Metafont by Donald E. Knuth. It was originally implemented on Unix, incorporating system-dependent routines from web2c, while not relying on it except for the actual Web-to-C translator. SunOS 5.5 Last change: 28 April 1995 4 MP(1) User Commands MP(1) Ulrik Vieth adapted MetaPost to take advantage of the advanced path searching features in more recent versions of web2c and worked towards fully integrating MetaPost into the canonical Unix TeX distribution. He also updated and extended this manual page. TRIVIA Unlike TeX and Metafont, MetaPost originally didn't use any fancy logo. John Hobby says he prefers the spelling ``Meta- Post'', yet Don Knuth has updated the Metafont _l_o_g_o._m_f font to be able to typeset a proper MetaPost logo similar to the Metafont logo. Feel free to use whatever you think is more appropriate! SunOS 5.5 Last change: 28 April 1995 5