23.10.2014 Views

mfpic-doc.pdf.

mfpic-doc.pdf.

mfpic-doc.pdf.

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.4 MODIFYING THE FIGURES. 30<br />

\lclosed\arc{(0,0),(1,0),45}.<br />

These are always prefixed to some figure drawing command, and apply only to the next following<br />

figure macro provided that only other prefix commands intervene. This is a rather long section, but<br />

even more modification prefixes are <strong>doc</strong>umented in subsection 4.10.2.<br />

The combination of a modifying macro, followed by a figure macro, can usually be thought of<br />

as a new figure macro, to which further prefixes might be prepended.<br />

More precisely: all prefix macros have an input path, an output path, and a side effect. The input<br />

is the path that is output by the following prefix or figure macro. The output is either the same as the<br />

input or a modification of it. The side effect might be a drawing or filling of the path or the addition<br />

of an arrowhead.<br />

We list here a classifications of prefix and figure macros that is useful for understanding the<br />

MFPIC system.<br />

Figure macros. These take no input path; they must come last in a sequence. They output the path<br />

they were designed to produce. Examples are \circle, \rect and \polygon. If they have no<br />

prefixes, or are preceded only by appending macros (see next), they invoke a default rendering<br />

of the path (usually a drawing as a solid stroke) as the side effect.<br />

Appending macros These pass their input unchanged as their output. Their side effect is the appending<br />

of some object such as an arrow head or tail. Currently only the various prefix macros<br />

whose names begin with arrow are appending macros (see subsection 4.4.3). But \reverse,<br />

which technically modifies a path and has no side effect, is coded as an appending macro so<br />

that it will work correctly with arrows. Think of it as ‘appending’ a new direction.<br />

Rendering macros These pass their input unchanged as their output. They have the side effect of<br />

adding or subtracting ink from a picture in the shape of the input path. Examples are \draw,<br />

\dotted, \gfill and \gclip.<br />

Modifying macros These output the result of applying their intended modification to the input path.<br />

Examples are macros that close the path if it was open, macros that apply a transformation<br />

such as a rotation, and macros that return only a part of a path. If they have no prefixes, or are<br />

preceded only by appending macros (see above), they also invoke a default rendering of the<br />

output path (usually a drawing as a solid stroke of the modified path) as the side effect.<br />

4.4.1 CLOSURE OF PATHS<br />

It should be pointed out that the closure macros will leave already closed paths unchanged, so it<br />

is always safe to add one when uncertain. Moreover, if the path is not closed but the endpoints are<br />

identical, \lclosed and \bclosed will close it without adding any path segment.<br />

\lclosed...<br />

\bclosed[〈tens〉]...<br />

\sclosed[〈tens〉]...<br />

These modifying macros all turn an open path into a closed one. If the path is already closed,<br />

they do nothing.<br />

\lclosed makes an open path into a closed path by adding a line segment between the endpoints<br />

of the path. In the special case where the path ends exactly where it begins, all \lclosed does is<br />

change the type of the path from open to closed.<br />

The \bclosed macro is similar to \lclosed, except that it closes an open path smoothly by<br />

drawing a Bézier curve. A Bézier is METAFONT’s natural way of connecting points into a curve, and<br />

\bclosed is the simplest and most efficient closure next to \lclosed. Moreover it usually gives a<br />

reasonably aesthetic result. Sometimes, however, one might wish a tighter connection. If that is the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!