metafun-macros.tex /size: 3361 b    last modification: 2023-12-21 09:43
1% language=us runpath=texruns:manuals/metafun
2
3\startcomponent metafun-macros
4
5\environment metafun-environment
6
7\startchapter[title={\METAFUN\ macros}]
8
9\index{metafun}
10
11\startintro
12
13\CONTEXT\ comes with a series of \METAPOST\ modules. In this chapter we will
14summarize the most important \TEX\ and \METAPOST\ macros. More information can be
15found in the documentation of the modules.
16
17\stopintro
18
19There are several ways to use the power of \METAFUN, either or not using
20\CONTEXT.
21
22\startitemize[n]
23
24\startitem
25    You can create an independent \type {mp} file and process it with the
26    \METAPOST\ program or \MPTOPDF. Depending on what features you use, the
27    succes of a run depends on the proper set up of the programs that take care
28    of running \TEX\ for \type {btex}.
29\stopitem
30
31\startitem
32    You can embed the graphic in a \type {\startMPpage} \unknown \type
33    {\stopMPpage} construct and process it with \CONTEXT\ \MKIV. In that case you
34    have the full \METAFUN\ functionality available. If for some reason you still
35    want to use \MKII, you need to use \TEXEXEC\ as before processing the file,
36    it will do a couple of checks on the file. It will also make sure that the
37    temporary files (\type {mpt} for \type {textext}'s and \type {mpo} for
38    outline fonts) are taken care of too.
39\stopitem
40
41\startitem
42    You can integrate the graphic in the document flow, using buffers, \METAPOST\
43    code sections, or (reusable) graphic containers. In that case the graphics
44    are processed runtime or between runs. This happens automatically.
45\stopitem
46
47\stopitemize
48
49Unless you want to write low level \CONTEXT\ code yourself, there is no real
50reason to look into the modules that deal with \METAPOST\ support. The
51traditional (partly generic) code is collected in:
52
53\starttabulate[|lT|p|]
54\NC supp-mps.tex \NC low level inclusion macros and housekeeping \NC\NR
55\NC supp-mpe.tex \NC experimental extensions (like specials)     \NC\NR
56\NC supp-pdf.tex \NC \METAPOST\ to \PDF\ conversion              \NC\NR
57\stoptabulate
58
59Especially the last two can be used in other macro packages. However, in
60\CONTEXT\ we have regrouped the code (plus more) in other files:
61
62\starttabulate[|lT|p|]
63\NC meta-***.tex \NC definition and managing   \NC\NR
64\NC mlib-***.tex \NC processing and conversion \NC\NR
65\stoptabulate
66
67The last category will certainly grow. Some of these modules are preloaded,
68others can be loaded using the command \type {\useMPlibrary}, like
69
70\starttyping
71\useMPlibrary[clp,txt]
72\stoptyping
73
74for loading the predefined clipping paths and text tricks.
75
76The \METAPOST\ code is organized in files named \type {mp-****.mp}. The core file
77is \type {mp-tool.mp} and this file can comfortably be used in stand||alone
78graphics. The file \type {metafun.mp} is used to load the collection of modules
79into a format. The collection of \METAPOST\ code files will grow in due time, but
80as long as you use the \METAFUN\ format, you don't have to keep track of the
81organization of files. Most files relate to subsystems and are loaded
82automatically, like the files that implement page layout support and flow charts.
83
84Although this document is the main source of information, occasionally the source
85code of \METAFUN, and in many cases the source code of \CONTEXT\ may contain
86additional information and examples.
87
88\stopchapter
89
90\stopcomponent
91