%%% %%% File: mfpicdoc.tex %%% \magnification=\magstep1 \input header % HEADING: \centerline {\bf Pictures in \TeX\ with \MF} \centerline {\prog {mfpic.tex} Version: 0.2.10.8 alfa} \centerline {Program Date: Tue 28 May 1996} \centerline {Principal Author: Dr Thomas E.~Leathrum} \centerline {Alfatest version by: Geoffrey Tobin (\mail {G.Tobin@latrobe.edu.au})} \centerline {Document Date: Tue 28 May 1996} \head {WHY?} \vskip\myskip\nobreak Tom got the idea for \prog {mfpic} mostly out of a feeling of frustration. Different output mechanisms for printing or viewing \TeX\ DVI files each have their own ways to include pictures. More often than not, there are provisions for including \PS\ data into a DVI file using \TeX\ \macro {special}'s. However, this technique seems far from \TeX's ideal of device-independence, and besides, different \TeX\ output drivers handle these \macro {special}'s in different ways. The same problems arise with including \prog {tpic} \macro {special}'s. \LaTeX's \env {picture} environment has a hopelessly limited supply of available objects to draw---if you want to draw a graph of a polynomial curve, you're out of luck. There is, of course, \PiCTeX, which is wonderfully flexible and general, but its most obvious feature is its speed---or rather lack of it. Processing a single picture in \PiCTeX\ can often take several minutes. It occurred to Tom that it might be possible to take advantage of the fact that \MF\ is {\it designed} for drawing things. The result of pursuing this idea is \prog {mfpic}, a set of macros for \TeX\ and \MF\ which incorporate \MF-drawn pictures into a \TeX\ file. The nature of the macros, from the user's point of view, is very much like \PiCTeX. We do not pretend that \prog {mfpic} has anything like the scope of \PiCTeX, but it should suit most purposes for drawing small graphs and including them in your \TeX\ documents. \head {AUTHOR.} \vskip\myskip\nobreak \prog {mfpic} was written primarily by Tom Leathrum (\mail{moth@bluejay.atl.ga.us}) during the late (northern hemisphere) spring and summer of 1992, while at Dartmouth College. Different versions were being written and tested for nearly two years after that, during which time Tom finished his Ph.D.\ and took a job at Berry College, in Rome, GA. Between fall of 1992 and fall of 1993, much of the development was carried out by others. Those who helped most in this process are credited in the Acknowledgements. \head {MANIFEST.} \vskip\myskip\nobreak Eighteen files are included in this \prog {mfpic} alfa test distribution: \vskip\myskip\nobreak \halign{\indent#\hfil&\quad#\hfil\cr \file {Acknowl.tex} & Some people whose work has helped \prog {mfpic} \cr \file {CHANGES.tex} & History of changes to \prog {mfpic} \cr \file {CTAN.sites} & A list of CTAN sites, mirrors and shadows \cr \file {MANIFEST} & List of these files, with sizes and dates \cr \file {Makefile.dist} & Distribution Makefile \cr \file {NOTE} & Some concerns \cr \file {README2} & An overview of this distribution \cr \file {grafbase.mf} & The \MF\ macros \cr \file {grafdoc.tex} & Plain \TeX documentation for \file {grafbase.mf} \cr \file {header.tex} & Definitions used in the documentation files \cr \file {lapictures.tex} & A \LaTeX2e version of \file {pictures.tex} \cr \file {mf-revu.tex} & A sketchy review of \MF{} programming \cr \file {mfpic.tex} & The \TeX\ macros \cr \file {mfpic-IS.gt} & Brief explanation of what MFpic is and does \cr \file {mfpicdoc.tex} & This document, processable in plain \TeX \cr \file {objects.tex} & Contains at least one picture of each object \cr \file {pictures.tex} & A few more complicated pictures \cr \file {skip-pix.tex} & Tests effect of \TeX's \macro {leftskip} \cr } \vskip\myskip\nobreak Information on how to set up a few specific configurations of computers, and some contributed code and \MF{} documentation, are separately available. \head {SETTING UP and PROCESSING.} \vskip\myskip\nobreak Setting up \TeX\ and \MF\ to process these files will, to an extent, depend on your local installation. The biggest problem you are likely to have, regardless of your installation, will be convincing \TeX\ and its output drivers to find \MF's output files. To process the sample file, first run \TeX\ on the sample file \file {pictures.tex}. \TeX\ will complain that it can't find the file \file {pics.tfm}, but will continue processing the file anyway. When the file is finished processing, you will now have a file called \file {pics.mf}. This is the \MF\ file containing the descriptions of the pictures for \file {pictures.tex}. You need to run \MF\ on \file {pics.mf}, with \macro {mode=localfont} set up. (Read your \MF\ manual to see how to do this.) Now that you have the font and font metric files generated by \MF, reprocess the file \file {pictures.tex} with \TeX. The resulting DVI file should now be complete, and you should be able to print and view it at your computer (assuming your viewer and print driver have been set up to be able to find the font generated by \file {pics.mf}). These three steps of processing---processing with \TeX, processing with \MF, and reprocessing with \TeX{}---may not always be necessary. In particular, if you change the TeX document without making any changes at all to the pictures, then there will be no need to repeat either of the last two steps. There is also a somewhat subtle circumstance under which you can skip the third step---if you change the picture in such a way as {\it not} to affect the font metric file, then you do not have to reprocess with \TeX, because the original metric used for the first step will put the pictures in the right places. The only \prog {mfpic} macros that affect the font metric file are the macros listed in the {\sl Files and Environments} section below. \head {HOW IT WORKS.} \vskip\myskip\nobreak When you run \TeX\ on the file \file {pictures.tex}, \TeX\ generates a file \file {pics.mf}. This file is formed by \macro {write} commands in the \file {mfpic} macros. The user should never have to read or change the file \file {pics.mf} directly---the \prog {mfpic} macros take care of it. Be prepared for overfull hboxes, due to the fact that in \file {pictures.tex} the diagrams' \macro {tcaption}'s are deliberately too wide for the specified widths of the \macro {mfpic} pictures. The user familiar with \MF\ will notice, by looking at the \prog {mfpic} macros, that the \prog {mfpic} drawing macros translate almost directly into simple \MF\ \mfc{draw} commands. The \macro {tlabel}'s and \macro {tcaption}'s, however, are placed on the graph by \TeX, not \MF. Multiline tlabels may be specified by explicit line breaks, which are indicated by the {\bsl\bsl} command. \head {THE MACROS.} \head {Beware!} Due to the current method by which line breaks in the \TeX{} file are preserved in the \MF{} file, it is necessary to commence the argument of a command on the same line as the command, for example THIS works: \par\indent \macro {cyclic} \{ point1, point2 \} \par\noindent AS does this: \par\indent \macro {cyclic} \{ point1, \par\indent \hskip 1cm point2 \} \par\noindent AND this: \par\indent \macro {cyclic} \{ \par\indent \hskip 1cm point1, \par\indent \hskip 1cm point2 \} \par\noindent BUT this does NOT (it causes the whole argument to be omitted from the \MF{} file) : \par\indent \macro {cyclic} \par\indent \hskip 1cm \{ point1, \par\indent \hskip 1cm point2 \} \par\noindent \head {Files and Environments.} \vskip\myskip\nobreak \noindent \macro {opengraphsfile}[\]% $\ldots$\macro {closegraphsfile} \nobreak These macros open and close the \MF{} file which will contain the pictures to be included in this document. The name of the file will be \file {\.mf}. If the \ parameter is changed, you will have to reprocess the \TeX\ file after processing \file {\.mf}. \vskip\myskip \noindent \macro {mfpic}[?\][?\]% [\][\][\][\]% $\ldots$\macro {endmfpic} \nobreak These macros open and close the \env{mfpic} environment in which the rest of the macros below make sense. The \macro {mfpic} macro also sets up the local coordinate system for the picture. The \ and \ parameters establish the length of a coordinate system unit, as a multiple of the \TeX\ dimension \macro {mfpicunit}. At least one scale parameter must be specified, but if only one is specified, then they are assumed to be equal. The \ and \ parameters establish the lower and upper (resp.) bounds for the $x$-axis coordinates; similarly, \ and \ establish the bounds for the $y$-axis. These bounds are expressed in local units---in other words, the actual width of the picture will be (\$-$\)$\cdot$\ times \macro {mfpicunit}, its height (\$-$\)$\cdot$\ times \macro {mfpicunit}, and its depth zero. These scales and bounds are used primarily to establish the metric for the character containing the picture described within the environment. If any of these parameters are changed, the \file {\.tfm} file will be affected, so you will have to reprocess the \TeX\ file after processing \file {\.mf}. \head {Using \prog {mfpic} with \LaTeX.} \vskip\myskip\nobreak In \LaTeX, instead of using the \macro {mfpic} and \macro {endmfpic} macros, you may prefer to use \macro {begin}[mfpic] and \macro {end}[mfpic]. Due to the way that \LaTeX\ has been designed, \macro {begin}[command] effectively means \macro {command}, and \macro {end}[command] effectively means \macro {endcommand}, for any \TeX\ command. \vskip\myskip A \LaTeX\ version of the sample file, \file {lapictures.tex}, has also been provided. Be prepared for overfull hboxes, due to the fact that the diagrams' \macro {tcaption}'s are deliberately too wide for the specified widths of the \macro {mfpic} pictures. \vskip\myskip Note that the \macro {opengraphsfile} and \macro {closegraphsfile} macros should be used under those names in \LaTeX\ too, as they do not quite possess a \macro {command}$\ldots$\macro {endcommand} structure. \vskip\myskip This version of \prog {mfpic} should be compatible with the LaTeX \env {center} environment. \vskip 2\myskip The rest of the \prog {mfpic} macros do not affect the font metric file (\file {\.tfm}), and so if these commands are changed or added in your document, you will not have to repeat the third step of processing (reprocessing with \TeX) to complete your \TeX\ document. \vskip\myskip For the remainder of the macros, the numerical parameters are expressed in the units of the local coordinate system specified by \macro {mfpic}, unless otherwise indicated. \head {Figures.} \subhead{\MF{} Pairs.} \vskip\myskip\nobreak Since many of the arguments of the \prog {mfpic} drawing commands are sent to \MF{} to be interpreted, it's useful to know something about \MF{} concepts. In particular, \MF{} has \mfc{pair} objects, which may be constants or variables. Pair constants have the form \mfc{($x$,$y$)}. Pairs are two-dimensional rectangular (cartesian) quantities, and are clearly useful for representing both points and vectors on the plane. To shorten the descriptions of \prog {mfpic} macros, we herein often represent each pair by a brief name, such as $p$, $v$ or $c$, the meanings of which are usually obvious in the context of the macro. The succinctness of this notation also helps us to think geometrically rather than only of coordinates. \subhead{Points, Lines, and Rectangles.} \vskip\myskip\nobreak \noindent \macro {point}% [?\] [\<$p_0$\>,\<$p_1$\>,$\ldots$] \nobreak Draws small disks centered at the points \<$p_0$\>, \<$p_1$\>, and so on. If the optional argument \ is present, it determines the diameter of the disks, which otherwise equals the \TeX\ dimension \macro {pointsize}. The default value of \macro {pointsize} is 2~points. The disks have a filled interior if \macro {pointfilled} is true, otherwise their interior is erased. \vskip\myskip \noindent \macro {polyline}% [\<$p_0$\>,\<$p_1$\>,$\ldots$] \noindent \macro {lines}% [\<$p_0$\>,\<$p_1$\>,$\ldots$] \nobreak Draws the line segment with endpoints at \<$p_0$\> and \<$p_1$\>, then the line segment with endpoints at \<$p_1$\> and \<$p_2$\>, etc. The result is an open polygonal path through the specified points, in the specified order. \vskip\myskip \noindent \macro {polygon}% [\<$p_0$\>,\<$p_1$\>,$\ldots$] Draws a closed polygon with vertices at the specified points. \vskip\myskip\nobreak \noindent \macro {rect}[\<$p_0$\>,\<$p_1$\>] \nobreak Draws the rectangle specified by the points \<$p_0$\> and \<$p_1$\>, these being any two opposite corners of the rectangle. \subhead{Axes and Axis Marks.} \vskip\myskip\nobreak \noindent \macro {axes} \nobreak Draws the $x$ and $y$ axes for the coordinate system. The axes extend the full width and height of the \env{mfpic} environment. The length of the arrowhead on each axis is determined by the \TeX\ dimension \macro {axisheadlen}. The default value of \macro {axisheadlen} is 5~points. The shape of the arrowhead is determined as in the {\tt\string\arrow} macro. \vskip\myskip \noindent \macro {xmarks}[\<$x_0$\>,\<$x_1$\>,$\ldots$] and \macro {ymarks}[\<$y_0$\>,\<$y_1$\>,$\ldots$] \nobreak These macros place hash marks on the $x$ and $y$ axes (resp.) at the places indicated by the values in the list. The length of the hash marks is determined by the \TeX\ dimension \macro {hashlen}. The default value of \macro {hashlen} is 4~points. \subhead{Circles and Ellipses.} \vskip\myskip\nobreak \noindent \macro {circle}[\<$c$\>,\<$r$\>] \nobreak Draws a circle centered at the point \<$c$\> and with radius \<$r$\>. \vskip\myskip \noindent \macro {ellipse}[?\<$\theta$\>]% [\<$c$\>,\<$r_x$\>,\<$r_y$\>] \nobreak Draws an ellipse with the $x$ radius \<$r_x$\> and $y$ radius \<$r_y$\>, centered at the point \<$c$\>. The optional parameter \<$\theta$\>\ provides a way of rotating the ellipse by \<$\theta$\>\ degrees counterclockwise around its center. \subhead{Curves.} \vskip\myskip\nobreak \noindent \macro {curve}% [\<$p_0$\>,\<$p_1$\>,$\ldots$] \nobreak Draws a \MF\ B\'ezier path through the specified points, in the specified order. \vskip\myskip \noindent \macro {cyclic}% [\<$p_0$\>,\<$p_1$\>,$\ldots$] \nobreak Draws a cyclic (i.e., closed) \MF\ B\'ezier curve through the specified points, in the specified order. \subhead{Circular Arcs.} \vskip\myskip\nobreak \noindent \macro {arc}[?\][$\ldots$] \nobreak Draws a circular arc specified as determined by the \ optional parameter---this macro is unusual in that the optional \ parameter determines the format of the other parameter, as indicated below: \vskip\myskip \noindent \macro {arc}[?s]% [\<$p_0$\>,\<$p_1$\>,\] \nobreak ({\it Point-Sweep Form ---this is the default format.}) Draws a circular arc starting from the point \<$p_0$\>, ending at the point \<$p_1$\>, and covering an arc angle of \ degrees, measured counterclockwise around the center of the circle. If, for example, the points \<$p_0$\> and \<$p_1$\> lie on a horizontal line with \<$p_0$\> to the left, and \ is between 0~and 180 (degrees), then the center of the circle will be above the horizontal line (in order for the angle to be counterclockwise). Negative values of \ give arcs curving in the other direction. \vskip\myskip \noindent \macro {arc}[?t]% [\<$p_0$\>,\<$p_1$\>,\<$p_2$\>] \nobreak ({\it Three-Point Form.}) Draws the circular arc which passes through all three points given. \vskip\myskip \noindent \macro {arc}[?p]% [\<$c$\>,\<$r$\>,\<$\theta_1$\>,\<$\theta_2$\>] \nobreak ({\it Polar Form.}) Draws the circular arc with center \<$c$\> and radius \<$r$\>, starting at the angle \<$\theta_1$\> and ending at the angle \<$\theta_2$\>, where both angles are measured counterclockwise from the positive $x$ axis. \vskip\myskip \noindent \macro {arc}[?c]% [\<$c$\>,\<$p_1$\>,\<$\theta$\>] \nobreak ({\it Center-Point Form.}) Draws the circular arc with center \<$c$\>, starting at the point \<$p_1$\>, and sweeping an angle of \<$\theta$\> around the center from that point. (This is actually \prog {mfpic}'s internal way of handling arcs---all other formats are translated to this format before drawing.) \subhead{Polar Coordinates.} \vskip\myskip\nobreak \noindent \macro {plr}% [(\<$r_0$\>,\<$\theta_0$\>), (\<$r_1$\>,\<$\theta_1$\>), $\ldots$] \nobreak Replaces the specified list of polar coordinate pairs by the equivalent list of rectangular (cartesian) coordinate pairs. Through \macro {plr}, commands designed for rectangular coordinates can be applied to data represented in polar coordinates---and to data containing both rectangular and polar coordinate pairs. \subhead{Other Figures.} \vskip\myskip\nobreak \noindent \macro {turtle}% [\<$p_0$\>,\<$v_1$\>,\<$v_2$\>,$\ldots$] \nobreak Draws a line segment, starting from the point \<$p_0$\>, and extending along the (2-dimensional vector) displacement \<$v_1$\>. It then draws a line segment from the previous segment's endpoint, along displacement \<$v_2$\>. This process continues for all listed displacements, similarly to ``turtle graphics''. \vskip\myskip \noindent \macro {sector}% [\<$c$\>,\<$r$\>,\<$\theta_1$\>,\<$\theta_2$\>] \nobreak Draws the sector, from the angle \<$\theta_1$\> to the angle \<$\theta_2$\> inside the circle with center at the point \<$c$\> and radius \<$r$\>, where both angles are measured in degrees counterclockwise from the direction parallel to the $x$ axis. The sector forms a closed path. \head {Shape-Modifier Macros.} \vskip\myskip\nobreak Some \prog {mfpic} macros operate as {\it shape-modifier} macros---for example, if you want to put an arrowhead on a line segment, you could write: \{\macro {arrow}\macro {lines}[(0,0),(1,0)]\}. The example illustrates two modifiers that are {\it switches}; these apply from when they are used until the end of the innermost enclosing TeX scope. All but one of the \prog {mfpic} modifier macros are described here. For the purposes of these macros, a distinction must be made in the figure macros between ``open'' and ``closed'' paths. Note that a path that merely returns to its starting point is {\it not} automatically closed; such a path is open, and must be explicitly closed, for example by \macro {closed} (see below). (On the \MF{} level, path closure is achieved by some variant of \mfc{ ..cycle}). The (already) closed paths are: \macro {rect}, \macro {circle}, \macro {ellipse}, \macro {cyclic}, \macro {plrregion} and \macro {btwnfcn} (below). \subhead{Closure of Paths.} \vskip\myskip\nobreak \noindent \macro {lclosed} \nobreak Makes each open path into a closed path by adding a line segment between the endpoints of the path. \vskip\myskip \noindent \macro {bclosed} \hfil\break \noindent \macro {sclosed} \hfil\break \noindent \macro {cbclosed} \nobreak These macros are similar to \macro {lclosed}, except that they close each open path by drawing a B\'ezier, or a smooth curve (as in the smooth case in the \macro {curve} macro), or a cubic B-spline, respectively, between the path's endpoints. \subhead{Reversal, Accumulation and Connection of Paths.} \vskip\myskip\nobreak \noindent \macro {reverse}$\ldots$ \nobreak Turns a path around, reversing its orientation. This will affect both the direction of arrows (e.g.\ bi-directional arrows can be coded with \macro {arrow}\macro {reverse}\macro {arrow}$\ldots$ ---here the first \macro {arrow} modifier applies to the {\it reversed} path), and the order of endpoints for a \macro {connect}$\ldots$\macro {endconnect} environment (below). \vskip\myskip \noindent \macro {patharr}[\]$\ldots$\macro {endpatharr} \nobreak This pair of macros, acting as an environment, accumulate all enclosing paths, in order, into a path array named \. {\it Note:} In \LaTeX, this pair of macros can be used in the form of a \LaTeX-style environment called \env {patharr} ---as in \macro {begin}[patharr]$\ldots$\macro {end}[patharr]. \vskip\myskip \noindent \macro {connect}$\ldots$\macro {endconnect} \nobreak This pair of macros, acting as an environment, add line segments from the trailing endpoint of one open path to the leading endpoint of the next path, in the given order. The result is a connected, {\it open} path. {\it Note~1:} \macro {connect} and \macro {endconnect} are jointly implemented using the the \env{patharr} environment with a \MF{} path array named `\mfc{nexus}'. {\it Note~2:} In \LaTeX, this pair of macros canbe used in the form of a \LaTeX-style environment called \env{connect} --- as in \macro {begin}[connect]$\ldots$\macro {end}[connect]. \subhead{Drawing.} \vskip\myskip\nobreak \noindent \macro {draw}$\ldots$ \nobreak Draws the subsequent path using a solid outline. When \prog {mfpic} is loaded, this is the initial way in which a path is rendered by default, if no rendering prefix is given. (See the description of \macro {setrender} below.) \vskip\myskip \noindent\macro {dashed}$\ldots$ \nobreak Draws dashed segments along the path specified in the next command. The length of the dashes is the value of the \TeX\ dimension \macro {dashlen}. The space between the dashes is the value of the \TeX\ dimension \macro {dashspace}. Adjusts the space between the dashes by as much as ${dashspace}\over{n}$, where $n$ is the number of spaces appearing in the curve, in order to have the proper dashes at the ends. The dashes at the ends are half of \macro {dashlen} long. \vskip\myskip \noindent\macro {dotted}$\ldots$ \nobreak Draws dots along the specified path. The size of the dots is the value of the \TeX\ dimension \macro {dotsize}. The space between the dots is the value of the \TeX\ dimension \macro {dotspace}. \subhead{Arrows.} \vskip\myskip\nobreak \noindent \macro {arrow}% [?l\][?r\][?b\]$\ldots$ \nobreak Draws an arrowhead at the endpoint of the open path (or at the last key point of the closed path) that follows. The optional parameter \ determines the length of the arrowhead. The default is the value of the \TeX\ dimension \macro {headlen}. The optional parameter \ allows the arrowhead to be rotated counterclockwise around its point an angle of \ degrees. The default is 0~degrees. The optional parameter \ allows the arrowhead to be ``set back'' from its original point, thus allowing e.g.\ double arrowheads. This parameter is in the form of a \TeX\ dimension---its default value is 0~points. If an arrowhead is both rotated and set back, the rotation affects the direction in which the arrowhead is set back. The optional parameters may appear in any order, but the indicated key character for each parameter must always appear. \subhead{Shading, Filling, Erasing, Hatching.} \vskip\myskip\nobreak The shading macros can all be used to shade the interior of closed paths, even if the paths cross themselves. Shading an open curve is technically an error, but the \MF\ code in \file {grafbase.mf} responds by drawing the path and not doing any filling. \vskip\myskip \noindent \macro {gfill}$\ldots$ \nobreak Fills in the subsequent closed path. \vskip\myskip \noindent \macro {gclear}$\ldots$ \nobreak Erases everything inside the subsequent closed path. \vskip\myskip \noindent \macro {shade}[?\]$\ldots$ \nobreak Shades the interior of the subsequent closed path with dots. The diameter of the dots is set by the macro \macro {shadewd}. The optional argument specifies the space between dots, which defaults to the \TeX\ dimension \macro {shadespace}. If \macro {shadespace} is 0~points (or less), the closed path is filled, as with \macro {gfill}. \vskip\myskip \noindent \macro {thatch}[?\,\]$\ldots$ \nobreak Shades a closed path using lines at the specified angle. The thickness of the lines is set by the macro \macro {hatchwd}. In the optional argument, \ specifies the space between lines, which defaults to the \TeX\ dimension \macro {hatchspace}. If \macro {hatchspace} is 0~points (or less), the closed path is filled, as with \macro {gfill}. The \ defaults to 0~degrees. Either both optional arguments must be present, or both must be absent. \vskip\myskip \noindent \macro {lhatch}[?\]$\ldots$ \nobreak Draws lines shading in the subsequent closed path in a ``left-oblique hatched'' (upper left to lower right) pattern. The thickness of the lines is set by the macro \macro {hatchwd}. The optional \ argument is as in \macro {thatch}. \vskip\myskip \noindent \macro {rhatch}[?\]$\ldots$ \nobreak Draws lines shading in the subsequent closed path in a ``right-oblique hatched'' (lower left to upper right) pattern. The thickness of the lines is set by the macro \macro {hatchwd}. The optional \ argument is as in \macro {thatch}. \vskip\myskip \noindent \macro {hatch}[?\]$\ldots$ \hfil\break \noindent \macro {xhatch}[?\]$\ldots$ \nobreak Draws lines shading in the subsequent closed path in a ``cross-hatched'' pattern. The thickness of the lines is set by the macro \macro {hatchwd}. The optional \ argument is as in \macro {thatch}. \subhead{Changing the Default Rendering.} \vskip\myskip\nobreak {\it Rendering} is the process of converting a geometric description into a drawing. In \MF{}, this means producing a bitmap (\MF{} calls this a \mfc{picture}), either by stroking (drawing) a path using a particular pen), or by filling a closed path. \vskip\myskip \noindent \macro {setrender}[\<\TeX{} commands\>] \nobreak Initially, \prog {mfpic} uses the \macro {draw} command (stroking) as the default operation when a figure is to be rendered. However, this can be changed to any combination of (rendering and/or other!) \TeX{} commands, by using the \macro {setrender} command. This is a local redefinition, so it can be enclosed in braces to restrict its range. \subhead{Examples.} \vskip\myskip\nobreak It may be instructive, for the purpose of seeing how the syntax of {\it shape-modifier switches} works, to consider two examples: {\obeylines\obeyspaces \{\macro {shade}\macro {draw}\macro {lclosed}\macro {lines}[...]\} } \noindent which shades inside a polygon and draws its outline; and {\obeylines\obeyspaces \{\macro {shade}\macro {lclosed}\macro {draw}\macro {lines}[...]\} } \noindent which shades inside the polygon, and draws all of the outline {\it except} the line segment supplied by \macro {lclosed}. \head {Affine Transforms.} \vskip\myskip\nobreak Coordinate transformations that keep parallel lines in parallel are called {\bf affine transforms}. These include translation, rotation, reflection, scaling and skewing (slanting). For the \MF{} coordinate system only---that is, for paths, but not for \macro {tlabel}'s (let alone \macro {tcaption}'s)---\prog {mfpic} provides the ability to apply \MF{} affine transforms. Transforms can be localised to any group of \MF{} paths (this is implemented using a \MF{} path array, \mfc{paths}). \subhead{Rotation of Paths.} \vskip\myskip\nobreak \noindent \macro {rotatepath}[(\<$x$\>,\<$y$\>),\<$\theta$\>] \nobreak Rotates the following path by \<$\theta$\> degrees about point \mfc{(\<$x$\>,\<$y$\>)}. \subhead{Affine Transforms of the \MF{} Coordinate System.} \vskip\myskip\nobreak \noindent \macro {coords}$\ldots$\macro {endcoords} \nobreak All affine transforms are restricted to the innermost enclosing \macro {coords}$\ldots$\macro {endcoords} pair. If there is {\it no} such enclosure, then the transforms will apply globally, and {\it even across \env{mfpic} environments}, so be careful to remember to enclose transforms! {\it Note:} In \LaTeX, a \env{coords} environment may be used. \vskip\myskip\nobreak \noindent \macro {applyT}[\] \nobreak Apply the \MF{} \ to the current coordinate system. For example, the \prog {mfpic} \TeX{} macro \macro {zslant\#1} is implemented as \macro {applyT}[zslanted \#1] where the argument \mfc{\#1} is a \MF{} pair, such as $(x,y)$. \vskip\myskip\nobreak Transforms provided by \prog {mfpic}. \vskip\myskip\nobreak \halign {\noindent#\hfil&\quad#\hfil\cr \macro {rotate}[$\theta$] & Rotates around origin by $\theta$ degrees \cr \macro {rotatearound}[$p$][$\theta$] & Rotates around point $p$ by $\theta$ degrees \cr \macro {turn}[?$p$][$\theta$] & Rotates around point $p$ (origin is default) by $\theta$ degrees \cr \macro {mirror}[$p_1$][$p_2$] \cr \macro {reflectabout}[$p_1$][$p_2$] & Reflects about the line $p_1 \ldots p_2$ \cr \macro {shift}[$p$] & Shifts origin by the vector $p$ \cr \macro {scale}[$s$] & Scales uniformly by a factor of $s$ \cr \macro {xscale}[$s$] & Scales only X by a factor of $s$ \cr \macro {yscale}[$s$] & Scales only Y by a factor of $s$ \cr \macro {zscale}[$p$] & Scales uniformly by magnitude of $p$, and rotates by angle of $p$ \cr \macro {xslant}[$s$] & Skew in $X$ direction by the multiple $s$ of $Y$ \cr \macro {yslant}[$s$] & Skew in $Y$ direction by the multiple $s$ of $X$ \cr \macro {zslant}[$s$] & See \mfc{zslanted} in \file {grafdoc.tex} \cr \macro {boost}[$\chi$] & Special relativity boost by $\chi$ \cr \macro {xyswap} & Reflects in the line $Y=X$ \cr } \head {Functions and Plotting.} \vskip\myskip\nobreak \noindent \macro {fdef}[\]% (\,\,$\ldots$)% [\] \nobreak Defines a \MF\ function \ of the parameters \, \, $\ldots$, by the \MF\ expression \ in which the only free parameters are those named. The return type of the function is the same as the type of the expression. The expression \ is passed directly into the corresponding \MF\ macro and interpreted there, so \MF's rules for algebraic expressions apply. Operations available include \mfc{+}, \mfc{-}, \mfc{*}, \mfc{/}, and \mfc{**} (\mfc{x**y}$=x^y$), with \mfc{(} and \mfc{)} for grouping. Functions available include \mfc{round}, \mfc{floor}, \mfc{ceiling}, \mfc{abs}, \mfc{sqrt}, \mfc{sind}, \mfc{cosd}, \mfc{mlog}, and \mfc{mexp}. ({\it Notes:} The \MF{} trigonometric functions \mfc{sind} and \mfc{cosd} take arguments in degrees; \mfc{mlog(x)}$=256\ln x$, and \mfc{mexp} is its inverse. There are other operations and functions available, but these are the most useful for plotting purposes.) You can also define the function \ by cases, using the \MF{} conditional expression \hfil\break\indent \quad \mfc{if~\:~\~else:~\~fi}. \hfil\break\noindent Relations available for the \ part of the expression include \mfc{=}, \mfc{<}, \mfc{>}, \mfc{<=}, and \mfc{>=}. Complicated functions can be defined by a compound expression, which is a series of \MF\ statements, followed by an expression, all enclosed in the \MF\ commands \mfc{begingroup} and \mfc{endgroup}. \MF\ functions can call \MF\ functions, recursively. \vskip\myskip\nobreak The plotting macros take two or more arguments. They have an optional first argument, \, which determines whether a function is drawn smooth (as a \MF\ B\'ezier curve), or polygonal (as line segments)---% if \ is {\tt s} , the function will be smooth; if \ is {\tt p}, the function will be polygonal; the default \ depends on the purpose of the macro. One compulsory argument contains three values \, \ and \. The independent variable of a function starts at the value \ and steps by \ until reaching \. There are one or more subsequent arguments, denoted \, each of which is a \MF\ function. \vskip\myskip\nobreak \noindent \macro {function}[?\]% [\,\,\]% [\] \nobreak Plots \, a \MF\ numeric function of one numeric argument. The default value for the optional parameter \ is {\tt s}. \vskip\myskip \noindent \macro {parafcn}[?\]% [\,\,\]% [\] \nobreak Plots the parametric path determined by $(x(t),y(t))=${\tt \}, where \ is a \MF\ function of one numeric argument, returning a \MF\ {\it pair} (such as $(x,y)$). The default value for the optional parameter \ is {\tt s}. \vskip\myskip \noindent \macro {plrfcn}[?\]% [\<\TH{min}\>,\<\TH{max}\>,\<\TH{step}\>]% [\] \nobreak Plots the polar function determined by $r=$\($\theta$), where \ is a \MF\ numeric function of one numeric argument, and $\theta$ varies from \<\TH{min}\> to \<\TH{max}\> in steps of \<\TH{step}\>. Each $\theta$ value is interpreted as an angle measured in {\it degrees}. The default value for the optional parameter \ is {\tt s}. \vskip\myskip \noindent \macro {btwnfcn}[?\]% [\,\,\]% [\][\] \nobreak Draws the region between the two \MF\ functions \ and \, these being numeric functions of one numeric argument. The region is bounded also by the vertical lines at \ and \. Unlike the previous function macros, the default value for \ is {\tt p} ---this macro is intended to be used for shading between functions, a task for which smoothness is usually unnecessary. \vskip\myskip \noindent \macro {plrregion}[?\]% [\<\TH{min}\>,\<\TH{max}\>,\<\TH{step}\>]% [\] \nobreak Plots the polar region determined by $r=$\($\theta$), where \ is a \MF\ numeric function of one numeric argument. The $\theta$ values are angles (measured in {\it degrees}), varying from \<\TH{min}\> to \<\TH{max}\> in steps of \<\TH{step}\>. The region is also bounded by the angles \<\TH{min}\> and \<\TH{max}\>, i.e.\ by the line segments joining the origin to the endpoints of the function. The default value for \ is {\tt p} ---this macro is intended to be used for shading the region, a task for which smoothness is usually unnecessary. \head {Labels and Captions.} \vskip\myskip\nobreak The next two macros do not affect the \MF\ file (\file {\.mf}) at all, but are added to the picture by \TeX. Therefore, if these macros are changed or added in your document, there is no need to repeat either of the last two steps (processing with \MF\ or reprocessing with \TeX) in order to complete your \TeX\ document. \vskip\myskip \noindent \macro {tlabel}[?\]{\tt(\,\)% \string{\