diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-04 21:13:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-04 21:13:32 +0000 |
commit | e242e2da315de7f5e9c7c7ab8f078f17cdcde5e6 (patch) | |
tree | fa6ade4b31f83d23581e3767a1509e58b2b2e558 /Master/texmf-dist/source/latex | |
parent | 1e3598faa2c913da7dda4fc84b39ba5e444d7a2a (diff) |
curve2e (4oct20)
git-svn-id: svn://tug.org/texlive/trunk@56538 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/curve2e/curve2e.dtx | 147 |
1 files changed, 41 insertions, 106 deletions
diff --git a/Master/texmf-dist/source/latex/curve2e/curve2e.dtx b/Master/texmf-dist/source/latex/curve2e/curve2e.dtx index 748a8e38d23..0367ab88e0b 100644 --- a/Master/texmf-dist/source/latex/curve2e/curve2e.dtx +++ b/Master/texmf-dist/source/latex/curve2e/curve2e.dtx @@ -27,7 +27,7 @@ README.txt and curve2e-v161.sty. \askforoverwritefalse \generate{\file{curve2e.sty}{\from{curve2e.dtx}{package}}} -\generate{\file{README.txt}{\from{curve2e.dtx}{readme}}} +%\generate{\file{README.txt}{\from{curve2e.dtx}{readme}}} \generate{\file{curve2e-v161.sty}{\from{curve2e.dtx}{v161}}} \def\tmpa{plain} @@ -46,7 +46,7 @@ README.txt and curve2e-v161.sty. %<+package>\ProvidesPackage{curve2e}% %<+readme>File README.txt for package curve2e %<*package|readme> - [2020-05-03 v.2.2.8 Extension package for pict2e] + [2020-10-03 v.2.2.10 Extension package for pict2e] %</package|readme> %<*driver> \documentclass{ltxdoc}\errorcontextlines=9 @@ -183,7 +183,7 @@ README.txt and curve2e-v161.sty. %</driver> % \fi % -% \CheckSum{5598} +% \CheckSum{5510} % \begin{abstract} % This file documents the |curve2e| extension package to the |pict2e| % bundle implementation; the latter was described by Lamport @@ -1093,89 +1093,21 @@ README.txt and curve2e-v161.sty. % for straight lines. % % We start with the redefinition of |\vector| and we use the machinery -% for vectors (as complex numbers) we used for |\line|. -% \begin{macrocode} - \def\vector(#1)#2{% - \begingroup - \GetCoord(#1)\d@mX\d@mY - \@linelen#2\unitlength -% \end{macrocode} -% As in \texttt{pict2e} we avoid tracing vectors if the slope parameters -% are both zero. -% \begin{macrocode} - \ifdim\d@mX\p@=\z@\ifdim\d@mY\p@=\z@\@badlinearg\fi\fi -% \end{macrocode} -% But we check only for the positive nature of the $l_x$ component; if it -% is negative, we simply change sign instead of blocking the typesetting -% process. This is useful also for macros |\Vector|, |\VECTOR|, and -% |\VVECTOR| to be defined in a while. -% \begin{macrocode} - \ifdim\@linelen<\z@ \@linelen=-\@linelen\fi -% \end{macrocode} -% We now make a vector with the given slope coefficients even if one or -% the other is zero and we determine its direction; the real and -% imaginary parts of the direction vector are also the values we need for -% the subsequent rotation. -% \begin{macrocode} - \MakeVectorFrom\d@mX\d@mY to\@Vect - \DirOfVect\@Vect to\Dir@Vect -% \end{macrocode} -% In order to be compatible with the original \texttt{pict2e} we need to -% transform the components of the vector direction into lengths with the -% specific names |\@xdim| and |\@ydim|^^A--------! Really necessary? -% \begin{macrocode} - \YpartOfVect\Dir@Vect to\@ynum \@ydim=\@ynum\p@ - \XpartOfVect\Dir@Vect to\@xnum \@xdim=\@xnum\p@ -% \end{macrocode} -% If the vector is really sloping we need to scale the $l_x$ component in -% order to get the vector total length; we have to divide by the cosine -% of the vector inclination which is the real part of the vector -% direction. -% We use the floating point division function; since it yields a -% “factor” that we directly use to scale the length of the vector. -% We finally memorise the true vector length in the internal dimension -% |@tdB| -% \begin{macrocode} - \ifdim\d@mX\p@=\z@ - \else\ifdim\d@mY\p@=\z@ - \else - \edef\sc@lelen{\fpeval{1 / abs(\@xnum)}}\relax - \@linelen=\sc@lelen\@linelen - \fi - \fi - \@tdB=\@linelen -% \end{macrocode} -% The remaining code is definitely similar to that of |pict2e|; -% the real difference consists in the fact that the arrow is designed by -% itself without the stem; but it is placed at the vector end; therefore -% the first statement is just the transformation matrix used by the -% output driver to rotate the arrow tip and to displace it the right -% amount. But in order to draw only the arrow tip we have to set the -% |\@linelen| length to zero. -% \begin{macrocode} -\pIIe@concat\@xdim\@ydim{-\@ydim}\@xdim{\@xnum\@linelen}{\@ynum\@linelen}% - \@linelen\z@ - \pIIe@vector - \fillpath -% \end{macrocode} -% Now we can restore the stem length that must be shortened by the -% dimension of the arrow; by examining the documentation of -% |pict2e| we discover that we have to shorten it by an -% approximate amount of $AL$ (with the notations of \texttt{pict2e}, -% figs~10 and~11); the arrow tip parameters are stored in certain -% variables with which we can determine the amount of the stem -% shortening; if the stem was too short and the new length is negative, -% we avoid designing such a stem. -% \begin{macrocode} - \@linelen=\@tdB - \@tdA=\pIIe@FAW\@wholewidth - \@tdA=\pIIe@FAL\@tdA - \advance\@linelen-\@tdA - \ifdim\@linelen>\z@ - \moveto(0,0) - \pIIe@lineto{\@xnum\@linelen}{\@ynum\@linelen}% - \strokepath\fi - \endgroup} +% for vectors (as complex numbers) we used for |\line|. The actual point +% is to let |\vector| accept the slope parameters also in polar form. +% Therefore it suffices to save the original definition of |\vector| +% as defined in |pict2e| and and use it as a fallback after redefining +% |\vector| in a “vector” format.\footnote{The previous version 2.2.9 +% of this package contained a glitch that was visible only with line +% widths larger than 1.5\.pt. I thank very much Ashish Kumar Das who +% spotted this glitch and kindly informed me.} +% \begin{macrocode} +\let\original@vector\vector +\def\vector(#1)#2{% + \begingroup + \GetCoord(#1)\d@mX\d@mY + \original@vector(\d@mX,\d@mY){\fpeval{round(abs(#2),6)}}% + \endgroup}% % \end{macrocode} % % We define the macro that does not require the specification of the @@ -1229,7 +1161,7 @@ README.txt and curve2e-v161.sty. %^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % We now define the polygonal line macro; its syntax is very simple: % \begin{flushleft}\ttfamily -% \cs{polygonal}\oarg{join}\parg{$P_0$}\parg{$P_1$}\parg{$P_2$}...^^A +% \cs{polyline}\oarg{join}\parg{$P_0$}\parg{$P_1$}\parg{$P_2$}...^^A %\parg{$P_n$} % \end{flushleft} % Remember: |\polyline| has been incorporated into |pict2e| 2009, but we @@ -3153,8 +3085,9 @@ curve2e.pdf curve2e-manual.pdf README.txt +If you install curve2e without using your TeX system package handler, Compile curve2e.dtx and curve2e-manual.tex two or three times until -all labels and citation keys are completely resolved. +all labels and citation keys are completely resolved. Then move the primary and derived files as follows: Move curve2e.dtx and curve2e-manual.tex to ROOT/source/latex/curve2e/ Move curve2e.pdf and curve2e-manual.pdf to ROOT/doc/latex/curve2e/ @@ -3162,21 +3095,23 @@ Move curve2e.sty and curve2e-v161.sty to ROOT/tex/latex/curve2e/ Move README.txt to ROOT/doc/latex/curve2e/ curve2e.dtx is the documented TeX source file of the derived files -curve2e.sty, curve2e-v161.sty and README.txt. +curve2e.sty, curve2e.pdf, curve2e-v161.sty and README.txt. You get curve2e.sty, curve2e.pdf, curve2e-v161.sty, and README.txt by running pdflatex on curve2e.dtx. The curve2e-manual files contains the user manual; in -this way the long preliminary descriptive part has been transferred to -a shorter dedicated file, and the “normal” user should have enough -information to use the package. Th curve2e.pdf file, extracted from -the .dtx one, contains the code documentation and is intended for the -developers, or for the curious advanced users. For what concerns -curve2e-v161.sty is a previous version of this package; see below why -the older version might become necessary to the end user. +this way the long preliminary descriptive part of the previous versions +curve2e.pdf file has been transferred to shorter dedicated file, and the +"normal" user should have enough information to use the package. The +curve2e.pdf file, extracted from the .dtx one, contains the code +documentation and is intended for the developers, or for the curious +advanced users. For what concerns curve2e-v161.sty, it is a previous +version of this package; see below why the older version might become +necessary to the end user. README.txt, this file, contains general information. + This bundle contains also package curve2e-v161.sty, a roll-back version needed in certain rare cases. @@ -3185,15 +3120,15 @@ standard picture LaTeX environment according to what Leslie Lamport specified in the second edition of his LaTeX manual (1994). This further extension curve2e.sty to pict2e.sty allows to draw lines -and vectorsith any non integer slope parameters, to draw dashed and dotted -lines of any slope, to draw arcs and curved vectors, to draw curves where -just the interpolating nodes are specified together with the slopes at -such nodes; closed paths of any shape can be filled with color; all -coordinates are treated as ordered pairs, i.e. 'complex numbers'; -coordinates may be expressed also in polar form. Coordinates may be -specified with macros, so that editing any drawing is rendered much -simpler: any point specified with a macro is modified only once in -its macro definition. +and vectors with any non integer slope parameters, to draw dashed and +dotted lines of any slope, to draw arcs and curved vectors, to draw +curves where just the interpolating nodes are specified together with +the slopes at such nodes; closed paths of any shape can be filled with +color; all coordinates are treated as ordered pairs, i.e. "complex +numbers"; coordinates may be expressed also in polar form. Coordinates +may be specified with macros, so that editing any drawing is rendered +much simpler: any point specified with a macro is modified only once +in its macro definition. Some of these features have been incorporated in the 2009 version of pict2e; therefore this package avoids any modification to the original pict2e commands. In any case the version of curve2e is compatible with @@ -3221,7 +3156,7 @@ If you specify the package pict2e is automatically invoked with the specified options. The -almost fully compatible- phrase is necessary to explain that this -version of curve2e uses some `functions' of the LaTeX3 language that were +version of curve2e uses some "functions" of the LaTeX3 language that were made available to the LaTeX developers by mid October 2018. Should the user have an older or a basic/incomplete installation of the TeX system, such L3 functions might not be available. This is why this |