summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-25 01:20:13 +0000
committerKarl Berry <karl@freefriends.org>2020-02-25 01:20:13 +0000
commitc1ab1e338ec295e77a4e66c90e809d183b4da895 (patch)
treeaad5fa35895461644c319891c98d10ae793e4c25
parentee9bd506b9173d5ba88462a23050a184dcf99cca (diff)
curve2e (25feb20)
git-svn-id: svn://tug.org/texlive/trunk@53900 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/curve2e/README.txt2
-rw-r--r--Master/texmf-dist/doc/latex/curve2e/curve2e-2.2.1.zipbin0 -> 1242805 bytes
-rw-r--r--Master/texmf-dist/doc/latex/curve2e/curve2e-manual.pdfbin566234 -> 566328 bytes
-rw-r--r--Master/texmf-dist/doc/latex/curve2e/curve2e-manual.tex29
-rw-r--r--Master/texmf-dist/doc/latex/curve2e/curve2e.pdfbin607171 -> 614651 bytes
-rw-r--r--Master/texmf-dist/source/latex/curve2e/curve2e.dtx102
-rw-r--r--Master/texmf-dist/tex/latex/curve2e/curve2e.sty23
7 files changed, 101 insertions, 55 deletions
diff --git a/Master/texmf-dist/doc/latex/curve2e/README.txt b/Master/texmf-dist/doc/latex/curve2e/README.txt
index ea1f9413524..a1747873263 100644
--- a/Master/texmf-dist/doc/latex/curve2e/README.txt
+++ b/Master/texmf-dist/doc/latex/curve2e/README.txt
@@ -10,7 +10,7 @@
%% License information appended
%%
File README.txt for package curve2e
- [2020-01-29 v.2.2.1 Extension package for pict2e]
+ [2020-02-24 v.2.2.2 Extension package for pict2e]
The package bundle curve2e is composed of the following files
curve2e.dtx
diff --git a/Master/texmf-dist/doc/latex/curve2e/curve2e-2.2.1.zip b/Master/texmf-dist/doc/latex/curve2e/curve2e-2.2.1.zip
new file mode 100644
index 00000000000..920373947b1
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/curve2e/curve2e-2.2.1.zip
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.pdf b/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.pdf
index 27ace5e0caa..5183f38d8c6 100644
--- a/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.pdf
+++ b/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.tex b/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.tex
index 442bb426505..36d4ae7d574 100644
--- a/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.tex
+++ b/Master/texmf-dist/doc/latex/curve2e/curve2e-manual.tex
@@ -511,7 +511,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
\begin{Esempio}[\small](0.60)
\unitlength=0.01\linewidth
\begin{picture}(80,20)
-\GraphGrid(80,20)
+\AutoGrid
\put(0,0){\vector(1.5,2.3){10}}
\put(20,0){\Vector(10,15.33333)}
\VECTOR(40,0)(50,15.33333)
@@ -550,7 +550,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
\begin{Esempio}[\normalsize]%
\unitlength=0.02\textwidth
\begin{picture}(40,30)
-\GraphGrid(40,30)
+\AutoGrid(40,30)
\Zbox(40,0)[l]{40,0}[1]
\Zbox(90:30)[bc]{90{:}30}[1]
\Zbox(60:30)[bc]{60{:}30}[1]
@@ -603,7 +603,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
\begin{Esempio}[\normalsize]%
\unitlength=1mm
\begin{picture}(40,40)
-\GraphGrid(40,40)
+\AutoGrid(40,40)
\Dashline(0,0)(40,10){4}
\put(0,0){\circle*{2}}
\Dashline(40,10)(0,25){4}
@@ -625,7 +625,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
\begin{Esempio}[\normalsize]%
\unitlength=0.025\textwidth
\begin{picture}(40,30)
-\GraphGrid(40,30)
+\AutoGrid(40,30)
\Dashline(0,0)(40,10){2}
\Dashline(0,0)(40,20){2}
\Dashline(0,0)(40,30){2}
@@ -656,7 +656,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
\begin{Esempio}[\normalsize]%
\unitlength=0.025\textwidth
\begin{picture}(40,30)
-\GraphGrid(40,30)
+\AutoGrid(40,30)
\Dotline(0,0)(40,10){1.5}[2pt]
\Dotline(0,0)(40,20){1.5}[2pt]
\Dotline(0,0)(40,30){1.5}[2pt]
@@ -676,12 +676,12 @@ Remember to delete all these subfolders if you decide to install a complete upda
\label{fig:dottedlines}
\end{figure}
%%>>>
- \item |\GraphGrid| is a command that draws a red grid under the drawing
- with lines separated |10\unitlength|s apart; it is described only with
- a comma separated couple of numbers, representing the base and the
- height of the grid, see figure~\ref{fig:dashline}; it's better to
- specify multiples of ten and the grid can be placed anywhere in the
- drawing canvas by means of |\put|, whose cartesian coordinates are
+ \item |\GraphGrid| and |\AutoGrid| are commands that draw a red grid
+ under the drawing with lines separated |10\unitlength|s apart; it is
+ described only with a comma separated couple of numbers, representing the
+ base and the height of the grid, see figure~\ref{fig:dashline}; it's
+ better to specify multiples of ten and the grid can be placed anywhere in
+ the drawing canvas by means of |\put|, whose cartesian coordinates are
multiples of 10; nevertheless the grid line distance is rounded to the
nearest multiple of 10, while the point coordinates specified to |\put|
are not rounded at all; therefore some care should be used to place the
@@ -689,10 +689,11 @@ Remember to delete all these subfolders if you decide to install a complete upda
while drawing; even if you sketch your drawing on millimetre paper, the
drawing grid turns out to be very useful; one must only delete or
comment out the command when the drawing is finished. Several examples
- of usage of such grid are shown in several figures.
+ of usage of such grid are shown in several figures. |\Autogrid| does not
+ require arguments; if the latter are specified they are simply ignored.
%%
\item New trigonometric function macros have been computed by means of
- the functionalities of the |xfp| package. The difference woth the other
+ the functionalities of the |xfp| package. The difference with the other
existing macros is that angles are specified in sexagesimal degrees, so
that the users need not transform to radians. The computations are done
taking into account that “abnormal” values can occasionally be avoided,
@@ -866,7 +867,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
%\def\y(#1){(13*cos(#1)-5*cos(2*#1)-2*cos(3*#1)-cos(4*#1))/16}
% Varrebbe a penda di provarle con curve2e
%
- \begin{figure}[!htb]
+ \begin{figure}[!htp]
\begin{Esempio}[\small]%
\unitlength=8mm\relax
\begin{picture}(5,5)
diff --git a/Master/texmf-dist/doc/latex/curve2e/curve2e.pdf b/Master/texmf-dist/doc/latex/curve2e/curve2e.pdf
index 536c56b9d58..eb283322f53 100644
--- a/Master/texmf-dist/doc/latex/curve2e/curve2e.pdf
+++ b/Master/texmf-dist/doc/latex/curve2e/curve2e.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/curve2e/curve2e.dtx b/Master/texmf-dist/source/latex/curve2e/curve2e.dtx
index d3877066764..0b35ef2c19b 100644
--- a/Master/texmf-dist/source/latex/curve2e/curve2e.dtx
+++ b/Master/texmf-dist/source/latex/curve2e/curve2e.dtx
@@ -46,7 +46,7 @@ README.txt and curve2e-v161.sty.
%<+package>\ProvidesPackage{curve2e}%
%<+readme>File README.txt for package curve2e
%<*package|readme>
- [2020-01-29 v.2.2.1 Extension package for pict2e]
+ [2020-02-24 v.2.2.2 Extension package for pict2e]
%</package|readme>
%<*driver>
\documentclass{ltxdoc}\errorcontextlines=9
@@ -179,7 +179,7 @@ README.txt and curve2e-v161.sty.
%</driver>
% \fi
%
-% \CheckSum{5578}
+% \CheckSum{5582}
% \begin{abstract}
% This file documents the |curve2e| extension package to the |pict2e|
% bundle implementation; the latter was described by Lamport
@@ -403,9 +403,9 @@ README.txt and curve2e-v161.sty.
% prohibited to use them; by themselves such arcs are not different form
% those used by |Curve|, but the final command, |\FillCurve|, should be
% used in place of |\CurveFinish|, so as to fill up the closed path with
-% the locally specified color; see figure~\ref{fig:colored-curve}.
-% It is much more convenient to use the starred version of the |\Curve|
-% macro.
+% the locally specified color; see the documentation |curve2e-manual.pdf|
+% file. It is much more convenient to use the starred version of the
+% |\Curve| macro.
% \end{enumerate}
%
% The |pict2e| package already defines macros such as |\moveto|,
@@ -753,10 +753,8 @@ README.txt and curve2e-v161.sty.
% always referred to the origin of the coordinate axes; the end point
% $P_2$ coordinates are referred to the origin of the axes if in
% cartesian form, while with the polar form they are referred to $P_1$;
-% both coordinate types have their usefulness and
-% figures~\ref{fig:dashedlines} on page~\pageref{fig:dashedlines}
-% and~\ref{fig:dottedlines} on page~\pageref{fig:dottedlines} show how
-% to use such coordinate types.
+% both coordinate types have their usefulness: see the documentation
+% |curve2e-manual.pdf| file.
%
% The above mentioned macros create dashed lines between two given
% points, with a dash length that must be specified, or dotted lines,
@@ -988,7 +986,7 @@ README.txt and curve2e-v161.sty.
% course it is the user responsibility to pay attention to the scales of
% the two axes and to write meaningful expressions; the figure and code
% shown in the first part of this documentation show some examples:
-% see pages~\pageref{pag:multiput} and~\pageref{pag:orologio}.
+% see the documentation |curve2e-manual.pdf| file.
% \begin{macrocode}
\RenewDocumentCommand{\multiput}{O{0,0} d() d() m m o }{%
\IfNoValueTF{#2}{\PackageError{curve2e}%
@@ -1204,8 +1202,8 @@ README.txt and curve2e-v161.sty.
% The \texttt{pict2e} documentation says that if the vector length is
% zero the macro draws only the arrow tip; this may work with macro
% |\vector|, certainly not with |\Vector| and |\VECTOR|. This might be
-% useful for adding an arrow tip to a circular arc. See examples in
-% figure~\ref{fig:vectors} on page~\pageref{fig:vectors}.
+% useful for adding an arrow tip to a circular arc. See the documentation
+% |curve2e-manual.pdf| file.
%
%
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1350,7 +1348,43 @@ README.txt and curve2e-v161.sty.
% a single argument is assumed to contain the grid dimensions, while
% if both arguments are given, the first one is the lower left corner
% offset, and the second one the grid dimensions.
-% \begin{macrocode}
+%
+% In order to render the red grid a little more automatic, a subsidiary
+% service macro of the |picture| environment has been redefined in order
+% to store the coordinates of the lower left and upper right corners
+% of the canvas (the compulsory dimensions and the optional lower left
+% corner shift arguments to the |picture| opening statement) in two
+% new variables, so that when the user specifies the (non vanishing)
+% dimensions of the canvas, the necessary data are already available
+% and there is no need to repeat them to draw the grid. The new
+% argument-less macro is named |\AutoGrid|, while the complete
+% macro is |\GraphGrid| that requires its arguments as specified
+% before. The advantage of the availability of both commands,
+% consists in the fact that |\AutoGrid| covers the whole canvas,
+% while |\GraphGrid| may compose a grid that covers either the whole
+% canvas or just a part of it. In both cases, though, it is necessary
+% the all the canvas coordinates are specified as multiples of 10
+% (|\unitlength|s). This is simple when |\GraphGrid| is used, while
+% with |\AutoGrid| the specification is in the opening environment
+% statement; and such multiples of 10 might not be the best ones
+% for the final drawing and should be fine tuned after finishing
+% the drawing and the grid is not necessary anymore.
+% The actual |\AutoGrid| command definition accepts two parenthesis
+% delimited arguments, that are not being used in the macro expansion;
+% in this way it is easier to replace |\GraphGrid| with |\AutoGrid| if
+% it is desired to do so. The opposite action, of corse is not so simple
+% if the |\AutoGrid| command is not followed by one or two arguments
+% as |\GraphGrid| requires.
+% \begin{macrocode}
+\def\@picture(#1,#2)(#3,#4){%
+ \edef\pict@urcorner{#1,#2}% New statement
+ \edef\pict@llcorner{#3,#4}% New statement
+ \@picht#2\unitlength
+ \setbox\@picbox\hb@xt@#1\unitlength\bgroup
+ \hskip -#3\unitlength
+ \lower #4\unitlength\hbox\bgroup
+ \ignorespaces}
+%
\def\Gr@phGrid(#1,#2){\bgroup\textcolor{red}{\linethickness{.1\p@}%
\RoundUp#1modulo10to\@GridWd \RoundUp#2modulo10to\@GridHt
\@tempcnta=\@GridWd \divide\@tempcnta10\relax \advance\@tempcnta\@ne
@@ -1358,21 +1392,23 @@ README.txt and curve2e-v161.sty.
\@tempcnta=\@GridHt \divide\@tempcnta10\advance\@tempcnta\@ne
\multiput(0,0)(0,10){\@tempcnta}{\line(1,0){\@GridWd}}\thinlines}%
\egroup\ignorespaces}
+
+\NewDocumentCommand\AutoGrid{d() d()}{\bgroup%
+\put(\pict@llcorner){\expandafter\Gr@phGrid\expandafter(\pict@urcorner)}%
+\egroup\ignorespaces}
+
+
\NewDocumentCommand\GraphGrid{r() d()}{%
\IfValueTF{#2}{\put(#1){\Gr@phGrid(#2)}}%
{\put(0,0){\Gr@phGrid(#1)}}}
% \end{macrocode}
% Rounding up is useful because also the grid margins fall on coordinates
-% multiples of 10. It resorts to the |\Integer| macro that will be
-% described in a while.
+% multiples of 10.
% \begin{macrocode}
-\def\RoundUp#1modulo#2to#3{\expandafter\@tempcnta\Integer#1.??%
-\count254\@tempcnta\divide\count254by#2\relax
-\multiply\count254by#2\relax
-\count252\@tempcnta\advance\count252-\count254
-\ifnum\count252>0\advance\count252-#2\relax
-\advance\@tempcnta-\count252\fi\edef#3{\number\@tempcnta}\ignorespaces}%
+\def\RoundUp#1modulo#2to#3{
+\edef#3{\fpeval{(ceil(#1/#2,0))*#2}}}%
+%
% \end{macrocode}
% The |\Integer| macro takes a possibly fractional number whose decimal
% separator, if present, \textit{must} be the decimal point and uses the
@@ -1392,7 +1428,8 @@ README.txt and curve2e-v161.sty.
% This is not the place to complain about the fact that all programs of
% the \TeX\ system used only integer arithmetics; now, with the 2018
% distribution of the modern \TeX\ system, package |xfp| is available:
-% this package resorts in the background to language \LaTeX\,3; this language now can compute fractional number
+% this package resorts in the background to language \LaTeX\,3; this
+% language now can compute fractional number
% operations coded in decimal, not in binary, and accepts also numbers
% written in the usual way in computer science, that is as a fractional,
% possibly signed, number followed by an expression that contains the
@@ -2074,8 +2111,8 @@ README.txt and curve2e-v161.sty.
% control points lay on the perpendicular to the vectors that join the
% arc center to the starting and end points respectively.
%
-% With reference to figure~\ref{fig:arcspline} on
-% page~\pageref{fig:arcspline}, the points $P_1$ and $P_2$
+% With reference to figure~11 of the documentation |curve2e-manual.pdf|
+% file, the points $P_1$ and $P_2$
% are the arc end-points; $C_1$ and $C_2$ are the Bézier-spline
% control-points; $P$ is the arc mid-point, that should be distant from
% the center of the arc the same as $P_1$ and $P_2$.
@@ -2535,8 +2572,8 @@ README.txt and curve2e-v161.sty.
% \end{macrocode}
%
-% An example of use is shown in figure~\ref{fig:Cbezier} on
-% page~\pageref{fig:Cbezier}; notice that the tangents at the end points
+% An example of use is shown in figure~13 of the |curve2e-manual.pdf| file;
+% notice that the tangents at the end points
% are the same for the black curve drawn with |\CurveBetween| and the
% five red curves drawn with |\CbezierBetween|; the five red curves
% differ only for the distance of their control point $C_0$ from the
@@ -2771,8 +2808,8 @@ README.txt and curve2e-v161.sty.
% macro |\CbezierBetween| in order to use the general internal cubic
% Bézier splines in a more comfortable way.
%
-% As it can be seen in figure~\ref{fig:sinewave} on
-% page~\pageref{fig:sinewave} the two diagrams should approximately
+% As it can be seen in figure~15 of the |curve2e-manual.pdf| file, the
+% two diagrams should approximately
% represent a sine wave. With Bézier curves, that resort on polynomials,
% it is impossible to represent a transcendental function, but it is only
% possible to approximate it. It is evident that the approximation
@@ -3000,17 +3037,16 @@ README.txt and curve2e-v161.sty.
% \end{macrocode}
%
% An example of usage is shown at the left in
-% figure~\ref{fig:quadratic-arcs}\footnote{The commands \cs{legenda},
+% figure~16\footnote{The commands \cs{legenda},
% \cs{Pall} and \cs{Zbox} are specifically defined in the preamble of
% this document; they must be used within a \texttt{picture} environment.
% \cs{legenda} draws a framed legend made up of a single (short) math
-% formula; \cs{Pall} is just a shorthand to put a filled small circle at a
+% formula; \cs{Pall} is just a shorthand to put a sized dot at a
% specified position' \cs{Zbox} puts a symbol in math mode a little
% displaced in the proper direction relative to a specified position.
% They are just handy to label certain objects in a \texttt{picture}
-% diagram, but they are not part of the \texttt{curve2e} package.} on
-% page~\pageref{fig:quadratic-arcs} created with the code shown in the
-% same page.
+% diagram, but they are not part of the \texttt{curve2e} package.} in
+% figure~16 created with the code shown in the same page as the figure.
%
% Notice also that the inflexed line is made with two arcs that meet at
% the inflection point; the same is true for the line that resembles
diff --git a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
index e1178ec444f..a242d865723 100644
--- a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
+++ b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
@@ -11,7 +11,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2019/01/01]
\ProvidesPackage{curve2e}%
- [2020-01-29 v.2.2.1 Extension package for pict2e]
+ [2020-02-24 v.2.2.2 Extension package for pict2e]
\IfFileExists{xfp.sty}{%
\RequirePackage{color}
\RequirePackageWithOptions{pict2e}[2014/01/01]
@@ -277,6 +277,14 @@
\endgroup
\ignorespaces}}
+\def\@picture(#1,#2)(#3,#4){%
+ \edef\pict@urcorner{#1,#2}% New statement
+ \edef\pict@llcorner{#3,#4}% New statement
+ \@picht#2\unitlength
+ \setbox\@picbox\hb@xt@#1\unitlength\bgroup
+ \hskip -#3\unitlength
+ \lower #4\unitlength\hbox\bgroup
+ \ignorespaces}
\def\Gr@phGrid(#1,#2){\bgroup\textcolor{red}{\linethickness{.1\p@}%
\RoundUp#1modulo10to\@GridWd \RoundUp#2modulo10to\@GridHt
\@tempcnta=\@GridWd \divide\@tempcnta10\relax \advance\@tempcnta\@ne
@@ -284,16 +292,17 @@
\@tempcnta=\@GridHt \divide\@tempcnta10\advance\@tempcnta\@ne
\multiput(0,0)(0,10){\@tempcnta}{\line(1,0){\@GridWd}}\thinlines}%
\egroup\ignorespaces}
+
+\NewDocumentCommand\AutoGrid{d() d()}{\bgroup%
+\put(\pict@llcorner){\expandafter\Gr@phGrid\expandafter(\pict@urcorner)}%
+\egroup\ignorespaces}
+
\NewDocumentCommand\GraphGrid{r() d()}{%
\IfValueTF{#2}{\put(#1){\Gr@phGrid(#2)}}%
{\put(0,0){\Gr@phGrid(#1)}}}
-\def\RoundUp#1modulo#2to#3{\expandafter\@tempcnta\Integer#1.??%
-\count254\@tempcnta\divide\count254by#2\relax
-\multiply\count254by#2\relax
-\count252\@tempcnta\advance\count252-\count254
-\ifnum\count252>0\advance\count252-#2\relax
-\advance\@tempcnta-\count252\fi\edef#3{\number\@tempcnta}\ignorespaces}%
+\def\RoundUp#1modulo#2to#3{
+\edef#3{\fpeval{(ceil(#1/#2,0))*#2}}}%
\def\Integer#1.#2??{#1}%
\def\DividE#1by#2to#3{\edef#3{\fpeval{#1 / #2}}}