1MPOST(1) Web2C 7.5.6 MPOST(1)
2
3
4
6 mpost, inimpost, virmpost - MetaPost, a system for drawing pictures
7
9 mpost [options] [commands]
10
12 MetaPost interprets the MetaPost language and produces PostScript pic‐
13 tures. The MetaPost language is similar to Knuth's Metafont with addi‐
14 tional features for including tex(1) or troff(1) commands and accessing
15 features of PostScript not found in Metafont.
16
17 Like TeX and Metafont, MetaPost is normally used with a large body of
18 precompiled macros. This version of MetaPost looks at its command line
19 to see what name it was called under. Both inimpost and virmpost are
20 symlinks to the mpost executable. When called as inimpost (or when the
21 -ini option is given) it can be used to precompile macros into a .mem
22 file. When called as virmpost it will use the plain mem. When called
23 under any other name, MetaPost will use that name as the name of the
24 mem to use. For example, when called as mpost the mpost mem is used,
25 which is identical to the plain mem. Other mems than plain are rarely
26 used.
27
28 The commands given on the command line to the MetaPost program are
29 passed to it as the first input line. (But it is often easier to type
30 extended arguments as the first input line, since UNIX shells tend to
31 gobble up or misinterpret MetaPost's favorite symbols, like semicolons,
32 unless you quote them.) The first line should begin with a filename, a
33 \controlsequence, or a &memname.
34
35 The normal usage is to say mpost figs to process the file figs.mp. The
36 basename of figs becomes the ``jobname'', and is used in forming output
37 file names. If no file is named, the jobname becomes mpout. The
38 default extension, .mp, can be overridden by specifying an extension
39 explicitly.
40
41 There is normally one output file for each picture generated, and the
42 output files are named jobname.nnn, where nnn is a number passed to the
43 beginfig macro. The output file name can also be jobname.ps if this
44 number is negative.
45
46 The output files can be used as figures in a TeX document by including
47 \special{psfile=jobname.nnn}
48 in the TeX document. Alternatively, one can \input epsf.tex and then
49 use the macro
50 \epsfbox{jobname.nnn}
51 to produce a box of the appropriate size containing the figure.
52
53 btex TeX commands etex
54 This causes mpost to generate a MetaPost picture expression that
55 corresponds to the TeX commands. If the TeX commands generate
56 more than one line of text, it must be in a \vbox or a minipage
57 environment.
58
59 verbatimtex TeX commands etex
60 This is ignored by mpost except that the TeX commands are passed
61 on to TeX. When using LaTeX instead of TeX the input file must
62 start with a verbatimtex block that gives the \documentstyle and
63 \begin{document} commands. You can use the `%&' construct in
64 the first verbatimtex block to ensure that the correct TeX for‐
65 mat is used to process the commands.
66
67 Since most TeX fonts have to be downloaded as bitmaps, the btex feature
68 works best when the output of mpost is to be included in a TeX document
69 so that dvips(1) can download the fonts. For self-contained PostScript
70 output that can be used directly or included in a troff document, start
71 your MetaPost input file with the command prologues:=1 and stick to
72 standard PostScript fonts. TeX and MetaPost use the names in the third
73 column of the file trfonts.map, which can be found in the directories
74 with support files for MetaPost.
75
76 MetaPost output can be included in a troff document via the -m pictures
77 macro package. In this case mpost should be invoked with the -T flag
78 so that the commands between btex and etex or between verbatimtex and
79 etex are interpreted as troff instead of TeX. (This automatically sets
80 prologues:=1 ).
81
83 This version of MetaPost understands the following command line
84 options.
85
86 -file-line-error
87 Print error messages in the form file:line:error which is simi‐
88 lar to the way many compilers format them.
89
90 -no-file-line-error
91 Disable printing error messages in the file:line:error style.
92
93 -file-line-error-style
94 This is the old name of the -file-line-error option.
95
96 -halt-on-error
97 Exit with an error code when an error is encountered during pro‐
98 cessing.
99
100 -help Print help message and exit.
101
102 -ini Be inimpost, for dumping bases; this is implicitly true if the
103 program is called as inimpost.
104
105 -interaction mode
106 Sets the interaction mode. The mode can be one of batchmode,
107 nonstopmode, scrollmode, and errorstopmode. The meaning of
108 these modes is the same as that of the corresponding commands.
109
110 -jobname name
111 Use name for the job name, instead of deriving it from the name
112 of the input file.
113
114 -kpathsea-debug bitmask
115 Sets path searching debugging flags according to the bitmask.
116 See the Kpathsea manual for details.
117
118 -mem mem
119 Use mem as the name of the mem to be used, instead of the name
120 by which MetaPost was called or a %& line.
121
122 -output-directory directory
123 directory instead of the current directory. Look up input files
124 in directory first, the along the normal search path.
125
126 -parse-first-line
127 If the first line of the main input file begins with %& parse it
128 to look for a dump name or a -translate-file option.
129
130 -no-parse-first-line
131 Disable parsing of the first line of the main input file.
132
133 -progname name
134 Pretend to be program name. This affects both the format used
135 and the search paths.
136
137 -recorder
138 Enable the filename recorder. This leaves a trace of the files
139 opened for input and output in a file with extension .fls.
140
141 -T Produce TROFF output.
142
143 -translate-file tcxname
144 Use the tcxname translation table.
145
146 -troff As -T.
147
148 -version
149 Print version information and exit.
150
152 See the Kpathsearch library documentation (the `Path specifications'
153 node) for the details of how the environment variables are use when
154 searching. The kpsewhich utility can be used to query the values of
155 the variables.
156
157 If the environment variable TEXMFOUTPUT is set, MetaPost attempts to
158 put its output files in it, if they cannot be put in the current direc‐
159 tory.
160
161 Here is a list of the environment variables affect the behavior of
162 mpost:
163
164
165 MPINPUTS
166 Search path for input files.
167
168 MFINPUTS
169 Auxiliary search path for input files with .mf exten‐
170 sions.
171
172 MPSUPPORT
173 Directory for various tables for handling included tex
174 and troff.
175
176 MPXCOMMAND
177 The name of a shell script that converts embedded type‐
178 setting commands to a form that MetaPost understands.
179 Defaults: makempx for tex and troffmpx for troff.
180
181 TEX The version of TeX - or LaTeX - to use when processing
182 btex and verbatimtex commands. Default tex. This ver‐
183 sion of MetaPost allows you to use a `%&format' line
184 instead.
185
186 TROFF The troff pipeline for btex and verbatimtex commands.
187 Default eqn -d\$\$ | troff
188
189 MPEDIT A command template for invoking an editor.
190
191 A .mem file is a binary file that permits fast loading of macro
192 packages. mpost reads the default plain.mem unless another .mem
193 file is specified at the start of the first line with an & just
194 before it. There is also an mfplain.mem that simulates plain
195 Metafont so that mpost can read .mf fonts. (Plain Metafont is
196 described in The Metafontbook).
197
198 Experts can create .mem files be invoking inimpost and giving
199 macro definitions followed by a dump command.
200
201 The MetaPost language is similar to Metafont, but the manual A
202 User's Manual for MetaPost assumes no knowledge of Metafont.
203 MetaPost does not have bitmap output commands or Metafont's
204 online display mechanism.
205
207 mpost.pool
208 Encoded text of MetaPost's messages.
209
210 *.mem Predigested MetaPost mem files.
211
212 plain.mp
213 The standard mem file.
214
215 mfplain.mp
216 The Metafont-compatible mem file. This is loaded when
217 virmp is invoked via a symbolic link as mfmp.
218
219 $TEXMFMAIN/metapost/base/*.mp
220 The standard MetaPost macros included in the original
221 distribution.
222
223 $TEXMFMAIN/metapost/support/*
224 Various tables for handling included tex and troff.
225
226 $TEXMFMAIN/metapost/support/trfonts.map
227 Table of corresponding font names for troff and Post‐
228 Script.
229
230 psfonts.map
231 Table of corresponding font names for tex and PostScript.
232
233 $TEXMFMAIN/doc/metapost/examples.mp
234 The source file for a few sample figures that are part of
235 a LaTeX document $TEXMFMAIN/doc/metapost/mpintro.tex that
236 describes the MetaPost system in a little more detail.
237
239 This manual page is not meant to be exhaustive. The complete
240 documentation for this version of MetaPost can be found in the
241 info manual Web2C: A TeX implementation. See also mpman.pdf,
242 the manual written by John Hobby (it lives in the documentation
243 directory).
244
245 MetaPost is the native graphics language for ConTeXt, a typeset‐
246 ting system built on top of the TeX family. See texexec(1).
247
249 Donald E. Knuth, The Metafontbook (Volume C of Computers and
250 Typesetting), Addison-Wesley, 1986, ISBN 0-201-13445-4.
251 John D. Hobby, A User's Manual for MetaPost, CSTR 162, AT&T Bell
252 Labs,
253 John D. Hobby, Drawing Graphs with MetaPost, CSTR 164, AT&T Bell
254 Labs,
255 TUGboat (the journal of the TeX Users Group).
256
258 dvips(1), dvitomp(1), epstopdf(1), mf(1), mpto(1), mptopdf(1),
259 pdftex(1), tex(1), texexec(1).
260
262 MetaPost was designed by John D. Hobby, incorporating algorithms
263 from Metafont by Donald E. Knuth. It was originally implemented
264 on Unix, incorporating system-dependent routines from web2c,
265 while not relying on it except for the actual Web-to-C transla‐
266 tor.
267
268 Ulrik Vieth adapted MetaPost to take advantage of the advanced
269 path searching features in more recent versions of web2c and
270 worked towards fully integrating MetaPost into the canonical
271 Unix TeX distribution. He also updated and extended this manual
272 page.
273
274 The current maintainer of MetaPost is Taco Hoekwater.
275
277 Unlike TeX and Metafont, MetaPost originally didn't use any
278 fancy logo. John Hobby says he prefers the spelling ``Meta‐
279 Post'', yet Don Knuth has updated the Metafont logo.mf font to
280 be able to typeset a proper MetaPost logo similar to the Meta‐
281 font logo. Feel free to use whatever you think is more appro‐
282 priate!
283
284
285
286MetaPost 0.993 7 January 2007 MPOST(1)