1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
|
.\" MetaPost man page, by John Hobby. Public domain.
.TH MP 1
.CT 1 writing_other
.SH NAME
mp, MetaPost \- system for drawing pictures
.SH SYNOPSIS
.B mp
[
.B -I
]
[
.B -T
]
[
.I first-line
]
.SH DESCRIPTION
.I Mp
interprets the MetaPost language and produces
.I PostScript
pictures. The MetaPost language is similar to Knuth's
.I METAFONT
with additional features for including
.IR tex (1)
or
.IR troff (1)
commands and accessing features of PostScript not found in METAFONT.
The
.B -T
flag selects
.I troff
instead of
.IR tex .
.PP
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
.L \e
and including an
.L input
command. Thus
.L mp figs
processes the file
.LR figs.mp .
The basename of
.L figs
becomes the
.IR jobname ,
and is used in forming output file names. If no file is named, the
jobname becomes
.LR mpout .
The default
.L .mp
extension can be overridden by specifying an extension explicitly.
.PP
There is normally one output file for each picture generated,
and the output files are named
.IR jobname.nnn ,
where
.I nnn
is a number passed to the
.L beginfig
macro. The output file name
can also be
.IB jobname .ps
if this number is negative.
.PP
The output files can be used as figures in a TeX document by including
.ce
.BI "\especial{psfile=" jobname.nnn }
in the TeX document. Alternatively, one can
.L \einput epsf.tex
and then use the macro
.BI "\eepsfbox{" jobname.nnn }
to produce a box of the appropriate size containing the figure.
.TP
.BI btex " TeX commands " etex
This causes
.I mp
to generate a MetaPost picture expression that corresponds to the
TeX commands. If the TeX commands generate
more than one line of text, it must be in a
.L \evbox
or a minipage environment.
.TP
.BI verbatimtex " TeX commands " etex
This is ignored by
.I mp
except that the TeX commands are passed on to TeX. When using LaTeX
instead of TeX the input file must start with a
.L verbatimtex
block that gives the
.L \edocumentstyle
and
.L "\ebegin{document}"
commands.
.PP
Since most TeX fonts have to be downloaded as bitmaps, the
.L btex
feature works best when the output of
.L mp
is to be included in a TeX document so that
.IR dvips (1)
can download the fonts. For self-contained PostScript output that can be
used directly or included in a
.I troff
document, start your MetaPost input file with the command
.L "prologues:=1"
and stick to standard PostScript fonts. TeX and MetaPost use the names in the
third column of the file
.LR /usr/lib/mp/trfonts.map .
.PP
MetaPost output can be included in a
.I troff
document via the
.L "-mpictures"
macro package. In this case
.I mp
should be invoked with the
.B -T
flag so that the commands between
.L btex
and
.L etex
or between
.L verbatimtex
and
.L etex
are interpreted as
.I troff
instead of TeX. (This automatically sets
.L prologues:=1
).
.PP
Here is a list of the environment variables affect the behavior of
.IR mp :
.TF MPXCOMMAND
.TP
.B MPINPUTS
Search path for
.L \einput
files.
It should be colon-separated,
and start with dot.
Default:
.L .:/usr/lib/mp
.TP
.B MFINPUTS
Auxiliary search path for
.L \einput
files with
.L .mf
extensions.
.TP
.B TEXFONTS
Search path for font metric files.
.TP
.B MPXCOMMAND
The name of a shell script that converts embedded typesetting commands
to a form that
.I mp
understands.
Defaults:
.L /usr/lib/mp/bin/makempx
for
.I tex
and
.L /usr/lib/mp/bin/troffmpx
for
.I troff
.TP
.B TEX
The version of TeX to use when processing
.L btex
and
.L verbatimtex
commands. Default:
.L tex
.TP
.B TROFF
The
.I troff
pipeline for
.L btex
and
.L verbatimtex
commands. Default:
.L eqn -d\e$\e$ | troff
.TP
.B MPMEMS
Search path for
.L .mem
files. Default:
.L .:/usr/lib/mp
.TP
.B MPPOOL
Search path for strings.
Default:
.L .:/usr/lib/mp
.TP
.B MPEDITOR
A command for invoking an editor with
.L %s
in place of the file name and
.L %d
in place of the line number.
.TP
.B TEXVFONTS
Search path for virtual fonts.
.TP
.B MPTEXPRE
Name of a file that is prepended before running tex.
If this file exists,
.I mp
behaves as if the file were inside of a
.L verbatimtex
block at the beginning of each input file. Default:
.L mptexpre.tex
.PD
.PP
A
.L .mem
file is a binary file that permits fast loading of fonts and macro packages.
.I Mp
reads the default
.F plain.mem
unless another
.L .mem
file is specified at the start of the first line with an
.L &
just before it. There is also an
.F mfplain.mem
that simulates plain METAFONT so that
.I mp
can read
.L .mf
fonts. (Plain METAFONT is described in
.I The
.IR METAFONTbook ).
.PP
Experts can create
.L .mem
files be invoking
.I mp
with the
.B -I
switch and giving macro definitions followed by a
.L dump
command.
.PP
The MetaPost language is similar to METAFONT, but the manual
.I A User's Manual for MetaPost
assumes no knowledge of METAFONT. MetaPost does not have bitmap
output commands or METAFONT's online display mechanism.
.SH FILES
.TF /usr/lib/mp/trfonts.map
.TP
.F /usr/lib/mp/*
macros,
.L .mem
files, and tables for handling included
.I tex
and
.I troff
.TP
.F /usr/lib/mp/bin
Directory for programs that handle included
.I tex
and
.IR troff .
.F /usr/lib/mp/trfonts.map
table of corresponding font names for
.IR troff ,
PostScript, and TeX
.TP
.F /usr/lib/mp/examples.mp
The source file for a few sample figures.
.IR troff .
.SH "SEE ALSO"
.IR tex (1),
.br
Donald E. Knuth,
.I The METAFONTbook,
Addison Wesley, 1986,
.br
John D. Hobby,
.I A User's Manual for MetaPost
CSTR 162.
|