summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/base/source/mpman.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/metapost/base/source/mpman.tex')
-rw-r--r--Master/texmf-dist/doc/metapost/base/source/mpman.tex557
1 files changed, 136 insertions, 421 deletions
diff --git a/Master/texmf-dist/doc/metapost/base/source/mpman.tex b/Master/texmf-dist/doc/metapost/base/source/mpman.tex
index c62e95f1a05..a7ddc926588 100644
--- a/Master/texmf-dist/doc/metapost/base/source/mpman.tex
+++ b/Master/texmf-dist/doc/metapost/base/source/mpman.tex
@@ -1,4 +1,4 @@
-% $Id: mpman.tex 458 2008-04-03 21:56:20Z stephanhennig $
+% $Id: mpman.tex 513 2008-04-29 12:03:53Z stephanhennig $
% MetaPost manual, by John Hobby. License at end.
\listfiles
\RequirePackage{ifpdf}
@@ -12,7 +12,8 @@
\fi
\documentclass{article} % article is NOT the original style
\usepackage[nofancy]{svninfo}% Access VCS information.
-\svnInfo $Id: mpman.tex 458 2008-04-03 21:56:20Z stephanhennig $
+\svnInfo $Id: mpman.tex 513 2008-04-29 12:03:53Z stephanhennig $
+\newcommand*{\mpversion}{1.004}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
@@ -41,7 +42,6 @@
\newcommand\tdescr[1]{$\langle$\invisgap#1\invisgap$\rangle$}
\newcommand\pl{\dag}
-\newcommand\bx{$*$}
\newcommand\mathcenter[1]{\vcenter{\hbox{#1}}}
@@ -110,7 +110,7 @@
\vskip3bp
\centerline{and the MetaPost development team}
\vskip20.8bp% actually 31.8bp (-11bp)
- \centerline{\large documented version: 1.003}
+ \centerline{\large documented version: \mpversion}
\vskip3bp
\centerline{\svnToday}
\vfil
@@ -184,8 +184,8 @@ fi
\end{verbatim}
$$
prints
-$$\begin{verbatim}
-mp = 1.003
+$$\begin{verbatim}[commandchars=\\\{\}]
+mp = \mpversion
\end{verbatim}
$$
The {\tt scantokens} command is described on p.~\pageref{Dscantokens}
@@ -208,6 +208,10 @@ identical to Knuth's \MF, the appendix gives a detailed comparison so
that advanced users can learn more about MetaPost by reading {\sl The
\MF book\/} \cite{kn:c}.
+MetaPost documentation is completed by ``Drawing Boxes with MetaPost''
+and ``Drawing Graphs with MetaPost''---the manuals of the \texttt{boxes}
+and \texttt{graph} packages originally developed by John~D. Hobby.
+
The MetaPost home page is \url{http://tug.org/metapost}. It has links
to much additional information, including many articles that have been
written about MetaPost. For general help, try the
@@ -558,16 +562,20 @@ sequences are possible, see table~\ref{tab:fntmpl} for details.
\def\d{$\langle$0-9$\rangle$}
\begin{table}
-\begin{center}\begin{tabular}{>{\ttfamily}ll}
+\centering
+\begin{tabular}{|>{\ttfamily}l|l|}
+\hline
+\multicolumn1{|c|}{Escape sequence} & \multicolumn1{c|}{Meaning}\\\hline
\%\% & A percent sign \\
-\%\,j & The current jobname\\
+\%j & The current jobname\\
\%\d c & The charcode value\\
\%\d y & The current year\\
\%\d m & The numeric month\\
\%\d d & The day of the month\\
\%\d H & The hour\\
-\%\d M & The minute\\
-\end{tabular}\end{center}
+\%\d M & The minute\\
+\hline
+\end{tabular}
\caption{Allowed escape sequences for \ttt{filenametemplate}}
\label{tab:fntmpl}
\end{table}
@@ -2049,7 +2057,7 @@ has the correct encoding internally, 8r.enc will not be embedded also.
The argument to both commands has an optional flag character at the very
beginning. This optional flag has the same meaning as in pdf\TeX:
$$\begin{tabular}{|c|l|} \hline
-\multicolumn1{|c|}{option}& \multicolumn1{c|}{meaning}\\ \hline
+\multicolumn1{|c|}{Option}& \multicolumn1{c|}{Meaning}\\ \hline
+ & extend the font list, but ignore duplicates \\
= & extend the font list, replacing duplicates \\
$-$ & remove all matching fonts from the font list \\
@@ -2210,8 +2218,8 @@ rainbow color. The $\descr{color expression}$ can have five possible
values, mapping to four possible color models:
$$
-\begin{tabular}{|l|l|}
-Actual input & Remapped meaning\\
+\begin{tabular}{ll}
+Actual input & Remapped meaning\\\hline
{\tt withcolor} $\descr{rgbcolor} c$ & withrgbcolor\index{withrgbcolor?\texttt{withrgbcolor}}\label{Dwithrgbcolor} $c$\\
{\tt withcolor} $\descr{cmykcolor} c$ & withcmykcolor\index{withcmykcolor?\texttt{withcmykcolor}}\label{Dwithcmykcolor} $c$\\
{\tt withcolor} $\descr{numeric} c$ & withgreyscale\index{withgreyscale?\texttt{withgreyscale}}\label{Dwithgreyscale} $c$\\
@@ -2244,15 +2252,22 @@ this model means that MetaPost will not write a color selection
statement to the PostScript output file for this object.
The `current default' color model can be set up using the internal
-parameter \ttindex{defaultcolormodel}. Valid values are:
-$$
-\begin{tabular}{|l|l|}
+variable \ttindex{defaultcolormodel}. Table~\ref{dfltcmod} lists the
+valid values.
+\begin{table}
+\centering
+\begin{tabular}{|c|l|}
+\hline
+Value & Color model\\\hline
1 & no model\\
3 & greyscale\\
5 & rgb (default)\\
7 & cmyk\\
+\hline
\end{tabular}
-$$
+\caption{Supported color models.}
+\label{dfltcmod}
+\end{table}
Figure~\ref{fig21} illustrates several applications of the fill command
@@ -3461,6 +3476,10 @@ values.
\subsection{Inspecting the Components of a Picture}
\label{piccomp}
+\mbox{}% Start paragraph here.
+\index{setbounds?\texttt{setbounds}|(}%
+\index{for within?\texttt{for within}|(}%
+%
MetaPost pictures are composed of stroked lines, filled outlines, pieces
of typeset text, clipping paths\index{clip?\texttt{clip}}, and
{\tt setbounds}\index{setbounds?\texttt{setbounds}} paths. (A {\tt setbounds}
@@ -3478,8 +3497,19 @@ applies to. Thus if a single clipping or {\tt setbounds} path applies to
everything in the \tdescr{picture expression}, the whole picture could be
thought of as one big component. In order to make the contents of such a picture
accessible, the {\tt for}\ldots{\tt within} iteration ignores the enclosing
-clipping or {\tt setbounds} path in this case.
-
+clipping or {\tt setbounds} path in this case. The number of components
+that a {\tt for}\ldots {\tt within} iteration would find is returned by
+$$ {\tt length}\ \descr{picture primary}\index{length?\texttt{length}}\label{DlengthPicture}$$
+
+\index{for within?\texttt{for within}|)}
+
+\mbox{}% Start paragraph here.
+\index{stroked?\texttt{stroked}|(}%
+\index{filled?\texttt{filled}|(}%
+\index{textual?\texttt{textual}|(}%
+\index{clipped?\texttt{clipped}|(}%
+\index{bounded?\texttt{bounded}|(}%
+%
Once the {\tt for}\ldots{\tt within} iteration has found a picture component,
there are numerous operators for identifying it and extracting relevant
information. The operator
@@ -3495,6 +3525,11 @@ path or a {\tt setbounds} path. This is true if the first component is
clipped or bounded or if the entire picture is enclosed in a clipping or
{\tt setbounds} path.
+\mbox{}% Start paragraph here.
+\index{pathpart?\texttt{pathpart}|(}%
+\index{penpart?\texttt{penpart}|(}%
+\index{dashpart?\texttt{dashpart}|(}%
+%
There are also numerous part extraction operators that test the first component
of a picture. If {\tt p} is a picture and {\tt stroked p} is true,
{\tt pathpart p}\index{pathpart?\texttt{pathpart}}\label{Dpathpart} is the
@@ -3516,25 +3551,47 @@ gives the font that was used, and {\tt xpart~p}\index{xpart?\texttt{xpart}}\inde
{\tt ypart~p}, {\tt xxpart~p}, {\tt xypart~p}, {\tt yxpart~p}, {\tt yypart~p}
tell how the text has been shifted, rotated, and scaled.
-Additionally, for \ttt{stroked}, \ttt{filled} and \ttt{textual}
-components the color can be inspected. The color model of a picture
-component can be requested by the
+\mbox{}% Start paragraph here.
+\index{colorpart?\texttt{colorpart}|(}%
+\index{colormodel?\texttt{colormodel}|(}%
+\index{redpart?\texttt{redpart}|(}%
+\index{greenpart?\texttt{greenpart}|(}%
+\index{bluepart?\texttt{bluepart}|(}%
+\index{cyanpart?\texttt{cyanpart}|(}%
+\index{magentapart?\texttt{magentapart}|(}%
+\index{yellowpart?\texttt{yellowpart}|(}%
+\index{blackpart?\texttt{blackpart}|(}%
+\index{greypart?\texttt{greypart}|(}%
+%
+Finally, for \ttt{stroked}, \ttt{filled} and \ttt{textual} components
+the color can be examined by saying
+$$ {\tt colorpart}\
+\descr{item}\index{colorpart?\texttt{colorpart}}\label{Dcolorpart}
+$$
+This returns the color of a component in its respective color model.
+The color model of a component can be identified by the
\ttt{colormodel}\index{colormodel?\texttt{colormodel}}\label{Dcolormodel}
-operator (see section~\ref{adv.gr}). Depending on the color model of
-a picture component \ttt{p} the color is
-$$ \hbox{\tt (redpart p, greenpart p, bluepart p)} $$%
-\index{redpart?\texttt{redpart}}\index{greenpart?\texttt{greenpart}}\index{bluepart?\texttt{bluepart}}
-for RGB colors or
+operator (cf. Table~\ref{dfltcmod} on p.~\pageref{dfltcmod}).
+
+For more fine grained color operations there are operators to extract
+single color components of an item. Depending on the color model the
+color of a picture component \ttt{p} is
$$ \hbox{\tt (cyanpart p, magentapart p, yellowpart p, blackpart p)} $$%
\index{cyanpart?\texttt{cyanpart}}\index{magentapart?\texttt{magentapart}}\index{yellowpart?\texttt{yellowpart}}\index{blackpart?\texttt{blackpart}}
-for CMYK colors or
-$$ \hbox{\tt (greypart p)} $$%
-\index{greypart?\texttt{greypart}} for grey scale colors.
-
-Applying a non-matching color part
-operator to a picture component triggers an error and returns a color
-part for the color \ttindex{black} in the requested color model.
-That is, for the code
+or
+$$ \hbox{\tt (redpart p, greenpart p, bluepart p)} $$%
+\index{redpart?\texttt{redpart}}\index{greenpart?\texttt{greenpart}}\index{bluepart?\texttt{bluepart}}
+or
+$$ \hbox{\tt greypart p} $$%
+\index{greypart?\texttt{greypart}}
+or
+$$ \hbox{\tt false}. $$
+
+Note, color part operators {\tt redpart}, {\tt cyanpart} etc. have to
+match the color model of the picture component in question. Applying a
+non-matching color part operator to a picture component triggers an
+error and returns a \ttindex{black} color part in the requested color
+model. That is, for the code
$$\begin{verbatim}
picture pic;
pic := image(fill unitsquare scaled 1cm withcolor (0.3, 0.6, 0.9););
@@ -3555,23 +3612,54 @@ $$\begin{verbatim}
\end{verbatim}
$$
since in grey scale color model black is {\tt 0} and in CMYK color model
-black is {\tt (0, 0, 0, 1)}. For the matching RGB color model the true
+black is {\tt (0,0,0,1)}. For the matching RGB color model the true
color component is returned.
When {\tt clipped p} or {\tt bounded p} is true, {\tt pathpart p} gives the
clipping or {\tt setbounds} path and the other part extraction operators are
not meaningful. Such non-meaningful part extractions do not generate
-errors---they return null values instead:
+errors. Instead, they return null values or black color (components):
the trivial path {\tt (0,0)} for {\tt pathpart},
{\tt nullpen}\index{nullpen?\texttt{nullpen}}\label{Dnlpen} for {\tt penpart},
an empty picture for {\tt dashpart},
-zero for {\tt redpart}, {\tt greenpart}, {\tt bluepart},
-and the null string for {\tt textpart} or {\tt fontpart}.
-
-One final operator for extracting information from a picture is
-$$ {\tt length}\ \descr{picture primary} $$\index{length?\texttt{length}}\label{DlengthPicture}%
-This returns the number of components that a {\tt for}\ldots {\tt within}
-iteration would find.
+the null string for {\tt textpart} or {\tt fontpart},
+zero for {\tt colormodel},
+{\tt greypart},
+{\tt redpart}, {\tt greenpart}, {\tt bluepart},
+{\tt cyanpart}, {\tt magentapart}, {\tt yellowpart},
+one for {\tt blackpart}, and
+black in the current default color model for {\tt colorpart}.
+
+To summarize the discussion of mismatching part operators:
+\begin{enumerate}
+\item Asking for non-meaningful parts of an item---such as the {\tt
+ redpart} of a clipping path, the {\tt textpart} of a stroked item,
+ or the {\tt pathpart} of a textual item---is silently accepted and
+ returns a null value or a black color (component).
+\item Applying a color part operator of the wrong color model to a
+ coloured item returns a black color component. Additionally, this
+ triggers an error.
+\end{enumerate}
+
+\index{setbounds?\texttt{setbounds}|)}
+\index{stroked?\texttt{stroked}|)}
+\index{filled?\texttt{filled}|)}
+\index{textual?\texttt{textual}|)}
+\index{clipped?\texttt{clipped}|)}
+\index{bounded?\texttt{bounded}|)}
+\index{pathpart?\texttt{pathpart}|)}
+\index{penpart?\texttt{penpart}|)}
+\index{dashpart?\texttt{dashpart}|)}
+\index{colormodel?\texttt{colormodel}|)}
+\index{colorpart?\texttt{colorpart}|)}
+\index{redpart?\texttt{redpart}|)}
+\index{greenpart?\texttt{greenpart}|)}
+\index{bluepart?\texttt{bluepart}|)}
+\index{cyanpart?\texttt{cyanpart}|)}
+\index{magentapart?\texttt{magentapart}|)}
+\index{yellowpart?\texttt{yellowpart}|)}
+\index{blackpart?\texttt{blackpart}|)}
+\index{greypart?\texttt{greypart}|)}
\section{Macros}
@@ -4473,331 +4561,6 @@ $\tt \descr{suffix list} \rightarrow \descr{suffix}
\end{figure}
-\section{Making Boxes}
-\label{boxessec}
-
-This section describes auxiliary macros not included in Plain MetaPost
-that make it convenient to do things that {\it pic} is good at
-\cite{ke:pic}. What follows is a description of how to use the macros
-contained in the file {\tt boxes.mp}\index{boxes.mp?\texttt{boxes.mp}}.
-This file is included in a special directory reserved for MetaPost
-macros and support software\footnote{The name of this directory is
-likely to be something like \verb|/usr/lib/mp/lib|, but this is system
-dependent.} and can be accessed by giving the MetaPost command {\tt
-input boxes} before any figures that use the box making macros. The
-syntax for the {\tt input} command is \index{input?\texttt{input}}
-$$ {\tt input}\, \descr{file name} $$
-where a final ``{\tt .mp}'' can be omitted from the file name. The {\tt input}
-command looks first in the current directory and then in the special macro
-directory. Users interested in writing macros may want to look at the
-{\tt boxes.mp} file in this directory.
-
-\subsection{Rectangular Boxes}
-
-The main idea of the box-making macros is that one should
-say\index{boxit?\texttt{boxit}}\label{Dboxit}
-$$ {\tt boxit.} \descr{suffix}
- \hbox{\tt(} \descr{picture expression} \hbox{\tt)}
-$$
-where the \tdescr{suffix} does not start with a subscript.\footnote{Some early
-versions of the box making macros did not allow any subscripts in the
-{\tt boxit} suffix.}
-This creates pair variables \tdescr{suffix}{\tt.c},
-\tdescr{suffix}{\tt.n}, \tdescr{suffix}{\tt.e}, \ldots\ that can then be
-used for positioning the picture before drawing it with a separate command such
-as\index{drawboxed?\texttt{drawboxed}}\label{Ddrbxed}
-$$ \hbox{\tt drawboxed(} \descr{suffix list} \hbox{\tt )} $$
-The argument to {\tt drawboxed} should be a comma-separated list of box names,
-where a box name\index{box name} is a \tdescr{suffix} with which {\tt boxit}
-has been called.
-
-For the command {\tt boxit.bb(pic)}, the box name is {\tt bb} and the
-contents of the box is the picture {\tt pic}. In this case, {\tt bb.c}
-the position where the center of picture {\tt pic} is to be placed, and
-{\tt bb.sw}, {\tt bb.se}, {\tt bb.ne}, and {\tt bb.nw} are the corners
-of a rectangular path that will surround the resulting picture.
-Variables {\tt bb.dx} and {\tt bb.dy} give the spacing between the
-shifted version of {\tt pic} and the surrounding rectangle, and {\tt
-bb.off} is the amount by which {\tt pic} has to be shifted to achieve
-all this.
-
-When the {\tt boxit} macro is called with box name~$b$, it gives linear
-equations that force $b${\tt.sw}, $b${\tt.se}, $b${\tt.ne}, and
-$b${\tt.nw} to be the corners of a rectangle aligned on the $x$ and $y$
-axes with the box contents centered inside as indicated by the gray
-rectangle in Figure~\ref{fig48}. The values of $b${\tt.dx},
-$b${\tt.dy}, and $b${\tt.c} are left unspecified so that the user can
-give equations for positioning the boxes. If no such equations are
-given, macros such as {\tt drawboxed} can detect this and give default
-values. The default values for {\tt dx} and {\tt dy} variables are
-controlled by the internal variables\index{internal
-variables}\index{variables!internal} {\tt
-defaultdx}\index{defaultdx?\texttt{defaultdx}}\label{Ddefaultdx} and
-{\tt defaultdy}\index{defaultdy?\texttt{defaultdy}}\label{Ddefaultdy}.
-
-\begin{figure}[htp]
-$$ \includegraphics{manfig-48} $$
-\caption[How a {\tt boxit} picture relates to the associated variables]
- {The relationship between the picture given to {\tt boxit} and the
- associated variables. The picture is indicated by a gray rectangle.}
-\label{fig48}
-\end{figure}
-
-If $b$ represents a box name, {\tt drawboxed($b$)} draws the rectangular
-boundary of box~$b$ and then the contents of the box. This bounding
-rectangle can be accessed separately as {\tt bpath~$b$}, or in
-general\index{bpath?\texttt{bpath}}\label{Dbpath}
-$$ {\tt bpath}\, \descr{box name} $$
-It is useful in combination with operators like
-{\tt cutbefore}\index{cutbefore?\texttt{cutbefore}} and {\tt cutafter}\index{cutafter?\texttt{cutafter}}
-in order to control paths that enter the box.
-For example, if $a$ and $b$ are box names and $p$ is a path from $a${\tt.c}
-to $b${\tt.c},\index{drawarrow?\texttt{drawarrow}}
-$$ \hbox{\tt drawarrow $p$ cutbefore bpath $a$ cutafter bpath $b$} $$
-draws an arrow from the edge of box $a$ to the edge of box $b$.
-
-Figure~\ref{fig49} shows a practical example including some arrows drawn
-with {\tt cutafter bpath} \tdescr{box name}. It is instructive to
-compare Figure~\ref{fig49} to the similar figure in the pic manual
-\cite{ke:pic}. The figure uses a
-macro\index{boxjoin?\texttt{boxjoin}}\label{Dbxjoin}
-$$ \hbox{\tt boxjoin(} \descr{equation text} \hbox{\tt )} $$
-to control the relationship between consecutive boxes. Within the
-\tdescr{equation text}, {\tt a} and {\tt b} represent the box names given in
-consecutive calls to {\tt boxit} and the \tdescr{equation text} gives equations
-to control the relative sizes and positions of the boxes.
-
-\begin{figure}[htp]
-$$\hbox{$\begin{verbatim}
-input boxes
-beginfig(49);
-boxjoin(a.se=b.sw; a.ne=b.nw);
-boxit.a(btex\strut$\cdots$ etex); boxit.ni(btex\strut$n_i$ etex);
-boxit.di(btex\strut$d_i$ etex); boxit.ni1(btex\strut$n_{i+1}$ etex);
-boxit.di1(btex\strut$d_{i+1}$ etex); boxit.aa(btex\strut$\cdots$ etex);
-boxit.nk(btex\strut$n_k$ etex); boxit.dk(btex\strut$d_k$ etex);
-drawboxed(di,a,ni,ni1,di1,aa,nk,dk); label.lft("ndtable:", a.w);
-interim defaultdy:=7bp;
-boxjoin(a.sw=b.nw; a.se=b.ne);
-boxit.ba(); boxit.bb(); boxit.bc();
-boxit.bd(btex $\vdots$ etex); boxit.be(); boxit.bf();
-bd.dx=8bp; ba.ne=a.sw-(15bp,10bp);
-drawboxed(ba,bb,bc,bd,be,bf); label.lft("hashtab:",ba.w);
-vardef ndblock suffix $ =
- boxjoin(a.sw=b.nw; a.se=b.ne);
- forsuffixes $$=$1,$2,$3: boxit$$(); ($$dx,$$dy)=(5.5bp,4bp);
- endfor; enddef;
-ndblock nda; ndblock ndb; ndblock ndc;
-nda1.c-bb.c = ndb1.c-nda3.c = (whatever,0);
-xpart ndb3.se = xpart ndc1.ne = xpart di.c;
-ndc1.c - be.c = (whatever,0);
-drawboxed(nda1,nda2,nda3, ndb1,ndb2,ndb3, ndc1,ndc2,ndc3);
-drawarrow bb.c -- nda1.w;
-drawarrow be.c -- ndc1.w;
-drawarrow nda3.c -- ndb1.w;
-drawarrow nda1.c{right}..{curl0}ni.c cutafter bpath ni;
-drawarrow nda2.c{right}..{curl0}di.c cutafter bpath di;
-drawarrow ndc1.c{right}..{curl0}ni1.c cutafter bpath ni1;
-drawarrow ndc2.c{right}..{curl0}di1.c cutafter bpath di1;
-drawarrow ndb1.c{right}..nk.c cutafter bpath nk;
-drawarrow ndb2.c{right}..dk.c cutafter bpath dk;
-x.ptr=xpart aa.c; y.ptr=ypart ndc1.ne;
-drawarrow subpath (0,.7) of (z.ptr..{left}ndc3.c) dashed evenly;
-label.rt(btex \strut ndblock etex, z.ptr); endfig;
-\end{verbatim}
-$}
-\atop \vcenter{\vskip8pt\hbox{\includegraphics{manfig-49}}}
-$$
-\caption{MetaPost code and the corresponding figure}
-\label{fig49}
-\end{figure}
-
-For example, the second line of input for the above figure contains
-$$ \hbox{\tt boxjoin(a.se=b.sw; a.ne=b.nw)} $$
-This causes boxes to line up horizontally by giving additional equations that
-are invoked each time some box {\tt a} is followed by some other box~{\tt b}.
-These equations are first invoked on the next line when box~{\tt a} is followed
-by box~{\tt ni}. This yields
-$$ \hbox{\tt a.se=ni.sw; a.ne=ni.nw} $$
-The next pair of boxes is box~{\tt ni} and box~{\tt di}. This time the
-implicitly generated equations are
-$$ \hbox{\tt ni.se=di.sw; ni.ne=di.nw} $$
-This process continues until a new {\tt
-boxjoin}\index{boxjoin?\texttt{boxjoin}} is given. In this case the new
-declaration is
-$$ \hbox{\tt boxjoin(a.sw=b.nw; a.se=b.ne)} $$
-which causes boxes to be stacked below each other.
-
-After calling {\tt boxit} for the first eight boxes {\tt a} through {\tt
-dk}, the box heights are constrained to match but the widths are still
-unknown. Thus the {\tt drawboxed}\index{drawboxed?\texttt{drawboxed}}
-macro needs to assign default values to the \tdescr{box name}{\tt.dx}
-and \tdescr{box name}{\tt.dy} variables. First, {\tt di.dx} and {\tt
-di.dy} get default values so that all the boxes are forced to be large
-enough to contain the contents of box~{\tt di}.
-
-The macro that actually assigns default values to {\tt dx} and {\tt dy}
-variables is called {\tt
-fixsize}\index{fixsize?\texttt{fixsize}}\label{Dfixsiz}. It takes a
-list of box names and considers them one at a time, making sure that
-each box has a fixed size and shape. A macro called {\tt
-fixpos}\index{fixpos?\texttt{fixpos}}\label{Dfixpos} then takes this
-same list of box names and assigns default values to the \tdescr{box
-name}{\tt.off} variables as needed to fix the position of each box. By
-using {\tt fixsize} to fix the dimensions of each box before assigning
-default positions to any of them, the number of needing default
-positions can usually be cut to at most one.
-
-Since the bounding path for a box cannot be computed until the size,
-shape, and position of the box is determined, the {\tt
-bpath}\index{bpath?\texttt{bpath}} macro applies {\tt fixsize} and {\tt
-fixpos} to its argument. Other macros that do this
-include\index{pic?\texttt{pic}}\label{Dpic}
-$$ {\tt pic}\, \descr{box name} $$
-where the \tdescr{box name} is a suffix, possibly in parentheses. This returns
-the contents of the named box as a picture positioned so that
-$$ {\tt draw\ pic} \descr{box name} $$
-draws the box contents without the bounding rectangle. This operation
-can also be accomplished by the {\tt
-drawunboxed}\index{drawunboxed?\texttt{drawunboxed}}\label{Ddrunbx}
-macro that takes a comma-separated list of box names. There is also a
-{\tt drawboxes}\index{drawboxes?\texttt{drawboxes}}\label{Ddrbxes} macro
-that draws just the bounding rectangles.
-
-Another way to draw empty rectangles is by just saying\label{Deboxit}
-$$ {\tt boxit} \descr{box name} \hbox{\tt ()} $$
-with no picture argument as is done several times in Figure~\ref{fig49}.
-This is like calling {\tt boxit} with an empty picture.
-Alternatively the argument can be a string\label{Dsboxit} expression
-instead of a picture
-expression in which case the string is typeset in the default font.
-
-
-\subsection{Circular and Oval Boxes}
-
-Circular and oval boxes are a lot like rectangular boxes except for the shape
-of the bounding path. Such boxes are set up by the
-{\tt circleit}\index{circleit?\texttt{circleit}}\label{Dcircit} macro:
-$$ {\tt circleit} \descr{box name}
- \hbox{\tt(} \descr{box contents} \hbox{\tt)}
-$$
-where \tdescr{box name} is a suffix and \tdescr{box contents} is either a
-picture expression, a string expression, or \tdescr{empty}.
-
-The {\tt circleit} macro defines pair variables just as {\tt boxit}
-does, except that there are no corner points \tdescr{box name}{\tt.ne},
-\tdescr{box name}{\tt.sw}, etc. A call to
-$$ \hbox{\tt circleit.a(}\ldots \hbox{\tt )} $$
-gives relationships among points {\tt a.c}, {\tt a.s}, {\tt a.e}, {\tt
-a.n}, {\tt a.w} and distances {\tt a.dx} and {\tt a.dy}. Together with
-{\tt a.c} and {\tt a.off}, these variables describe how the picture is
-centered in an oval as can be seen from the Figure~\ref{fig50}.
-
-\begin{figure}[htp]
-$$ \includegraphics{manfig-50} $$
-\caption[How a {\tt circleit} picture relates to the associated variables]
- {The relationship between the picture given to {\tt circleit} and the
- associated variables. The picture is indicated by a gray rectangle.}
-\label{fig50}
-\end{figure}
-
-The {\tt drawboxed}\index{drawboxed?\texttt{drawboxed}}, {\tt
-drawunboxed}\index{drawunboxed?\texttt{drawunboxed}}, {\tt
-drawboxes}\index{drawboxes?\texttt{drawboxes}}, {\tt
-pic}\index{pic?\texttt{pic}}, and {\tt
-bpath}\index{bpath?\texttt{bpath}} macros work for {\tt circleit} boxes
-just as they do for {\tt boxit} boxes. By default, the boundary path
-for a {\tt circleit} box is a circle large enough to surround the box
-contents with a small safety margin controlled by the internal
-variable\index{internal variables}\index{variables!internal} {\tt
-circmargin}\label{Dcmargin}. Figure~\ref{fig51} gives a basic example
-of the use of {\tt bpath} with {\tt circleit} boxes.
-
-\begin{figure}[htbp]
-$$\begin{verbatim}
-vardef drawshadowed(text t) =
- fixsize(t);
- forsuffixes s=t:
- fill bpath.s shifted (1pt,-1pt);
- unfill bpath.s;
- drawboxed(s);
- endfor
-enddef;
-
-beginfig(51)
-circleit.a(btex Box 1 etex);
-circleit.b(btex Box 2 etex);
-b.n = a.s - (0,20pt);
-drawshadowed(a,b);
-drawarrow a.s -- b.n;
-endfig;
-\end{verbatim}
-\qquad \mathcenter{\includegraphics{manfig-51}} $$
-\caption[MetaPost code and the resulting figure.] {MetaPost code and
- the resulting figure. Note that the {\tt drawshadowed} macro
- used here is not part of the {\tt boxes.mp} macro package.}
-\label{fig51}
-\index{drawshadowed?\texttt{drawshadowed}}
-\end{figure}
-
-A full example of {\tt circleit} boxes appears in Figure~\ref{fig52}.
-The oval boundary paths around ``Start'' and ``Stop'' are due to the equations
-$$ \hbox{\tt aa.dx=aa.dy;} \quad {\rm and}\quad \hbox{\tt ee.dx=ee.dy} $$
-after
-$$ \hbox{\verb|circleit.ee(btex\strut Stop etex)|}
- \quad{\rm and}\quad
- \hbox{\verb|circleit.ee(btex\strut Stop etex)|}.
-$$
-The general rule is that {\tt bpath.}$c$ comes out circular if
-$c${\tt.dx}, $c${\tt.dy}, and $c\hbox{\tt.dx}-c\hbox{\tt.dy}$ are all
-unknown. Otherwise, the macros select an oval big enough to contain the
-given picture with the safety margin {\tt
-circmargin}\index{circmargin?\texttt{circmargin}}.
-
-
-\begin{figure}[htp]
-$$\hbox{$\begin{verbatim}
-vardef cuta(suffix a,b) expr p =
- drawarrow p cutbefore bpath.a cutafter bpath.b;
- point .5*length p of p
-enddef;
-
-vardef self@# expr p =
- cuta(@#,@#) @#.c{curl0}..@#.c+p..{curl0}@#.c enddef;
-
-beginfig(52);
-verbatimtex \def\stk#1#2{$\displaystyle{\matrix{#1\cr#2\cr}}$} etex
-circleit.aa(btex\strut Start etex); aa.dx=aa.dy;
-circleit.bb(btex \stk B{(a|b)^*a} etex);
-circleit.cc(btex \stk C{b^*} etex);
-circleit.dd(btex \stk D{(a|b)^*ab} etex);
-circleit.ee(btex\strut Stop etex); ee.dx=ee.dy;
-numeric hsep;
-bb.c-aa.c = dd.c-bb.c = ee.c-dd.c = (hsep,0);
-cc.c-bb.c = (0,.8hsep);
-xpart(ee.e - aa.w) = 3.8in;
-drawboxed(aa,bb,cc,dd,ee);
-label.ulft(btex$b$etex, cuta(aa,cc) aa.c{dir50}..cc.c);
-label.top(btex$b$etex, self.cc(0,30pt));
-label.rt(btex$a$etex, cuta(cc,bb) cc.c..bb.c);
-label.top(btex$a$etex, cuta(aa,bb) aa.c..bb.c);
-label.llft(btex$a$etex, self.bb(-20pt,-35pt));
-label.top(btex$b$etex, cuta(bb,dd) bb.c..dd.c);
-label.top(btex$b$etex, cuta(dd,ee) dd.c..ee.c);
-label.lrt(btex$a$etex, cuta(dd,bb) dd.c..{dir140}bb.c);
-label.bot(btex$a$etex, cuta(ee,bb) ee.c..tension1.3 ..{dir115}bb.c);
-label.urt(btex$b$etex, cuta(ee,cc) ee.c{(cc.c-ee.c)rotated-15}..cc.c);
-endfig;
-\end{verbatim}
-$}
-\atop \vcenter{\vskip8pt\hbox{\includegraphics{manfig-52}}}
-$$
-\caption{MetaPost code and the corresponding figure}
-\label{fig52}
-\index{self?\texttt{self}}
-\end{figure}
-
-
\section{Reading and Writing Files}
File access was one of the new language features introduced in version~0.60
of the MetaPost language. A new operator
@@ -5155,20 +4918,9 @@ treatment of included \TeX\ material.
\setcounter{totalnumber}{10}
Tables \ref{ivartab}--\ref{pseudotab} summarize the built-in features of
-Plain MetaPost and the features defined in the {\tt
-boxes.mp}\index{boxes.mp?\texttt{boxes.mp}} macro file. As explained in
-Section~\ref{boxessec}, the {\tt boxes.mp} macro file is not
-automatically preloaded and the macros defined there are not accessible
-until you ask for them via the command\index{input?\texttt{input}}
-$$ \hbox{\tt input boxes} $$
-
-Features that depend on {\tt boxes.mp} are marked by \bx\ symbols.
-Features from the Plain\index{Plain macros} macro package are marked by
-\pl\ symbols, and MetaPost primitives are not marked by \bx\ or \pl.
-The distinction between primitives and plain macros can be ignored by
-the casual user, but it is important to remember that features marked by
-a \bx\ can only be used after reading in the {\tt
-boxes.mp}\index{boxes.mp?\texttt{boxes.mp}} macro file.
+Plain MetaPost. Features from the Plain\index{Plain macros} macro
+package are marked by \pl\ symbols. The distinction between primitives
+and plain macros can be ignored by the casual user.
The tables in this appendix give the name of each feature, the page
number where it is explained, and a short description. A few features
@@ -5237,16 +4989,10 @@ $$\begin{tabular}{|l|r|l|}
extra space allowed by {\tt bbox} (default 2{\tt bp})\\\hline
\tt charcode& \pageref{Dcharcode}&
the number of the current figure\\\hline
-\bx\tt circmargin& \pageref{Dcmargin}&
- clearance around contents of a circular or oval box\\\hline
\tt day& --&
the current day of the month\\\hline
\tt defaultcolormodel& --&
the initial color model (default: 5, rgb)\\\hline
-\bx\tt defaultdx& \pageref{Ddefaultdx}&
- usual horizontal space around box contents (default 3{\tt bp})\\\hline
-\bx\tt defaultdy& \pageref{Ddefaultdy}&
- usual vertical space around box contents (default 3{\tt bp})\\\hline
\pl\tt defaultpen& \pageref{Ddefaultpen}&
numeric index used by {\tt pickup} to select default pen\\\hline
\pl\tt defaultscale& \pageref{Ddfscale}&
@@ -5545,24 +5291,8 @@ $$\begin{tabular}{|l|l|l|r|l|}
\multicolumn1{|c|}{Explanation}\\
\hline
\hline
-\bx\tt \verb|boxit|& suffix, picture& --& \pageref{Dboxit}&
- Define a box containing the picture\\\hline
-\bx\tt \verb|boxit|& suffix, string& --& \pageref{Dsboxit}&
- Define a box containing text\\\hline
-\bx\tt \verb|boxit|& suffix, \tdescr{empty}& --& \pageref{Deboxit}&
- Define an empty box\\\hline
-\bx\tt \verb|boxjoin|& equations& --& \pageref{Dbxjoin}&
- Give equations for connecting boxes\\\hline
-\bx\tt \verb|bpath|& suffix& path& \pageref{Dbpath}&
- A box's bounding circle or rectangle\\\hline
\pl\tt \verb|buildcycle|& list of paths& path& \pageref{buildcy}&
Build a cyclic path\\\hline
-\bx\tt \verb|circleit|& suffix, picture& --& \pageref{Dcircit}&
- Put picture in a circular box\\\hline
-\bx\tt \verb|circleit|& suffix, picture& --& \pageref{Dcircit}&
- Put a string in a circular box\\\hline
-\bx\tt \verb|circleit|& suffix, \tdescr{empty}& --& \pageref{Dcircit}&
- Define an empty circular box\\\hline
\pl\tt \verb|dashpattern|& on/off distances& picture& \pageref{Ddshpat}&
Create a pattern for dashed lines\\\hline
\pl\tt \verb|decr|& numeric variable& numeric& \pageref{Dincr}&
@@ -5573,24 +5303,10 @@ $$\begin{tabular}{|l|l|l|r|l|}
Mark point and place text nearby\\\hline
\pl\tt \verb|dotlabels|& suffix, point numbers& --& \pageref{Ddotlbs}&
Mark {\tt z} points with their numbers\\\hline
-\bx\tt \verb|drawboxed|& list of suffixes& --& \pageref{Ddrbxed}&
- Draw the named boxes and their\\
-& & & &
- contents\\\hline
-\bx\tt \verb|drawboxes|& list of suffixes& --& \pageref{Ddrbxes}&
- Draw the named boxes\\\hline
\pl\tt \verb|drawdot|& pair& --& \pageref{Ddrawdot}&
Draw a dot at the given point\\\hline
\pl\tt \verb|drawoptions|& drawing options& --& \pageref{Ddropts}&
Set options for drawing commands\\\hline
-\bx\tt \verb|drawunboxed|& list of suffixes& --& \pageref{Ddrunbx}&
- Draw contents of named boxes\\\hline
-\bx\tt \verb|fixpos|& list of suffixes& --& \pageref{Dfixpos}&
- Solve for the size and position of the\\
-& & & &
- named boxes\\\hline
-\bx\tt \verb|fixsize|& list of suffixes& --& \pageref{Dfixsiz}&
- Solve for size of named boxes\\\hline
\pl\tt \verb|image|& string& picture& \pageref{Dimage}&
Return picture from text\\\hline
\pl\tt \verb|incr|& numeric variable& numeric& \pageref{Dincr}&
@@ -5609,8 +5325,6 @@ $$\begin{tabular}{|l|l|l|r|l|}
Find the minimum\\\hline
\pl\tt \verb|min|& list of strings& string& --&
Find the lexicographically first string\\\hline
-\bx\tt \verb|pic|& suffix& picture& \pageref{Dpic}&
- Box contents shifted into position\\\hline
\pl\tt \verb|thelabel|& suffix, picture, pair& picture& \pageref{Dthelab}&
Picture shifted as if to label a point\\\hline
\pl\tt \verb|thelabel|& suffix, string, pair& picture& \pageref{Dthelab}&
@@ -6196,6 +5910,7 @@ blue\\
buildcycle\\
butt\\
center\\
+colorpart\\
cutafter\\
cutbefore\\
cuttings\\