summaryrefslogtreecommitdiff
path: root/Master/texmf-doc/source/english/tex-refs/tex-refs-chapter-metapost.xml
blob: 0da3cea20b8d16a0910b96a2cb9d2404bc2b8e9e (plain)
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<?xml version='1.0' encoding='ISO-8859-1'?>

<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
          "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
 <!ENTITY % tex-refs-ent SYSTEM "tex-refs.ent" >
%tex-refs-ent;
]>

<!-- $Id: tex-refs-chapter-metapost.xml 139 2004-08-26 16:58:10Z mw $ -->

<chapter id="metapost" lang="en">
  <title id="metapost-title">&metapost;</title>
  <indexterm><primary>&metapost;</primary></indexterm>

  <note>
    <para>The contents of this section was taken from 
      <filename>mpost(1)</filename>.
    </para>
  </note>

  <para>&metapost; is a programming language much like Knuth's &metafont;
    except that it outputs PostScript programs instead of bitmaps. 
    Borrowed from &metafont; are the basic tools for creating and
    manipulating pictures. These include numbers, coordinate pairs,
    cubic splines, affine transformations, text strings, and boolean
    quantities. Additional features facilitate integrating text and
    graphics and accessing special features of PostScript such as clipping,
    shading, and dashed lines. Another feature borrowed from &metafont;
    is the ability to solve linear equations that are given implicitly,
    thus allowing many programs to be written in a largely declarative 
    style. By building complex operations from simpler ones, &metapost;
    achieves both power and exibility.
  </para>

  <section id="metapost-options">
    <title id="metapost-options-title">Options</title>
    <indexterm>
      <primary>MetaPost</primary>
      <secondary>Options</secondary>
    </indexterm>

    <para>&metapost; understands the following command line options.</para>

    <section id="metapost-option-file-line-error-style">
      <title><filename role="nohyphenation">--file-line-error-style</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--file-line-error-style</tertiary>
      </indexterm>
      <para>Print error messages in the form
	<literal>file:line:error</literal>
	which is similar to the way many compilers format them.
      </para>
    </section>

    <section id="metapost-option-help">
      <title><filename role="nohyphenation">--help</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--help</tertiary>
      </indexterm>
      <para>Print help message and exit.</para>
    </section>

    <section id="metapost-option-ini">
      <title><filename role="nohyphenation">--ini</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--ini</tertiary>
      </indexterm>
      <para>Be <command>inimpost</command>, for dumping bases; this 
	is implicitly true if the program is called as 
	<command>inimpost</command>.</para>
    </section>

    <section id="metapost-option-intercation">
      <title><filename role="nohyphenation">--interaction mode</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--interaction mode</tertiary>
      </indexterm>
      <para>Sets the interaction mode. The mode can be one of
	<literal>batchmode</literal>, <literal>nonstopmode</literal>,  
	<literal>scrollmode</literal>,  and
	<literal>errorstopmode</literal>.
	The meaning of these modes is the same as that of the
	corresponding commands.</para>
    </section>

    <section id="metapost-option-jobname">
      <title><filename role="nohyphenation">--jobname name</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--jobname name</tertiary>
      </indexterm>
      <para>Use <literal>name</literal> for the job name, instead 
	of deriving it from the name of the input file.</para>
    </section>

    <section id="metapost-option-kpathsea-debug">
      <title><filename role="nohyphenation">--kpathsea-debug bitmask</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--kpathsea-debug bitmask</tertiary>
      </indexterm>
      <para>Sets path searching debugging flags according to the 
	<literal>bitmask</literal>. See the Kpathsea manual for details.</para>
    </section>

    <section id="metapost-option-mem">
      <title><filename role="nohyphenation">--mem mem</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--mem mem</tertiary>
      </indexterm>
      <para>Use <literal>mem</literal> as the name of the mem to be
	used, instead of the name by which &metapost; was called or a 
	<literal>%&amp;</literal> line.</para>
    </section>

    <section id="metapost-option-parse-first-line">
      <title><filename role="nohyphenation">--parse-first-line</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--parse-first-line</tertiary>
      </indexterm>
      <para>If the first line of the main input file begins with 
	<literal>%&amp;</literal> parse it to look for a dump name or a 
	<literal>--translate-file</literal> option.</para>
    </section>

    <section id="metapost-option-progname">
      <title><filename role="nohyphenation">--progname name</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--progname name</tertiary>
      </indexterm>
      <para>Pretend to be program <literal>name</literal>. 
	This affects both the format used and the search paths.</para>
    </section>

    <section id="metapost-option-recorder">
      <title><filename role="nohyphenation">--recorder</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--recorder</tertiary>
      </indexterm>
      <para>Enable the filename recorder. This leaves a trace of the files
	opened for input and output in a file with extension 
	<literal>.fls.</literal></para>
    </section>

    <section id="metapost-option-T">
      <title><filename role="nohyphenation">-T</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>-T</tertiary>
      </indexterm>
      <para>Produce TROFF output.</para>
    </section>

    <section id="metapost-option-translate-file">
      <title><filename role="nohyphenation">--translate-file tcxname</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--translate-file tcxname</tertiary>
      </indexterm>
      <para>Use the <literal>tcxname</literal> translation table.</para>
    </section>

    <section id="metapost-option-troff">
      <title><filename role="nohyphenation">--troff</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--troff</tertiary>
      </indexterm>
      <para>As -T.</para>
    </section>

    <section id="metapost-option-version">
      <title><filename role="nohyphenation">--version</filename></title>
      <indexterm>
	<primary>MetaPost</primary>
	<secondary>Options</secondary>
	<tertiary>--version</tertiary>
      </indexterm>
      <para>Print version information and exit.</para>
    </section>

  </section>

  <section id="metapost-environment">
    <title>Environment</title>
    <indexterm>
      <primary>MetaPost</primary>
      <secondary>Environment</secondary>
    </indexterm>

    <para>See the Kpathsearch library documentation (the `Path  specifications'
      node) for the details of how the environment variables are use when
      searching. The <command>kpsewhich</command> utility can be used to 
      query the values of the variables.
    </para>
    <para>If the environment variable <literal>TEXMFOUTPUT</literal> 
      is set, &metapost; attempts to put its output files in it, if 
      they cannot be put in the current directory.
    </para>
    <para>Here is a list of the environment variables which affect the 
      behavior of &metapost;:
      <variablelist>
	<varlistentry>
	  <term><literal>MPINPUTS</literal></term>
	  <listitem>
	    <indexterm>
	      <primary>&metapost;</primary>
	      <secondary>Environment</secondary>
	      <tertiary>MPINPUTS</tertiary>
	    </indexterm>
	    <simpara>Search path for input files.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>MFINPUTS</literal></term>
	  <listitem>
	    <indexterm>
	      <primary>&metapost;</primary>
	      <secondary>Environment</secondary>
	      <tertiary>MFINPUTS</tertiary>
	    </indexterm>
	    <simpara>Auxiliary search path for input files with
	      <literal>.mf</literal>  extensions.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>MPSUPPORT</literal></term>
	  <listitem>
	    <indexterm>
	      <primary>&metapost;</primary>
	      <secondary>Environment</secondary>
	      <tertiary>MPSUPPORT</tertiary>
	    </indexterm>
	    <simpara>Directory for various tables for handling 
	      included &tex; and troff.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>MPXCOMMAND</literal></term>
	  <listitem>
	    <indexterm>
	      <primary>&metapost;</primary>
	      <secondary>Environment</secondary>
	      <tertiary>MPXCOMMAND</tertiary>
	    </indexterm>
	    <simpara>The name of a shell script that converts
	      embedded typesetting commands to a form that 
	      &metapost; understands. Defaults: 
	      <literal>makempx</literal> for &tex; and 
	      <literal>troffmpx</literal> for troff.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>TEX</literal></term>
	  <listitem>
	    <indexterm>
	      <primary>&metapost;</primary>
	      <secondary>Environment</secondary>
	      <tertiary>TEX</tertiary>
	    </indexterm>
	    <simpara>The version of &tex; - or &latex; - to use when
	      processing <command>btex</command> and
	      <command>verbatimtex</command> commands.
	      Default &tex;. This version of &metapost; allows you
	      to use a <literal>`%&amp;format'</literal> line
              instead.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>TROFF</literal></term>
	  <listitem>
	    <indexterm>
	      <primary>&metapost;</primary>
	      <secondary>Environment</secondary>
	      <tertiary>TROFF</tertiary>
	    </indexterm>
	    <simpara>The troff pipeline for <command>btex</command> 
	      and <command>verbatimtex</command> commands.
              Default <literal>eqn -d\$\$ | troff</literal></simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>MPEDIT</literal></term>
	  <listitem>
	    <indexterm>
	      <primary>&metapost;</primary>
	      <secondary>Environment</secondary>
	      <tertiary>MPEDIT</tertiary>
	    </indexterm>
	    <simpara>A command template for invoking an editor.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>
    </para>

    <para>A <literal>.mem</literal> file is a binary file that permits
      fast loading of macro packages. &metapost; reads the default 
      <literal>plain.mem</literal> unless another <literal>.mem</literal>
       file is specified at the start of the first line with an 
      <literal>&amp;</literal> just before it. There is also an 
      <literal>mfplain.mem</literal> that simulates plain
      &metafont; so that &metapost; can read <literal>.mf</literal> 
      fonts. (Plain Metafont is described in 
      <emphasis>The Metafontbook</emphasis>).
    </para>
    <para>Experts can create <literal>.mem</literal> files by 
      invoking <command>inimpost</command> and giving
      macro definitions followed by a dump command.
    </para>
    <para>The &metapost; language is similar to &metafont;, 
      but the manual <emphasis>A User's Manual for MetaPost</emphasis>
      assumes no knowledge of &metafont;.
      &metapost; does not have bitmap output commands or
      &metafont;'s online display mechanism.</para>
  </section>

</chapter>