summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/curves
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-08 00:01:08 +0000
committerKarl Berry <karl@freefriends.org>2008-09-08 00:01:08 +0000
commitafcd1593272b9e2b915b9677229483d6b687c85d (patch)
treeca5e145debf778639fc9c02976466e532c885dbb /Master/texmf-dist/source/latex/curves
parent4408b5988380b6439238e57c784051169addd06c (diff)
curves 1.52 (1sep08)
git-svn-id: svn://tug.org/texlive/trunk@10456 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/curves')
-rw-r--r--Master/texmf-dist/source/latex/curves/curves.dtx609
1 files changed, 355 insertions, 254 deletions
diff --git a/Master/texmf-dist/source/latex/curves/curves.dtx b/Master/texmf-dist/source/latex/curves/curves.dtx
index ca0c4cc53d1..4ecb03c8634 100644
--- a/Master/texmf-dist/source/latex/curves/curves.dtx
+++ b/Master/texmf-dist/source/latex/curves/curves.dtx
@@ -4,16 +4,23 @@
% Program curves
% Copyright (C) 1991 1992 1993 1994 1995 1996 2000 2008 Ian Maclaine-cross
%
-% It may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.2
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.2 or later is part of all distributions of LaTeX
-% version 1999/12/01 or later.
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
%
-% The Program's files are curves.dtx, curves.ins, curves.sty and
-% curvesls.sty. Curves.sty provides curve drawing commands for
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Ian Maclaine-cross
+% <ilm@patch.bpa.nu>.
+%
+% This work consists of the files README and curves.dtx, curves.ins
+% and the derived files curves.sty and curvesls.sty.
+%
+% Curves.sty provides curve and polygon drawing commands for
% the standard LaTeX picture environment.
%
% When LaTeX is run with input file curves.ins, the docstrip
@@ -22,7 +29,7 @@
%
% \fi
%
-% \CheckSum{2045}
+% \CheckSum{2060}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -50,17 +57,17 @@
%<*package,driver>
% \fi
% \ProvidesFile{curves.dtx}
- [2008/04/24 1.51 Curves for LaTeX picture environment]
+ [2008/08/29 1.52 Curves for LaTeX picture environment]
%
% \iffalse
%</package,driver>
%<*driver>
\documentclass{ltxdoc}
\usepackage{curves}
-% \usepackage[xdvi]{curves}
-%% Remove the % from the start of the \OnlyDescription line below to
-%% prevent the curves.sty listing printing out.
-% \OnlyDescription
+% \usepackage[dvips]{curves}
+%% Insert % at the start of the \OnlyDescription line below to
+%% add commented listings of curves.sty and curvesls.sty to print out.
+\OnlyDescription
\begin{document}
\DocInput{curves.dtx}
\end{document}
@@ -71,7 +78,8 @@
%
% \changes{1.42}{2000/08/12}{Last compatible with LaTeX 2.09}
% \changes{1.50}{2000/08/22}{Files merged, docstrip, LPPL and PostScript added}
-% \changes{1.51}{2008/04/24}{Curves.tex corrected, new email address}
+% \changes{1.51}{2008/04/24}{New email address and corrections in doc}
+% \changes{1.52}{2008/08/29}{Upstream website in doc, straight segment switch}
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -81,108 +89,114 @@
%
% \author{Ian Maclaine-cross\\
% \small Internet: \texttt{\InternetAddress}}
-% \date{24 April 2008}
+% \date{29 August 2008}
% \maketitle
%
-% \begin{abstract}
-% Draws curves in the \LaTeXe\ \texttt{picture} environment
-% using parabolas between data points
-% with continuous slope at joins. For circles and arcs uses
-% up to 16 parabolas. Also draws
-% symbols or dash patterns along curves. Equivalent to technical pens with
-% compasses and French curves. Curves consist of short secants
-% drawn by overlapping disks or
-% line drawing |\special|s selected by package options.
-% \end{abstract}
+% \begin{abstract}
+% Draws curves in the \LaTeXe\ |picture| environment using
+% parabolic arcs between data points with continuous slope at
+% joins. For circles and circular arcs uses up to 16 parabolic
+% arcs. Also draws symbols or dash patterns along curves. A
+% straight side switch changes curves to polygons. Extends
+% |picture| capability without extra programs and data files.
+% Parabolic arcs consist of short chords drawn by overlapping disks
+% or line drawing |\special|s selected by package options.
+% \end{abstract}
% \thispagestyle{empty}
% \tableofcontents
% \section{Introduction}
%
-% The picture environment in the \LaTeXe \footnote{Leslie Lamport, {\sl
-% \LaTeX\ A Document Preparation System 2nd ed.,} Addison-Wesley, 1994.} macro
-% package for \TeX \footnote{Donald E. Knuth, {\sl The \TeX book,}
-% Addison-Wesley, 1984.} allows simple line drawing using
-% characters. These characters include quadrant circular arcs, solid
-% disks with diameters from 1 to 15pt\footnote{A printer's point,
-% abbreviated pt, is approximately 0.351460 mm.} and short lines with a
-% limited range of slopes in two thicknesses. A |\begin{picture}|
-% command defines an area where following commands place these
-% characters to draw a \LaTeX\ picture.
-%
-% \LaTeX\ pictures save disk space for source descriptions and
-% computer time in producing documents compared with printer commands or
-% bit mapped graphics. From initial pencil sketch on squared graph
-% paper to final printout, they take half the time for manual pen
-% drawings. The labor savings are higher for revisions and
-% rewrites. Unfortunately standard \LaTeX\ cannot yet draw curves like a
-% pen, compass and French curves can. Fortunately there are many macro
-% packages which supplement \LaTeXe's capabilities and do
-% marvellous graphical things for any printing need\footnote{Michel
-% Goossens, Frank Mittelbach and Sebastian Rahtz,
-% \textsl{The LaTeX Graphics Companion,} Addison-Wesley, 1997.}.
-% \textsf{Curves} just adds curve drawing
-% to \LaTeX\ \texttt{pictures}.
+% The |picture| environment in the \LaTeXe \footnote{Leslie Lamport,
+% {\sl \LaTeX\ A Document Preparation System 2nd ed.,}
+% Addison-Wesley, 1994.} macro package for \TeX \footnote{Donald
+% E. Knuth, {\sl The \TeX book,} Addison-Wesley, 1984.} allows
+% simple line drawing using characters. These characters include
+% quadrant circular arcs, solid disks with diameters from 1 to
+% 15pt\footnote{A printer's point, abbreviated pt, is approximately
+% 0.351460 mm.} and short lines with a limited range of slopes in
+% two thicknesses. A |\begin{picture}| command defines an area where
+% following commands place these characters to draw a \LaTeX\ picture.
+%
+% \LaTeX\ \textsf{picture}s save disk space for source descriptions and
+% computer time in producing documents compared with printer commands or
+% bit mapped graphics. From initial pencil sketch on squared graph
+% paper to final printout, they take half the time for manual pen
+% drawings. The labor savings are higher for revisions and rewrites.
+% Unfortunately standard \LaTeX\ cannot yet draw curves like a
+% pen, compass and French curves can. Fortunately there are many macro
+% packages which supplement \LaTeXe's capabilities and do
+% marvellous graphical things for any printing need\footnote{Michel
+% Goossens, Sebastian Rahtz and Frank Mittelbach,
+% \textsl{The LaTeX Graphics Companion,} Addison-Wesley, 1997.}.
+% \textsf{Curves} just adds curve and polygon drawing
+% to \LaTeX\ \texttt{picture}s. With \textsf{curves} most line drawings
+% require no additional source or binary files or programs.
%
% Brief descriptions, simple examples and a command summary follow. They
-% presume familiarity with relevant chapters of the \LaTeX\
-% manual\footnotemark[1].
+% presume familiarity with relevant chapters of the \LaTeX\
+% manual\footnotemark[1].
%
% \section{Installation}
%
-% \DescribeMacro{curves.sty}
-% To create the file \texttt{curves.sty} you need \LaTeXe\ and a command like:
+% \DescribeMacro{curves.sty}
+% To create the file \texttt{curves.sty} you need \LaTeXe\ and a command like:
% \begin{verbatim}
% $ latex curves.ins
% \end{verbatim}
% Put \texttt{curves.sty} and \texttt{curvesls.sty} in your default or a
-% \texttt{texinput} directory. The package \textsf{curvesls} provides
-% compatibility for old documents. Comprehensive \TeX\ distributions preinstall
-% \textsf{curves} so for most users the above step is unnecessary.
-%
-% Put \texttt{curves} in a |\usepackage|
-% command at the top of your main
-% {\tt .tex} file for any document where you wish to use
-% \textsf{curves} {\it e.g.\/,}
+% \texttt{texinput} directory. The package \textsf{curvesls} provides
+% compatibility for old documents. Comprehensive \TeX\ distributions
+% preinstall \textsf{curves} so for most users the above step is unnecessary.
+%
+% Put \texttt{curves} in a |\usepackage| command at the top of your
+% main {\tt .tex} file for any document where you wish to use
+% \textsf{curves} {\it e.g.\/,}
% \begin{verbatim}
% \documentclass[11pt]{article}
% \usepackage{curves}
% \end{verbatim}
-% Do not combine {\tt curves} with {\tt bezier} in this
-% command. \textsf{Curves} contains a fast powerful replacement for
-% the |\bezier| command.
-% Drawings using the |\bezier| command should not change their appearance.
+% Do not combine {\tt curves} with {\tt bezier} in this command.
+% \textsf{Curves} contains a fast powerful replacement for the |\bezier|
+% command. Drawings using the |\bezier| command should not change
+% their appearance.
%
-% \DescribeMacro{dvips} \DescribeMacro{emtex} \DescribeMacro{xdvi}
-% \DescribeMacro{WML}
-% The \textsf{curves} package has options to save \TeX\ memory and runtime
-% using |\special|
-% commands to draw the straight lines which approximate curves.
-% Select an option only if your program for
-% viewing or printing \TeX's |dvi| files recognizes and uses the
-% corresponding |\special|s. Otherwise the curves on your drawings will be
-% invisible.
-% The \texttt{dvips} option uses the em\TeX\
-% |\special|s of |dvips| which draw lines with rounded ends.
-% The \texttt{emtex} option uses the original |\special|s of
+% \DescribeMacro{dvips} \DescribeMacro{emtex} \DescribeMacro{xdvi}
+% \DescribeMacro{WML}
+% The \textsf{curves} package has options to save \TeX\ memory and runtime
+% using |\special| commands to draw the straight lines which approximate
+% curves. Select an option only if your program for
+% viewing or printing \TeX's |dvi| files recognizes and uses the
+% corresponding |\special|s. Otherwise the curves or polygons on
+% your drawings will be invisible. The \texttt{dvips} option uses the
+% em\TeX\ |\special|s of |dvips| which draw lines with rounded ends.
+% The \texttt{emtex} option uses the original |\special|s of
% em\TeX\ by Eberhard Mattes with disks added to hide their square ends.
-% The \texttt{xdvi} option uses the PostScript
-% |\special|s of Tomas Rokicki's |dvips| to draw lines which the
-% \texttt{xdvi} viewer now implements.
-% |WML| are new versions of the em\TeX\ |\special|s in |dvips| with
-% compact names.
-% No options draws lines using
-% disks from standard
-% \LaTeX\ fonts. No options or |dvips| work with the \textsf{color} package
-% but other drivers may or may not. Select package options when required by
-% modifying |\usepackage| like:
+% The \texttt{xdvi} option uses the PostScript |\special|s of Tomas
+% Rokicki's |dvips| to draw lines which the \texttt{xdvi} viewer now
+% implements. |WML| are new versions of the em\TeX\ |\special|s in
+% |dvips| with compact names. No options draws lines using
+% disks from standard \LaTeX\ fonts.
+% No options or |dvips| work with the \textsf{color} package
+% but other drivers may or may not. Select package options when required by
+% modifying |\usepackage| like:
% \begin{verbatim}
% \usepackage[dvips]{curves}
% \end{verbatim}
%
-% \DescribeMacro{BOX}
-% A drawing frequently uses auxiliary commands to size, place, label and
-% caption it. The following commands draw the box in Figure~\ref{box} on
-% page~\pageref{box}:
+% \DescribeMacro{PDF}
+% Use no option with single pass pdf\TeX\footnote{\label{fn:MG}Frank
+% Mittelbach and Michel Goossens, {\sl The \LaTeX\ Companion 2nd ed.,}
+% Addison-Wesley, 2004.} or pdf\LaTeX.
+% With \textsf{curves} the \texttt{dvips} option with \LaTeX\
+% followed by \texttt{dvips} and \texttt{ps2pdf}\footnote{A script
+% which converts PostScript to PDF using
+% \textsf{ghostscript}.} usually produces the smallest Portable Document
+% Format file.
+%
+% \DescribeMacro{BOX}
+% A drawing frequently uses auxiliary commands to size, place, label and
+% caption it. The following commands draw the box in Figure~\ref{box} on
+% page~\pageref{box}:
%
% \begin{figure}
% \begin{center}
@@ -210,55 +224,77 @@
% \end{figure}
% \end{verbatim}
% Lamport\footnotemark[1] explains these commands. This example is for those
-% unfamiliar with the \LaTeX\ picture environment. The following examples avoid
-% the \textsf{figure} environment but it is often essential.
+% unfamiliar with the \LaTeX\ picture environment. The following examples
+% avoid the \textsf{figure} environment but it is often essential.
%
-% \section{Curves}
+% \section{Curves and Polygons}
% \label{curves}
%
-% \DescribeMacro{\curve} \DescribeMacro{\closecurve} \DescribeMacro{\tagcurve}
+% \DescribeMacro{\curve} \DescribeMacro{\closecurve} \DescribeMacro{\tagcurve}
% The commands, |\curve|, |\closecurve| and
-% |\tagcurve|, draw parabola segments between coordinate points in the
-% argument\footnote{Please see Section~\ref{summary} for full
-% descriptions of \textsf{curves} commands.}.
-% The segments' tangents at these points are parallel to each other
-% and to straight lines through the points either side. Segments at
-% |\curve| ends
-% are parabolas with the point second from the end a
-% vertex. |\closecurve| adds a
-% parabola between end points to close the curve. |\tagcurve| omits the
-% first and last segments drawing curves with end tangents specified.
-% When only three points are specified |\tagcurve| draws the last segment. The
-% following table shows these features.
-%
-% \begin{center}
+% |\tagcurve|, draw parabolic arcs between coordinate points in the
+% argument\footnote{Please see Section~\ref{summary} for full
+% descriptions of \textsf{curves} commands.}.
+% The segments' tangents at these points are parallel to each other
+% and to straight lines through the points either side. Segments at
+% |\curve| ends are parabolic arcs with the point second from the end a
+% vertex. |\closecurve| adds a
+% parabolic arc between end points to close the curve. |\tagcurve| omits the
+% first and last segments drawing curves with end tangents specified.
+% When only three points are specified |\tagcurve| draws the last segment. The
+% table following shows these features.
+%
+% \DescribeMacro{\straightfalse} \DescribeMacro{\straighttrue}
+% The command |\straighttrue| causes all following \textsf{curves}
+% to use straight lines between coordinate points giving polygons
+% as in the following table.
+% The default or after the command |\straightfalse| is to draw the
+% curves described in the preceding paragraph.
+%
+% \begin{flushright}
% \setlength\unitlength{0.4pt}
% \linethickness{0.7mm}
-% \begin{tabular}{lc}
-% Example & Curve \\
+% \makebox[0pt][r]{
+% \begin{tabular}{lcc}
+% Example & Curve & Polygon\\
+% & \makebox[6em][r]{\tt\char92 straightfalse}
+% & \makebox[6em][l]{\tt\char92 straighttrue}\\
% \hline
% \raisebox{60\unitlength}{\tt\char92 curve(0,0, 50,100, 100,0)} &
% \begin{picture}(100,120)(0,-10)
% \curve(0,0, 50,100, 100,0)
+% \end{picture} &
+% \begin{picture}(100,120)(0,-10)
+% \straighttrue
+% \curve(0,0, 50,100, 100,0)
% \end{picture}\\
% \raisebox{80\unitlength}{\tt\char92 closecurve(0,0, 50,100, 100,0)} &
% \begin{picture}(100,170)(0,-60)
% \closecurve(0,0, 50,100, 100,0)
+% \end{picture} &
+% \begin{picture}(100,170)(0,-60)
+% \straighttrue
+% \closecurve(0,0, 50,100, 100,0)
% \end{picture} \\
-% \raisebox{60\unitlength}{
+% \raisebox{60\unitlength}{%
% \tt\char92 tagcurve(100,0, 0,0, 50,100, 100,0, 0,0)} &
% \begin{picture}(120,120)(-10,-10)
% \tagcurve(100,0, 0,0, 50,100, 100,0, 0,0)
+% \end{picture} &
+% \begin{picture}(120,120)(-10,-10)
+% \straighttrue
+% \tagcurve(100,0, 0,0, 50,100, 100,0, 0,0)
% \end{picture} \\
% \hline
-% \end{tabular}
-% \end{center}
-% \DescribeMacro{\arc} \DescribeMacro{\curve}
+% \end{tabular}}\\
+% \end{flushright}
+%
+% \DescribeMacro{\arc} \DescribeMacro{\curve}
% Axial flow fans often use the RAF 6E aerofoil section. The section
-% coordinates in the following macro come directly from aerodynamic
-% tables\footnote{R.A. Wallis, {\sl Axial Flow Fans,} Academic Press, 1961,
-% p.335}. The |\arc| commands draw the leading and trailing radii and the
-% two coordinate |\curve| the flat chord.
+% coordinates in the following macro come directly from aerodynamic
+% tables\footnote{R.A. Wallis, {\sl Axial Flow Fans,} Academic Press, 1961,
+% p.335}. The |\arc| commands draw the leading and trailing radii and the
+% two coordinate |\curve| the flat chord.
% \begin{verbatim}
% \newcommand{\RAFsixE}{
% \scaleput(1.25,1.25){\arc(0,-1.25){-135}}
@@ -295,15 +331,15 @@
% The RAF 6E has a flat undersurface.
% \end{center}
%
-% \DescribeMacro{\bigcircle}
+% \DescribeMacro{\bigcircle}
% The drawing command |\bigcircle| works similarly to |\circle|
-% except there is no |\circle*| equivalent. The following section scales it
-% to an ellipse.
+% except there is no |\circle*| equivalent. The following section scales it
+% to an ellipse.
%
% \section{Scaling}
-% \DescribeMacro{\unitlength} \DescribeMacro{\put}
+% \DescribeMacro{\unitlength} \DescribeMacro{\put}
% The size of \LaTeX\ picture objects may be uniformly scaled by preceding
-% them with:
+% them with:
% \begin{verbatim}
% \setlength{\unitlength}{\scale\unitlength}
% \end{verbatim}
@@ -311,40 +347,38 @@
% is previously defined perhaps with
% |\newcommand|
% as a decimal number. The new coordinates of a point \((x',y')\)
-% relative to the current origin are related to the old
+% relative to the current origin are related to the old
% coordinates \((x,y)\) relative to the same origin by
-% \begin{eqnarray*}
-% x' &=& x \times |\scale| \\
-% y' &=& y \times |\scale|
-% \end{eqnarray*}
-% If a |\put(|$x,y$|){...}| followed the change in |\unitlength| it would
-% actually put the objects |{...}| at \((x',y')\)
-% Objects defined by |\unitlength| in |{...}| would also be larger by
-% |\scale|.
-% Lamport\footnotemark[1] describes these commands.
-%
-% \DescribeMacro{\scaleput} \DescribeMacro{\xscale}
-% \DescribeMacro{\xscaley}
-% \DescribeMacro{\yscale} \DescribeMacro{\yscalex}
-% The scale factors |\xscale|, |\xscaley|, |\yscale| and |\yscalex|
-% are initially defined to be 1, 0, 1 and 0 respectively but may be
-% redefined to any decimal number using |\renewcommand|. After they
-% are redefined the new coordinates of a point \((x',y')\)
-% relative to the current origin are related to the old
+% \begin{eqnarray*}
+% x' &=& x \times |\scale| \\
+% y' &=& y \times |\scale|
+% \end{eqnarray*}
+% If a |\put(|$x,y$|){...}| followed the change in |\unitlength| it would
+% actually put the objects |{...}| at \((x',y')\).
+% Objects defined by |\unitlength| in |{...}| would also be larger by
+% |\scale|. Lamport\footnotemark[1] describes these commands.
+%
+% \DescribeMacro{\scaleput} \DescribeMacro{\xscale}
+% \DescribeMacro{\xscaley}
+% \DescribeMacro{\yscale} \DescribeMacro{\yscalex}
+% The scale factors |\xscale|, |\xscaley|, |\yscale| and |\yscalex|
+% are initially defined to be 1, 0, 1 and 0 respectively but may be
+% redefined to any decimal number using |\renewcommand|. After they
+% are redefined the new coordinates of a point \((x',y')\)
+% relative to the current origin are related to the old
% coordinates \((x,y)\) relative to the same origin by
-% \begin{eqnarray*}
-% x' &=& x \times |\xscale| + y \times |\xscaley|\\
-% y' &=& x \times |\yscalex| + y \times |\yscale|
-% \end{eqnarray*}
-% If a |\scaleput(|$x,y$|){...}| followed the change in these factors it would
-% actual put the objects |{...}| at \((x',y')\). All the drawing
-% commands in \textsf{curves} use the current values of these four scale
-% factors in placing disks and secants.
-%
-% These factors can rotate
-% pictures which like |\RAFsixE| are made solely with \textsf{curves}
-% commands. The
-% factors following rotate the RAF~6E through 12$^\circ$ clockwise about its
+% \begin{eqnarray*}
+% x' &=& x \times |\xscale| + y \times |\xscaley|\\
+% y' &=& x \times |\yscalex| + y \times |\yscale|
+% \end{eqnarray*}
+% If a |\scaleput(|$x,y$|){...}| followed the change in these factors it would
+% actual put the objects |{...}| at \((x',y')\). All the drawing
+% commands in \textsf{curves} use the current values of these four scale
+% factors in placing disks and chords.
+%
+% These factors can rotate pictures which like |\RAFsixE| are made solely
+% with \textsf{curves} commands. The
+% factors following rotate the RAF~6E through 12$^\circ$ clockwise about its
% {\tt (0,0)} co-ordinate:
% \begin{verbatim}
% \renewcommand{\xscale}{0.9781}
@@ -370,10 +404,10 @@
% Note that \(\cos12^\circ\approx0.9781\) and \(\sin12^\circ\approx0.2079\)
% \let\RAFsixE\relax
%
-% \DescribeMacro{\arc} \DescribeMacro{\bigcircle}
+% \DescribeMacro{\arc} \DescribeMacro{\bigcircle}
% Axonometric projection is another scaling application. Circles become
-% ellipses and circular arcs become elliptical arcs. The commands drawing the
-% ellipse and arc in the following washer are:
+% ellipses and circular arcs become elliptical arcs. The commands drawing the
+% ellipse and arc in the following washer are:
% \begin{verbatim}
% \put(20,5){
% \renewcommand{\xscale}{1}
@@ -388,8 +422,8 @@
% }
% \end{verbatim}
% {\tt (20,5)} are the drawing coordinates of the upper vertex of the washer
-% closest to the reader. The angles for the |\arc|s were found by trial and
-% error.
+% closest to the reader. The angles for the |\arc|s were found by trial and
+% error.
% \begin{center}
% \setlength\unitlength{1mm}
% \begin{picture}(40,30)
@@ -419,14 +453,14 @@
% \section{Symbols}
% \label{symbols}
%
-% \DescribeMacro{\curvesymbol} \DescribeMacro{\curve}
+% \DescribeMacro{\curvesymbol} \DescribeMacro{\curve}
% \textsf{Curves} can also place symbols. |\curvesymbol| must first define
-% the symbol as anything a |\put| or |\multiput| may draw. A negative
-% symbol count between drawing command and coordinates {\it e.g.,}
-% |\tagcurve[-3](0,100,...)| fixes the number of symbols per curve segment.
+% the symbol as anything a |\put| or |\multiput| may draw. A negative
+% symbol count between drawing command and coordinates {\it e.g.,}
+% |\tagcurve[-3](0,100,...)| fixes the number of symbols per curve segment.
%
% These commands draw flight times and successive positions in the following
-% drawing:
+% drawing:
% \begin{verbatim}
% \newcounter{time}
% \curvesymbol{\thetime\,s\addtocounter{time}{1}}
@@ -434,8 +468,11 @@
% \curvesymbol{\phantom{\circle*{1}}\circle*{1}}
% \put(5,2){\curve[-2](0,0, 9.8,19.6, 19.6,0)}
% \end{verbatim}
-% where |\phantom| is a plain \TeX\ command from the \TeX
-% book\footnotemark[2].
+% where |\phantom| is a plain \TeX\ command from the \TeX
+% book\footnotemark[2]. The \LaTeX\ |\circle| characters have centres
+% on the left side of their \TeX\ boxes. The invisible |\phantom{\circle*{1}}|
+% increases the width of the box on the left so the visible |\circle*{1}| is
+% at the centre of the box formed by the two characters.
% \begin{center}
% \setlength\unitlength{2mm}
% \begin{picture}(40,35)(-5,-5) \sf
@@ -613,7 +650,8 @@
% through the first and third parallel to the line through the second and
% fourth:
% \begin{itemize}
-% \item exactly or closely, \textsf{curves} knows it cannot draw a parabola
+% \item exactly or closely, \textsf{curves} knows
+% it cannot draw a parabolic arc
% tangent to two parallel lines, issues to the screen and log file:\\
% {\tt Package curve Warning: \string\curve\ straight from \ldots}\\
% and draws a straight line;
@@ -624,7 +662,8 @@
% through the first and second parallel to the line through the third and
% fourth:
% \begin{itemize}
-% \item \textsf{curves} draws a parabola which may be nowhere near the curve.
+% \item \textsf{curves} draws a parabolic arc which may be nowhere
+% near the curve.
% \end{itemize}
%
% \DescribeMacro{\curvewarnfalse}
@@ -652,6 +691,7 @@
% Setting |\diskpitchstretch| to a value less than one with
% |\renewcommand| may smooth an unusually rough curve without package options.
%
+% \DescribeMacro{\patternresolution}
% Symbols and symbol spaces misaligned are usually due to rounding error.
% Adjusting |\patternresolution| below one can reduce rounding error and
% increase alignment accuracy. This should be limited to the misaligned curve
@@ -688,7 +728,7 @@
% be lost.
%
% You use |\usepackage[|\meta{option}|]{curves}| to load a |\special| option
-% for drawing the straight line secants which make curves
+% for drawing the straight line chords which make curves
% where \meta{option} is one of:
%
% { \setlength\parindent{0pt}
@@ -753,11 +793,18 @@
%
% \subsection{Control Commands}
%
-% \DescribeMacro{\curvewarntrue} turns warning of parabola
+% \DescribeMacro{\curvewarntrue} turns warning of parabolic arc
% replacement by straight lines on (default).
%
-% \DescribeMacro{\curvewarnfalse} turns warning of parabola
-% replacement by straight lines off.
+% \DescribeMacro{\curvewarnfalse} turns warning of parabolic arc
+% replacement by straight lines off.
+%
+% \DescribeMacro{\straighttrue} replaces parabolic arcs
+% between \meta{coordinates}
+% by straight lines replacing curves by polygons.
+%
+% \DescribeMacro{\straightfalse} draw parabolic arcs between \meta{coordinates}
+% (default).
%
% \subsection{Parameter Setting Commands}
%
@@ -783,13 +830,13 @@
% if \meta{symbol count} is zero or missing, a continuous curve;
%
% else if \meta{symbol count} is positive, \meta{symbol count}-1 squares of
-% line thickness size between and additional squares at coordinates or bezier
+% line thickness size between and additional squares at coordinates or |\bezier|
% end points;
%
% else if no \meta{character or symbol} exists, nothing;
%
% else, -\meta{symbol count}-1 characters or symbols between coordinates and
-% additional ones at coordinates or bezier end points.
+% additional ones at coordinates or |\bezier| end points.
%
% \end{hanging}
% After a |\curvedashes| command defining a pattern whose length exceeds
@@ -844,7 +891,8 @@
% |\renewcommand| can reset.
%
% \subsection{Curve Drawing Commands}
-% Curves drawn consist of parabolic arcs between coordinate points with
+% Curves commands draw straight lines between coordinate points
+% or parabolic arcs with
% tangents at each point parallel to the straight line through adjacent points.
%
% \DescribeMacro{\arc} |[|\meta{symbol count}|](X1,Y1){|\meta{angle}|}|
@@ -882,15 +930,23 @@
%
% }
%
+% \typeout{}
+% {\catcode`\%=12 \typeout{Please place a `%' at the start of the line near}}
+% \typeout{the start of curves.dtx containing just}
+% \typeout{`\string\OnlyDescription' if you also wish to print out long}
+% \typeout{commented LaTeXed listings of curves.sty and curvesls.sty.}
+% \typeout{}
+%
% \StopEventually{} ^^A
%
-% \section{How \textsf{curves} Works}
+% \section{How \textsf{curves} Works}
%
-% Superimposing characters closely can draw any curve. Disks give directional
-% independence of line thickness and visual smoothness at large pitch.
-% Smoothness increases with output resolution but is almost independent of disk
-% pitch below a critical maximum. The following table suggests this maximum
-% varies from 0.34pt for an 0.5pt thick curve to 3pt for a 15pt curve.
+% Superimposing characters closely can draw any curve. Disks give
+% directional independence of line thickness and visual smoothness at
+% large pitch. Smoothness increases with output resolution but is
+% almost independent of disk pitch below a critical maximum. The
+% following table suggests this maximum varies from 0.34pt for an
+% 0.5pt thick curve to 3pt for a 15pt curve.
%
% \begin{center}
% \setlength{\unitlength}{1pt}
@@ -918,32 +974,38 @@
% \end{tabular}
% \end{center}
%
-% \LaTeX\ |\line|\footnotemark[1] or line drawing |\special|
-% commands require a tenth the \TeX\ memory so are preferable to disks if
-% available.
-% \LaTeX\ can load \TeX\footnote{Donald E. Knuth, {\sl The \TeX book,}
-% Addison-Wesley, 1984, Chapter 20.} macros from package files with a
-% |.sty| extension. These macros can calculate the disk or line positions
-% for a curve.
-%
-% The difference in the changes in position between
-% successive pairs of disks may be so
-% small that \TeX\ rounding causes visible curve error. The difference between
-% a curve and straight secants joining points many disks apart can be invisible
-% with invisible \TeX\ rounding also. \TeX\ can efficiently draw visibly
-% accurate curves as a sequence of straight secants. Straight line drawing
-% |\special|s are often incompatible so multiple line options
-% are desirable in macros. A smooth curve
-% may require thousands of disks but only hundreds of secants so line
-% |\special|s may prevent a complex drawing from overflowing \TeX\ memory.
-%
-% {\tt curves.sty} provides macro commands for drawing curves as secants.
-% Version \fileversion\ loads in about 2000 words\footnote{A character or token
-% takes a \TeX\ word, 32 bits or larger.} of \TeX's main memory, which allows a
-% small \TeX. Complex or numerous floating drawings still require a big \TeX\
-% with {\tt curves.sty}.
-% Current options for line |\special|s are |dvips|, |emtex|, |xdvi|, and
-% |WML|.
+% \LaTeX\ |\line|\footnotemark[1] or line drawing |\special| commands
+% require a tenth the \TeX\ memory so are preferable to disks if
+% available. \LaTeX\ can load \TeX\footnote{Donald E. Knuth, {\sl
+% The \TeX book,} Addison-Wesley, 1984, Chapter 20.} macros from
+% package files with a |.sty| extension. These macros can calculate
+% the disk or line positions for a curve.
+%
+% Parabolic arcs are also quadratic B\'ezier curves which can be
+% generated from first and second differences without multiplication.
+% The accuracy at a given fixed point is greater if the differences
+% are larger. Straight lines generated by just first differences can
+% be used to interpolate between these points. \TeX's integer
+% arithmetic allows this to be done precisely.
+%
+% The difference in the changes in position between successive pairs
+% of disks may be so small that \TeX\ rounding causes visible curve
+% error. The difference between a curve and straight chords joining
+% points many disks apart can be invisible with invisible \TeX\
+% rounding also. \TeX\ can efficiently draw visibly accurate curves
+% as a sequence of straight chords. Straight line drawing |\special|s
+% are often incompatible so multiple line options are desirable in
+% macros. A smooth curve may require thousands of disks but only
+% hundreds of chords so line |\special|s may prevent a complex
+% drawing from overflowing \TeX\ memory.
+%
+% {\tt curves.sty} provides macro commands for drawing curves as
+% chords. Version \fileversion\ loads in less than 2000
+% words\footnote{A character or token takes a \TeX\ word, 32 bits or
+% larger.} of \TeX's main memory, which allows a small \TeX.
+% Complex or numerous floating drawings still require a big \TeX\
+% with {\tt curves.sty}. Current options for line |\special|s are
+% |dvips|, |emtex|, |xdvi|, and |WML|.
%
% The capabilities of these macros are:---
% \begin{itemize}
@@ -951,60 +1013,61 @@
% Guide. Try the system command {\tt latex local} to get a \LaTeX ed Guide.}
% from {\tt bezier.sty} or \LaTeXe.
% \item Work with |slides| class
-% for overhead transparencies with \LaTeXe\footnote{Michel Goossens, Frank
-% Mittelbach and Alexander Samarin, {\sl The \LaTeX\ Companion,}
-% Addison-Wesley, 1994.}.
-% \item Curves have the minimum number of disks or secants for visual
+% for overhead transparencies with \LaTeXe\footnotemark[\ref{fn:MG}].
+% \item Curves have the minimum number of disks or chords for visual
% smoothness.
% \item Curve thickness adjustable from 0.5 to 15pt (0.17 to 5mm).
% \item Curves have continuous slope.
% \item Curves for any number of points greater than one using |\curve|.
% \item Control of end slopes using |\tagcurve|.
% \item Closed curves with continuous slope using |\closecurve|.
+% \item Polygons replace curves after |\straighttrue|.
% \item Large circles |\bigcircle| and circular arcs |\arc|.
% \item Independent scaling of curve abscissa and ordinates to fit graphs.
% \item Affine scaling for making arcs or circles elliptical.
% \item Symbols and dash patterns combined without interference.
% \item Any dash length or spacing.
% \item Three methods for fitting dash patterns to curves.
-% \end{itemize}
-%
-% Parabolas approximate the segments between the specified coordinate points.
-% At an internal curve point, the slope of the two parabolas which join
-% is the slope of the straight line joining the adjacent points. For an end
-% segment, the inside point of the parabola is made a vertex which determines
-% the slope of the end point. |\tagcurve| has hidden end segments which
-% allows complete control of slope at the visible end point when desired.
-% This scheme makes the curves and slopes continuous and the discontinuity
-% in curvature is small with sufficient data points.
-%
-% Usually four points determine the parabola segment between the two
-% inside points. The four points could be close to a straight line or
-% consistent with an inflexion point. A straight line then replaces
-% the parabola between the inside points and optionally a warning is issued.
-%
-% Each parabola is drawn as a series of short secants.
-% For line |\special|s, the dvi driver draws the straight lines.
-% Otherwise, the secants are
-% drawn as overlapping disks at high speed using a simple tail chasing macro.
-% This macro's arithmetic calculations are two fixed point additions per disk
-% drawn.
-%
-% For circles and circular arcs, a parabola approximates an arc segment no
-% more than 23$^\circ$ giving a radius increase between segment ends less than
-% 0.02\%. A full circle uses 16 parabolas.
-% The error in computing and multiplying by sine and cosine is usually
-% less than 0.01\% of the radius at the far end of an arc.
+% \end{itemize}
+%
+% Parabolic arcs approximate the curve segments between the specified
+% coordinate points. At an internal curve point, the slope of the
+% two parabolic arcs which join is the slope of the straight line
+% joining the adjacent points. For an end segment, the inside point
+% of the arc is made a vertex which determines the slope of the end
+% point. |\tagcurve| has hidden end segments which allows complete
+% control of slope at the visible end point when desired. This
+% scheme makes the curves and slopes continuous and the discontinuity
+% in curvature is small with sufficient data points.
+%
+% Usually four points determine the parabolic arc between the two
+% inside points. The four points could be close to a straight line or
+% consistent with an inflexion point. A straight line then replaces
+% the parabolic arc between the inside points and optionally a
+% warning is issued.
+%
+% Each parabolic arc is drawn as a series of short chords.
+% For line |\special|s, the dvi driver draws the straight lines.
+% Otherwise, the chords are drawn as overlapping disks at high speed
+% using a simple tail chasing macro. This macro's arithmetic
+% calculations are two fixed point additions per disk drawn.
+%
+% For circles and circular arcs, a parabolic arc approximates a
+% circular arc subtending no more than 23$^\circ$ giving a radius
+% increase between segment ends less than 0.02\%. A full circle uses
+% 16 parabolic arcs. The error in computing and multiplying by sine
+% and cosine is usually less than 0.01\% of the radius at the far end
+% of an arc.
%
% \section{Pleas for the Future}
%
% \textsf{Curves} will never work with plain \TeX\ and it will never be as
-% powerful as {\sf METAFONT} or importing encapsulated PostScript
+% powerful as {\sf METAPOST} or importing encapsulated PostScript
% files. Suggestions or criticisms by email are
% welcome. Version \fileversion\ has benefitted greatly from previous
% help. The latest versions are first available at URL:
% \begin{verbatim}
-% ftp://ilm.mech.unsw.edu.au/pub/archive/latex/macros/curves/
+% http://patch.bpa.nu/pub/archive/latex/macros/curves/
% \end{verbatim}
% At your local CTAN mirror the latest version should be near the
% directory for the latest version of \LaTeX. Please use
@@ -1044,7 +1107,7 @@
% \subsection{Registers}
% Counts
%
-% \noindent number of symbols on Bezier segment
+% \noindent number of symbols on parabolic arc
% \begin{macrocode}
\newcount\;sc
\newcount\;scp
@@ -1109,6 +1172,10 @@
% \begin{macrocode}
\newif\ifcurvewarn \curvewarntrue
% \end{macrocode}
+% Plot straightline segments instead of curves.
+% \begin{macrocode}
+\newif\ifstraight
+% \end{macrocode}
% coordinate number correct
% \begin{macrocode}
\newif\if;ccn
@@ -1319,6 +1386,10 @@
\ifnum\;cc=\tw@ \;slbezd \;slbez
\else \;scbezd\;dx\;ddx\;xa\;xb\;xc \;scbezd\;dy\;ddy\;ya\;yb\;yc
\;bezier \;tagcurve{#2}\ifnum\;cc>6\;endcurve\fi \fi}\fi}
+% \end{macrocode}
+% \(|#1|= (|#4|-|#3|- (|#5|-|#3|)/4)|\unitlength|\),
+% \(|#2|=(|#5|-|#3|)|\unitlength|/4\).
+% \begin{macrocode}
\newcommand\;scbezd[5]{\;slcd#2#3#5\divide#24\;slcd#1#3#4\advance#1-#2}
\newcommand\;xa{} \newcommand\;xb{} \newcommand\;xc{}
\newcommand\;ya{} \newcommand\;yb{} \newcommand\;yc{}
@@ -1494,24 +1565,27 @@
\newcommand\;slbezd{\;slcd\;dx\;xa\;xb \;slcd\;dy\;ya\;yb}
% \end{macrocode}
-% Calculates difference between two coordinates.
+% Calculates \(|#1| = (|#3|-|#2|)|\unitlength|\).
% \begin{macrocode}
\newcommand\;slcd[3]{#1#3\unitlength \advance#1-#2\unitlength}
% \end{macrocode}
-% Calculates differences for bezier straight line.
+% Calculates differences for |bezier| straight line.
% \begin{macrocode}
\newcommand\;slbez{\divide\;dx\tw@ \;ddx\;dx \divide\;dy\tw@
\;ddy\;dy \;bezier}
% \end{macrocode}
+% |\;bezier| is called by all curve and polygon drawing commands.
+% If straight line between points |\;bezier| recalculates differences.
% Scales segment differences, then calculates segment pattern and disk count,
% and initial disk differences; selects line or dashes. Dash patterns
% were originally measured out in multiples of the disk pitch and are currently
% in points but can be adjusted with |\patternresolution|. This should
% be reprogrammed in scaled points.
% \begin{macrocode}
-\newcommand\;bezier{\;scale\;dx\;dy \;scp\;rc \;scale\;ddx\;ddy
+\newcommand\;bezier{\ifstraight \av;d\;dx\;ddx \av;d\;dy\;ddy \fi
+ \;scale\;dx\;dy \;scp\;rc \;scale\;ddx\;ddy
\advance\;scp\;rc \;bezc\;dx\;ddx \;bezc\;dy\;ddy \;rxy\;ddx\;ddy
\divide\;rc\p@ \advance\;rc\thr@@
\;tc\;rc \ifnum\;rc>\sixt@@n\;rc\sixt@@n\fi
@@ -1520,7 +1594,7 @@
\global\advance\curvelength\;rc sp\;mcnd\@ne
% \end{macrocode}
% Here |\;t| is the number of straight line segments making current
-% bezier segment and |\;rc| is the length of the bezier segment in
+% parabolic arc and |\;rc| is the length of the parabolic arc in
% scaled points.
% \begin{macrocode}
\ifdim\;pl>\z@ \;np\;rc \divide\;np\;psc
@@ -1541,20 +1615,36 @@
\fi
% \end{macrocode}
% Here |\;mcnd| is the number of pattern increments in a straight
-% segment and |\;t| in the bezier segment.
+% segment and |\;t| in the parabolic arc.
% |\;np| is the number of complete patterns when known.
%
-% The calculation following ensures that the end point of the bezier
-% curve is as accurate as possible.
+% The calculation following ensures that the end point of the parabolic
+% arc is as accurate as possible.
% \begin{macrocode}
\;rtc\;t \divide\;rtc\;mcnd \;tcb\;rtc \multiply\;tcb\;t
\advance\;rtc\m@ne \multiply\;rtc\;t \;tc\;t \advance\;tc\;tc
\;bezd\;dx\;ddx \;bezd\;dy\;ddy
\ifdim\;pl>\z@ \;dashes \else \let\n;xt\;spoints \;spoints \fi}
+% \end{macrocode}
+% |\av;d| replaces each of |#1| and |#2| by \((|#1|+|#2|)/2\).
+% \begin{macrocode}
+\newcommand\av;d[2]{\advance#1#2\divide#1\tw@#2#1}
+% \end{macrocode}
+% |\;scale| replaces each of dimen parameters |#1| and |#2| by scaled
+% values and writes their scaled vector length to |\;rc|.
+% \begin{macrocode}
\newcommand\;scale[2]{\;td\xscale#1\advance\;td\xscaley#2%
#2\yscale#2\advance#2\yscalex#1#1\;td \;rxy#1#2}
+% \end{macrocode}
+% |\;bezc| replaces dimen parameters |#1| and |#2| by \(2(|#1|+|#2|)\) and
+% \(2(|#2|-|#1|)\) respectively.
+% \begin{macrocode}
\newcommand\;bezc[2]{\advance#1#1\advance#2#2%
\;td#2\advance#2-#1\advance#1\;td}
+% \end{macrocode}
+% |\;bezd| replaces dimen parameter |#1| by
+% \((|#1|-|\;rtc||#2|/|\;tcb|)/|\;tc|\) and |#2| by \(|#2|/|\;tcb|\).
+% \begin{macrocode}
\newcommand\;bezd[2]{\divide#2\;tcb \;td#2\multiply\;td\;rtc
\advance#1-\;td \divide#1\;tc}
@@ -1611,11 +1701,11 @@
%
% |\;scp| = distance between points.
%
-% |\;rc| = length of Bezier segment.
+% |\;rc| = length of parabolic arc.
%
-% |\;rtc| = total points in Bezier segment.
+% |\;rtc| = total points in parabolic arc.
%
-% |\;np| = number of whole patterns in Bezier segment or scratch.
+% |\;np| = number of whole patterns in parabolic arc or scratch.
%
% |\;overhang| = of dash pattern past symbol or end of segment.
%
@@ -1817,3 +1907,14 @@ curvesls.sty 1.0 21 Mar 1993 draw lines using emTeX dvidriver \special's.
Greater accuracy and speed and less memory in use.
2047 nett extra words of TeX main memory to load with no option
down to 1913 with WML option.
+1.51 24 April 2008 7th Internet release
+ Email address now <ilm@patch.bpa.nu>
+1.52 22 August 2008 8th Internet release
+ Copyright licence now LPPL version 1.3.
+ Correction:
+ new upstream website
+ http://patch.bpa.nu/pub/archive/latex/macros/curves/.
+ Improvements:
+ straight lines for parabolic arcs switch;
+ more macro documentation;
+ reworded instructions and README.