summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/curve2e/README.txt6
-rw-r--r--macros/latex/contrib/curve2e/curve2e-manual.pdfbin561047 -> 628856 bytes
-rw-r--r--macros/latex/contrib/curve2e/curve2e-manual.tex523
-rw-r--r--macros/latex/contrib/curve2e/curve2e.dtx128
-rw-r--r--macros/latex/contrib/curve2e/curve2e.pdfbin693186 -> 697772 bytes
-rw-r--r--macros/latex/contrib/exam/README3
-rw-r--r--macros/latex/contrib/exam/exam.cls200
-rw-r--r--macros/latex/contrib/exam/exam.md56
-rw-r--r--macros/latex/contrib/exam/examdoc.pdfbin493628 -> 496243 bytes
-rw-r--r--macros/latex/contrib/exam/examdoc.tex104
-rw-r--r--macros/latex/contrib/tagpdf/README.md4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-backend.dtx8
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-checks.dtx19
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-code.pdfbin1593565 -> 1593088 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-data.dtx18
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx6
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-roles.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-space.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-struct.dtx6
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-tree.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf-user.dtx4
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.dtx6
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.pdfbin1021749 -> 1070622 bytes
-rw-r--r--macros/latex/contrib/tagpdf/tagpdf.tex162
-rw-r--r--macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty2
27 files changed, 922 insertions, 303 deletions
diff --git a/macros/latex/contrib/curve2e/README.txt b/macros/latex/contrib/curve2e/README.txt
index 0cf4cac557..8b21125473 100644
--- a/macros/latex/contrib/curve2e/README.txt
+++ b/macros/latex/contrib/curve2e/README.txt
@@ -5,7 +5,7 @@
%% License information appended
%%
File README.txt for package curve2e
- [2023-01-01 v.2.2.22 Extension package for pict2e]
+ [2023-01-01 v.2.3.1 Extension package for pict2e]
The package bundle curve2e is composed of the following files
curve2e.dtx
@@ -81,7 +81,7 @@ This version of curve2e is almost fully compatible with pict2e dated
2014/01/12 version 0.2z and later; as of today the last pct2e revision
is version 0.4b dated 2020, and curve2e has been tested also with this
revision confirming that it performs as expected.
-Pay attention, though, that in 2020 also the \LaTeX kernel part dealing
+Pay attention, though, that in 2020 also the \LaTeX kernel segment dealing
with the picture environment has been upgraded; since then, the picture
environment opening and internal commands can handle explicit dimensions
and accepts dimensional expressions as those that can be processed by the
@@ -93,7 +93,7 @@ If you specify:
\usepackage[<pict2e options>]{curve2e}
-the package pict2e is automatically invoked with the specified options.
+package pict2e is loaded and curve2e options are automatically passed on to pict2e.
The -almost fully compatible- phrase is necessary to explain that this
version of curve2e uses some `functions' of the LaTeX3 language that were
diff --git a/macros/latex/contrib/curve2e/curve2e-manual.pdf b/macros/latex/contrib/curve2e/curve2e-manual.pdf
index 8ad904a665..ab1c6d5b63 100644
--- a/macros/latex/contrib/curve2e/curve2e-manual.pdf
+++ b/macros/latex/contrib/curve2e/curve2e-manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/curve2e/curve2e-manual.tex b/macros/latex/contrib/curve2e/curve2e-manual.tex
index 5b3c08c697..6e4d3fb9aa 100644
--- a/macros/latex/contrib/curve2e/curve2e-manual.tex
+++ b/macros/latex/contrib/curve2e/curve2e-manual.tex
@@ -110,10 +110,48 @@
\def\fileinfo{##3}}%
\edef\@tempa{\csname ver@#1\endcsname}%
\expandafter\@tempb\@tempa\relax? ? \relax\relax}
+%%%%%%%%%%%%%%%%
+\newenvironment{medaglione}[1][\linewidth]{%
+ \begin{lrbox}{0}%
+ \begin{minipage}{\dimexpr#1-2\fboxsep-2\fboxrule}
+}{%
+ \end{minipage}\end{lrbox}\fbox{\usebox{0}}\relax
+}
+
+\newenvironment{sintassi}{\flushleft\medaglione\obeylines}%
+ {\endmedaglione\endflushleft}
+
+\providecommand\eu{}
+\renewcommand\eu{\ensuremath{\mathrm{e}}}
+%%%%%%%%%%%%%%%%
+\makeatletter
+\NewDocumentCommand\Tbox{D(){0,0} O{cc} m O{0pt} D<>{Z}}{\bgroup
+\edef\TBoxCode{#5}\dimen0=#4\relax %
+\edef\tempE{\fpeval{round(#4/\unitlength,3)}}%
+\put(#1){%
+\ifdim\dimen0=\z@
+ \Zbox(0,0)[#2]{#3}[\z@]%
+\else
+ \if\TBoxCode V\relax
+ \let\tempC=b\relax
+ \if\tempC #2\edef\tempD{0,-\tempE}\else\edef\tempD{0,\tempE}\fi%
+ \segment(0,0)(\tempD)\Zbox(0,0)[#2]{#3}[\z@]%
+ \else
+ \if\TBoxCode H\relax
+ \let\tempC=l\relax%
+ \if\tempC #2\edef\tempD{-\tempE,0}\else\edef\tempD{\tempE,0}\fi%
+ \segment(0,0)(\tempD)\Zbox(0,0)[#2]{#3}[\z@]%
+ \else
+ \typeout{The specified code\space #5\space is invalid!}%
+ \typeout{\string\Tbox\space ignored}%
+ \fi
+ \fi
+\fi
+}\egroup\ignorespaces}%
\begin{document}
-\author{Claudio Beccari\thanks{E-mail: \texttt{claudio dot beccari at gmail dot com}}}
+\author{Claudio Beccari\\{\small\texttt{claudio dot beccari at gmail dot com}}}
\title{Package \pack{curve2e} user manual}
\GetFileInfo{curve2e.sty}
\date{Version \fileversion~--~Last revised \filedate}
@@ -186,8 +224,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
\item Ovals (rectangles with rounded corners) could not be too small
because of the unavailability of small radius quarter circles, nor
could be too large, in the sense that after a certain radius the
- rounded corners remained the same and would not increase proportionally
- to the oval size.
+ rounded corners remained the same curvature and would not increase proportionally to the oval size.
%
\item Vector tips had only one possible shape and matched the limited
number of vector slopes.
@@ -229,8 +266,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
to “naming” points; it eases editing the user's graphic work, because
points that are used several times are specified with a single macro;
it also eases the transmission of coordinates between different macros
- and environments. It is also important for the following feature, i.e.
- the user possibility to use coordinates in both cartesian or polar form.
+ and environments. It is also important for the following feature, described in the following entry..
%
\item Point coordinates my be specified in both cartesian and polar
form: internally they are handled as cartesian coordinates, but the
@@ -238,7 +274,8 @@ Remember to delete all these subfolders if you decide to install a complete upda
confusion with other graphic packages, \pack{curve2e} uses the usual
comma separated couple \meta{$x,y$} of integer or fractional numbers for
cartesian coordinates, and the couple \meta{$\theta$}:\meta{$\rho$} for
- polar coordinates (the angle preceding the radius).
+ polar coordinates (the angle preceding the radius).
+
All graphic object commands accept polar or cartesian coordinates at
the choice of the user who may use for each object the formalism s/he
prefers. Also the |\put| and |\multiput| commands have been redefined so
@@ -250,17 +287,18 @@ Remember to delete all these subfolders if you decide to install a complete upda
coordinates $a,b$ with a normal |\put| command, the circle is placed
exactly in that point; with a normal |\put| command the same happens if
coordinates $\alpha{:}\rho$ are specified.
+
But if the |\put| command is nested into another |\put| command, the
current origin of the axes is displaced — this is obvious and the
purpose of nesting |\put| commands is exactly that. But if a segment
is specified so that its ending point is at a specific distance and in
- specific direction form its starting point, polar coordinates appear to
+ specific direction from its starting point, polar coordinates appear to
be the most convenient to use; in this case, though, the origin of the
axes becomes the starting point of the segment, therefore the segment
- might be drawn in a strange way. Attention has been
- paid to avoid such misinterpretation, but maybe some unusual
- situation may not have come to my mind; feedback is very welcome.
- Meanwhile pay attention when you use polar coordinates.
+ might be drawn in a strange way. Attention has been paid to avoid such
+ misinterpretation, but maybe some unusual situation may not have come to
+ my mind; feedback is very welcome. Meanwhile pay attention when you use
+ polar coordinates.
%
\item At user level most if not all coordinate pairs and slope pairs are
treated as \emph{ordered pairs}, that is \emph{complex numbers}; in
@@ -281,7 +319,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
(up to three digits) integer direction coefficients, but maintaining
the same syntax as in the original \texttt{picture} environment; now
\pack{pict2e} removes the integer number limitations and allows
- fractional values, initially implemented by \pack{curve2e}; direction
+ fractional values, initially implemented by \pack{curve2e}; now direction
coefficients may be specified in polar form.
%
\item A new macro |\Line| was originally defined by \pack{curve2e} so
@@ -301,7 +339,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
\item A new macro |\DashLine| (alias: |\Dline|) is defined in order to
draw dashed lines joining any two given points; the dash length and
gap (equal to one another) get specified through one of the macro
- arguments.The starting point may be specified in cartesiano or polar
+ arguments. The starting point may be specified in cartesiano or polar
form; the end point in cartesian format specifies the desired end
point; but, if the second point is in polar form, it is meant
\emph{relative to the starting point}, not as an absolute end point.
@@ -322,7 +360,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
analogy with |\LIne|; |\VECTOR| joins two specified points (without
using the |\put| command) with the arrow pointing to the second point.
|\VVECTOR| may be available if used with a sufficiently recent \LaTeX\
- kernel version; is draws a vector between two given points, with arrow
+ kernel version; it draws a vector between two given points, with arrow
tips at both ends.
%
@@ -333,7 +371,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
for the polyline are joined to one another. Vertices may be specified
with polar coordinates and are always relative to the preceding point.
%
- \item The \pack{pict2e} |polygon| macro draws closed polylines (in
+ \item The \pack{pict2e} |\polygon| macro draws closed polylines (in
practice general polygons) has been redefined in such a way that it
can accept the various vertices specified with (relative) polar
coordinates. The |polygon*| macro produces a color filled polygon; the
@@ -363,11 +401,11 @@ Remember to delete all these subfolders if you decide to install a complete upda
%
\item The above |\Curve| macro is a recursive macro that can draw an
unlimited (reasonably limited) number of connected Bézier spline arcs
- with% continuous tangents except for cusps; these arcs require only the
- specification of the tangent direction at the interpolation nodes.
+ with specification of the tangent direction at the interpolation nodes.
It is possible to use a lower level macro |\CbezierTo| that does the
same but lets the user specify the control points of each arc; it is
- more difficult to use but it is more performant.
+ more difficult to use but it is more performant.|\Curve| recognises also
+ an optional argument to set a direction change, that is a cusp.
%
\item The basic macros used within the cumulative |\Curve| macro can be
used individually in order to draw any curve, one cubic arc at the
@@ -378,7 +416,7 @@ Remember to delete all these subfolders if you decide to install a complete upda
the locally specified color; see figure~\ref{fig:colored-curve}.
It is much more convenient to use the starred version of the |\Curve|
macro.
- \end{enumerate}
+\end{enumerate}
The \pack{pict2e} package already defines macros such as |\moveto|,
|\lineto|, |\curveto|, |\closepath|, |\fillpath|, and |\strokepath|;
@@ -395,14 +433,14 @@ Remember to delete all these subfolders if you decide to install a complete upda
In order to make the necessary calculations many macros have been
defined so as to use complex number arithmetics to manipulate point
- coordinates, directions (unit vectors, also known as `versors'),
+ coordinates, directions (unit vectors, also known as ‘versors’),
rotations and the like. In the first versions of this package the
trigonometric functions were also defined in a way that the author
believed to be more efficient than those defined by the \texttt{trig}
package; in any case the macro names were sufficiently different to
accommodate both definition sets in the same \LaTeX\ run. With the
- progress of the \LaTeX3 language, package \pack{xfp} has become
- available, by which any sort of calculations can be done with floating
+ progress of the \LaTeX3 language, package \pack{xfp} functionalities
+ have become available, and any sort of calculations can be done floating
point decimal numbers; therefore the most common algebraic, irrational
and transcendental functions can be computed in the background with the
stable internal floating point facilities. We maintain some computation
@@ -444,12 +482,12 @@ Remember to delete all these subfolders if you decide to install a complete upda
package, it has to load it \emph{before} \pack{curve2e}.
%%
\item Since they are used very much in the following examples, we recall some commands to label certain drawing elements, such as points, lines, arcs, and similar lines, and to insert legends in some figures. They are \cs{legenda}, \cs{Zbox} and \cs{Pbox}; their syntax is the following:
-\begin{flushleft}\ttfamily\obeylines
+\begin{sintassi}\ttfamily\obeylines
|\legenda|\parg{coordinates}\marg{formula}
|\Zbox|\parg{coordinates}\oarg{position}\marg{formula}\oarg{dot diameter}
|\Pbox|\parg{coordinates}\oarg{position}\marg{text}\oarg{dot diameter}\meta{\texttt{*}}\aarg{angle}
-\end{flushleft}
-They are described in any up to date documentation of package \pack{curve2e}.
+\end{sintassi}
+They are described in any up to date documentation of \pack{curve2e}.
%%
\item The user is offered new commands in order to control the line
terminators and the line joins; specifically:
@@ -466,34 +504,34 @@ They are described in any up to date documentation of package \pack{curve2e}.
previous terminator or join; in other words, groups and environments do
not have any influence on these commands.
%%
- \item The commands |\linethickness|, |\thicklines|, |\thinlines|
- together with |\defaultlinethickness| always redefine the internal
- |\@wholewidth| and |\@halfwidth| so that the latter ones always
- refer to a full width and to a half of it in this way: if you issue
- the command {\setfontsize{8.75}|\defaultlinethickness{2pt}|} all thin
- lines will be drawn with a thickness of 1\,pt while, if a drawing
- command directly refers to the internal value |\@wholewidth|, its
- line will be drawn with a thickness of 2\,pt. If one issues the
+ \item The commands
+ \begin{sintassi}\obeylines
+ |\linethickness|\marg{thickness}
+ |\thicklines|
+ |\thinlines|
+ |\defaultlinethickness|\marg{thickness}
+ \end{sintassi}
+ always redefine the internal |\@wholewidth| and |\@halfwidth| so that the
+ latter ones always refer to a full width and to a half of it in this way
+ if you issue the command {\setfontsize{8.75}|\defaultlinethickness{2pt}|}
+ all thin lines will be drawn with a thickness of 1\,pt while, if a
+ drawing command directly refers to the internal value |\@wholewidth|,
+ its line will be drawn with a thickness of 2\,pt. If one issues the
declaration |\thinlines| all lines will be drawn with
a 1\,pt width, but if a command refers to the internal value
|\@halfwidth| the line will be drawn with a thickness of 0.5\,pt.
- The command |\linethickness| redefines the above internals but
- does not change the default width value; all these width
- specifications apply to all lines, straight ones, curved ones,
- circles, ovals, vectors, dashed lines, and so on. It's better
- to recall that |\thinlines| and |\thicklines| are declarations
- that do not take arguments; on the opposite the other commands
- follow the standard syntax:
- \begin{flushleft}
- |\linethickness|\marg{dimensioned value}\\
- |\defaultlinethickness|\marg{dimensioned value}
- \end{flushleft}
- where \meta{dimensioned value} means either a length specification
- complete of its units, or a dimensional expression.
+ The command |\linethickness| redefines the above internals but does not
+ change the default width value; all these width specifications apply to
+ all lines, straight ones, curved ones, circles, ovals, vectors, dashed
+ lines, and so on. It's better to recall that |\thinlines| and
+ |\thicklines| are declarations that do not take arguments; on the pposite
+ the other commands, as shown in the above syntax medallion, accept a
+ specific thickness value, that is either a length specification complete
+ of its units, or a dimensional expression.
%%
\item Straight lines and vectors are redefined in such a way that
- fractional slope coefficients may be specified; the zero length
- line does not produce errors and is ignored; the zero length vectors
+ fractional slope coefficients may be specified; the zero length line and
+ vector does not produce errors and is ignored; the zero length vectors
draw only the arrow tips.
%%
\item New line and vector macros are defined that avoid the necessity
@@ -503,17 +541,26 @@ They are described in any up to date documentation of package \pack{curve2e}.
result without the need of using the |\put| command. Therefore |\LIne|
is just for internal usage, rather than a user command. Now
\pack{curve2e} has available also the “arc vectors” with the arrow tips
- at one or at both ends.
+ at one or at both ends. The |\segment| syntax is
+ \begin{sintassi}\obeylines
+ \cs{segment}\parg{starting point}\parg{ending point}
+ \end{sintassi}
The same applies to the vector commands |\Vector| and |\VECTOR| and
|\VVECTOR|; the latter command behaves as |\VECTOR| but draws a vector
with arrow tips at both ends; furthermore this command is available
only with main versions~2 or higher of \pack{curve2e}.
+ \begin{sintassi}\obeylines
+ |\put|\parg{starting point}\Marg{\cs{Vector}\meta{vector cartesian or polar components}}
+ |\VECTOR|\parg{starting point}\parg{ending point}
+ |\VVECTOR|\parg{starting point}\parg{ending point}
+ \end{sintassi}
+
Experience has shown that the commands intended to join two specified
- points are particularly useful.
+ points are particularly useful; see figure~\ref{fig:vectors}.
-\begin{figure}
+\begin{figure}[!hb]
\begin{Esempio}[\small](0.60)
\unitlength=0.01\linewidth
\begin{picture}(80,20)
@@ -530,16 +577,16 @@ They are described in any up to date documentation of package \pack{curve2e}.
\end{figure}
%%
\item The |\polyline| command has already been introduced in \pack{pict2e}: in \pack{curve2e} it is redefined so as to accept also polar coordinates; this new version of |\polyline| accepts also an optional argument to specify how two consecutive segments join together; it accepts an unlimited list of point coordinates, possibly stored in macros, enclosed within round parentheses; the command draws a sequence of connected segments that join in order the specified points; the syntax is:
- \begin{flushleft}
+ \begin{sintassi}
\cs{polyline}\oarg{optional join style}\parg{$P_1$}\parg{$P_2$}\texttt{...}\parg{$P_n$}
- \end{flushleft}
+ \end{sintassi}
See figure~\ref{fig:polyline} where a regular pentagon is drawn; usage
of polar coordinates is also shown; please notice how polar
coordinates act in this figure.
\begin{figure}[!ht]
\begin{Esempio}[\small](0.55)
- \unitlength=.5mm
+ \unitlength=0.5mm
\begin{picture}(40,32)(-20,-17)
\polyline(90:20)(162:20)(234:20)(306:20)(378:20)(90:20)
\end{picture}
@@ -550,13 +597,13 @@ They are described in any up to date documentation of package \pack{curve2e}.
\end{figure}
Examples of using polar and cartesian coordinates are shown in
- figure~\ref{fig:polar}.
+ figure~\ref{fig:polar}. Notice the |\AutoGrid| macro that draws the grid of mesh lines that are very useful to seti objects at the right positions. The lines are |10\unitlenght| apart.
\begin{figure}[htb]
\begin{Esempio}[\normalsize]%
\unitlength=0.02\textwidth
\begin{picture}(40,30)
-\AutoGrid(40,30)
+\AutoGrid
\Zbox(40,0)[l]{40,0}[1]
\Zbox(90:30)[bc]{90{:}30}[1]
\Zbox(45:30)[bc]{45{:}30}[1]
@@ -591,9 +638,9 @@ They are described in any up to date documentation of package \pack{curve2e}.
%
\item The new command |\Dashline| (alias: |\Dline| for backwards
compatibility):
- \begin{flushleft}
- |\Dashline|\parg{first point}\parg{second point}\marg{dash length}
- \end{flushleft}
+ \begin{sintassi}
+ |\Dashline|\parg{first point}\parg{second point}\marg{dash and gap length}
+ \end{sintassi}
draws a dashed line containing as many dashes as possible, just as long
as specified, and separated by a gap exactly the same size; actually,
in order to make an even gap-dash sequence, the desired dash length is
@@ -691,48 +738,57 @@ They are described in any up to date documentation of package \pack{curve2e}.
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 working grid on the drawing canvas. This grid is intended as
- an aid 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. |\Autogrid|
- does not require arguments, but requires the canvas dimensions and
- offsets to be specified as multiples of~10; if the latter are specified
- they are simply ignored.
+ place the working grid on the drawing canvas.
+ \begin{sintassi}
+ |\GraphicGrid|\parg{grad base, grid height}
+ |\AutoGrid|
+ \end{sintassi}
+ This grid is intended as an aid 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.
+
+ |\Autogrid| does not require arguments, but requires the canvas
+ dimensions and offsets to be specified as multiples of~10; 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 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,
- for example $\tan90^\circ$ must be avoided and replaced with a suitably
- large number, because the TeX\ system does not handle “infinity”.
+ the functionalities of the |xfp| included in the \LaTeX\ kernel. 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 that
+ can occasionally be avoided, for example $\tan 90^\circ$ must be avoided
+ and replaced with a suitably large number, because the \TeX\ system does
+ not handle “infinity”.
These trigonometric functions are used within the complex number
macros; but if the user wants to use them the syntax is the following:
-\begin{flushleft}
- \cs{SinOf}\meta{angle}\texttt{to}\meta{control sequence}\\
- \cs{CosOf}\meta{angle}\texttt{to}\meta{control sequence}\\
+\begin{sintassi}
+ \cs{SinOf}\meta{angle}\texttt{to}\meta{control sequence}
+ \cs{CosOf}\meta{angle}\texttt{to}\meta{control sequence}
\cs{TanOf}\meta{angle}\texttt{to}\meta{control sequence}
-\end{flushleft}
+\end{sintassi}
The \meta{control sequence} may then be used, for example, as a
multiplying factor of a length.
%%
\item Arcs can be drawn as simple circular arcs, or with one or two
arrows at their ends (curved vectors); the syntax is:
-\begin{flushleft}
- \cs{Arc}\parg{center}\parg{starting point}\marg{angle}\\
- \cs{VectorArc}\parg{center}\parg{starting point}\marg{angle}\\
- \cs{VectorARC}\parg{center}\parg{starting point}\marg{angle}\\
-\cs{VVectorArc}\parg{center}\parg{starting point}\marg{angle}\\
-\end{flushleft}
+\begin{sintassi}
+ \cs{Arc}\parg{center}\parg{starting point}\marg{angle}
+ \cs{VectorArc}\parg{center}\parg{starting point}\marg{angle}
+ \cs{VectorARC}\parg{center}\parg{starting point}\marg{angle}
+\cs{VVectorArc}\parg{center}\parg{starting point}\marg{angle}
+\end{sintassi}
If the angle is specified numerically it must be enclosed in braces,
while if it is specified with a control sequence the braces (curly
brackets) are not necessary. The above macro |\Arc| draws a simple
circular arc without arrows; |\VectorArc| draws an arc with an arrow
tip at the ending point; |\VectorARC| (alias |\VVectorArc|) draws an
arc with arrow tips at both ends; see figure~\ref{fig:arcs}.
+
+ Notice that the starting point may be specified with polar coordinates; differently to cartesian coordinates, that are absolute with respect with the drawing axes, the polar ones are relative to the center of the arcs with or without vector tips.
\begin{figure}
\begin{Esempio}[\small]%
\unitlength=0.5mm
@@ -743,13 +799,13 @@ They are described in any up to date documentation of package \pack{curve2e}.
\VectorArc(0,20)(15,10){60}
\put(20,20){\makebox(0,0)[l]{$60^\circ$}}
\VectorARC(60,20)(60,0){-180}
- \VVectorArc(50,20)(60,20){90}
+ \VVectorArc(60,20)(135:10){90}
\end{picture}
\end{Esempio}
\caption{Arcs and curved vectors}\label{fig:arcs}
\end{figure}
%%
- \item The available commands allow to create the drawings necessary to prove some geometrical theorems; for example let us prove the Pitagora's theorem. Figure~\ref{fig:pitagora} displays a right triangle with its hypothenuse laying horizontal; its vertices are labelled \textsf{A}, \textsf{B}, and \textsf{C}, being \textsf{A} the right angle vertex. The height relative to the hypothenuse intersects this side in point \textsf{H}, and divides the whole triangle \textsf{ABC}, in two similar smaller ones \textsf{AHC}, and\textsf{ABH}. Segments \textsf{CH}, and\textsf{HB}, add to the whole hypothenuse length. Figure~\ref{fig:pitagora} displays also the square \textsf{CBDE}, built on the hypothenuse and divided in two rectangles \textsf{CHFE}, and \textsf{HBDF}, where \textsf{HF} is the continuation of the height line.
+ \item The available commands allow to create the drawings necessary to prove some geometrical theorems; for example let us prove the Pitagora's theorem. Figure~\ref{fig:pitagora} displays a right triangle with its hypothenuse laying horizontally; its vertices are labeled \textsf{A}, \textsf{B}, and \textsf{C}, being \textsf{A} the right angle vertex. The height relative to the hypothenuse intersects this side in point \textsf{H}, and divides the whole triangle \textsf{ABC}, in two similar smaller ones \textsf{AHC}, and\textsf{ABH}. Segments \textsf{CH}, and\textsf{HB}, add to the whole hypothenuse length. Figure~\ref{fig:pitagora} displays also the square \textsf{CBDE}, built on the hypothenuse and divided in two rectangles \textsf{CHFE}, and \textsf{HBDF}, where \textsf{HF} is the continuation of the height line.
The lengths of the original right triangle sides are $a, b, c$ as marked on the figure; Point \textsf{H} divides the hypothenuse of length $c$ in two shorter segments of lengths $d, e$, respectively, as marked in the figure
@@ -815,30 +871,40 @@ which proves the Pitagora's theorem.
\emph{direction} of a vector is its versor; the angle of a vector is
the angle between the vector and the positive $x$ axis in
counterclockwise direction, as it is used in the
- Euler formula $ \vec{v} = Me^{\mathrm{j}\varphi}$.
+ Euler formula $ \vec{v} = M\eu^{\mathrm{j}\varphi}$.
+
+\begin{sintassi}
+ |\MakeVectorFrom|\meta{numeric macro}\meta{numeric macro}|to|\meta{vector macro}
+ |\CopyVect|\meta{first vector}|to|\meta{second vector macro}
+ |\ModOfVect|\meta{vector}|to|\meta{modulus macro}
+ |\DirOfvect|\meta{vector}|to|\meta{versor macro}
+ |\ModAndDirOfVect|\meta{vector}|to|\meta{modulus macro}|and|\meta{versor macro}
+ |\ModAndAngleOfVect|\meta{vector}|to|\meta{modulus macro}|and|\meta{angle macro}
+ {\setfontsize{10}|\DistanceAndDirOfVect|\meta{1st vector} |minus|\meta{2nd vector}
+ \qquad\qquad|to|\meta{distance macro} |and|\meta{versor macro}}
+ |\XpartOfVect|\meta{vector}|to|\meta{macro}
+ |\YpartOfVect|\meta{vector}|to|\meta{macro}
+\end{sintassi}
- \begin{itemize}
- \item |\MakeVectorFrom|\meta{numeric macro}\meta{numeric macro}|to|\meta{vector macro}
- \item |\CopyVect|\meta{first vector}|to|\meta{second vector macro}
- \item |\ModOfVect|\meta{vector}|to|\meta{modulus macro}
- \item |\DirOfvect|\meta{vector}|to|\meta{versor macro}
- \item |\ModAndDirOfVect|\meta{vector}|to|\meta{modulus macro}|and|\meta{versor macro}
- \item |\ModAndAngleOfVect|\meta{vector}|to|\meta{modulus macro}|and|\meta{angle macro}
- \item {\setfontsize{10}|\DistanceAndDirOfVect|\meta{1st vector} |minus|\meta{2nd vector} |to|\meta{distance macro} |and|\meta{versor macro}}
- \item |\XpartOfVect|\meta{vector}|to|\meta{macro}
- \item |\YpartOfVect|\meta{vector}|to|\meta{macro}
- \item |\DirFromAngle|\meta{angle}|to|\meta{versor macro}
- \item |\ArgOfVect|\meta{vector}|to|\meta{angle macro}
- \item |\ScaleVect|\meta{vector}|by|\meta{scaling factor}|to|\meta{vector macro}
- \item |\ConjVect|\meta{vector}|to|\meta{conjugate vector macro}
- \item |\SubVect|\meta{subtrahend vector}|from|\meta{minuend vector}|to|\meta{vector macro}
- \item |\AddVect|\meta{first vector}|and|\meta{second vector}|to|\meta{vector macro}
- \item |\Multvect|\marg{first vector}*\marg{second vector}*\marg{vector macro} (the asterisks are optional; either one changes the second vector into its complex conjugate)
- \item |\MultVect|\meta{first vector}|by|\meta{second vector}|to|\meta{vector macro} (discouraged; maintained for backwards compatibility)
- \item |\MultVect|\meta{first vector}|by*|\meta{second vector}|to|\meta{vector macro} (discouraged; maintained for backwards compatibility)
- \item |\Divvect|\marg{dividend vector}\marg{divisor vector}\marg{ vector macro}
- \item |\DivVect|\meta{dividend vector}|by|\meta{divisor vector}|to|\meta{vector macro} (maintained for backwards compatibility)
- \end{itemize}
+
+\begin{sintassi}
+ |\DirFromAngle|\meta{angle}|to|\meta{versor macro}
+ |\ArgOfVect|\meta{vector}|to|\meta{angle macro}
+ |\ScaleVect|\meta{vector}|by|\meta{scaling factor}|to|\meta{vector macro}
+ |\ConjVect|\meta{vector}|to|\meta{conjugate vector macro}
+ |\SubVect|\meta{subtrahend vector}|from|\meta{minuend vector}|to|\meta{vector macro}
+ |\AddVect|\meta{first vector}|and|\meta{second vector}|to|\meta{vector macro}
+ |\Multvect|\marg{first vector}*\marg{second vector}*\marg{vector macro} (\textcolor{blue}{the
+\qquad\qquad asterisks are optional; either one changes the second vector
+\qquad\qquad into its complex conjugate})
+ |\MultVect|\meta{first vector}|by|\meta{second vector}|to|\meta{vector macro}
+\qquad\qquad (\textcolor{red}{discouraged; maintained for backwards compatibility})
+ |\MultVect|\meta{first vector}|by*|\meta{second vector}|to|\meta{vector macro}
+\qquad\qquad (\textcolor{red}{discouraged; maintained for backwards compatibility})
+ |\Divvect|\marg{dividend vector}\marg{divisor vector}\marg{vector macro}
+ |\DivVect|\meta{dividend vector}|by|\meta{divisor vector}|to|\meta{vector macro}
+\qquad\qquad (\textcolor{red}{discouraged: maintained for backwards compatibility})
+\end{sintassi}
%%
\item General curves can be drawn with the \pack{pict2e} macro
|\curve| but it requires the specification of the third-order
@@ -858,19 +924,26 @@ which proves the Pitagora's theorem.
interior; if it does not, the driver (not the code of this package,
but the driver between this code and the physical representation on
paper or screen) assumes a straight line closure of the whole path.
+ The syntax offers several variants but it is substantially the following:
+ \begin{sintassi}
+ |\Curve|\parg{node}\aarg{direction}\dots\parg{node}\aarg{direction}
+ |\Curve*|\parg{node}\aarg{direction}\dots\parg{node}\aarg{direction}
+ \qquad\qquad\dots\aarg{direction}\oarg{new direction}\parg{node}\dots
+ \end{sintassi}
+ See some more explanation below.
\item \cs{Qurve} is similar to |\Curve|, but with second order
(quadratic) Bézier splines. The starred version fills the interior
-with the current color.
+with the current color. Its syntax si similar to that of |\Curve|.
\item \cs{CurveBetween} draws a single cubic Bézier spline between two
- given nodes and with two given direction vectors.
+ given nodes and with two given direction vectors. This macro is similar to |\Curve|, but it is used to draw a third order Bézier curve between just two nodes and require just two directions
\item \cs{CBezierBetween} draws a single cubic Bézier spline between
two given nodes, with two given direction versors along which the
control node distances are specified. This is the most general macro
(rather difficult to use) with which not only the arc end points are
- specified but also the control nodes coordinates are given.
+ specified but also the control nodes coordinates are given. It is similar to |\CurveBetween| but the contol points of the single arc can be specified; the arc is perfect, but the syntax is more complicated. See below for examples.
\end{itemize}
@@ -879,7 +952,7 @@ with the current color.
%\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}[!htbp]
+ \begin{figure}[!ht]
\begin{Esempio}[\small]%
\unitlength=8mm\relax
\begin{picture}(5,5)
@@ -938,7 +1011,7 @@ with the current color.
control the tension; not all commands for drawing cubic splines accept
this optional tension specification.}:
\[
-\mbox{\dots\parg{...}\Aarg{\meta{direction vector};\meta{start tension},\meta{end tension}}\parg{...}\aarg{...}\dots}
+\makebox[\linewidth]{\small\dots\parg{node}\Aarg{\meta{direction vector};\meta{start tension},\meta{end tension}}\parg{node}\aarg{dirextion}\dots}
\]
The |\Curve| macro does not (still) have facilities for cycling the
@@ -957,7 +1030,7 @@ with the current color.
See figure~\ref{fig:curve} for an example.
With the starred version of |\Curve|, instead of stroking the contour,
- the macro fills up the contour with the selected current color,
+ the macro fills up the contour with the selected current color, see
figure~\ref{fig:colored-curve}.
Figure~\ref{fig:arcspline} shows a geometric construction that
@@ -1033,9 +1106,10 @@ with the current color.
To show what you can do with |\CurveBetween| see the code and result
shown in figure~\ref{fig:curva-due-punti}. Notice the effect of
- changing the directions at both or a the end nodes of a single cubic
+ changing the directions at both or at the end nodes of a single cubic
spline. The directions are conveniently expressed with unit vectors
- described by polar coordinates. The |\CurveBetween| macro is built on |\CbezierTp| ; this ltter file is very complicated to describe and its use is reserved to experienced users; its syntax is described in the code documentation file |cureve2e.pdf|; the reader is encouraged to examine it in case s/he is willing to use it.
+ described by polar coordinates. The |\CurveBetween| macro is built on
+ |\CBezierBetween|; this latter command is very complicated to describe and its use is reserved to experienced users; its syntax is described in the code documentation file |cureve2e.pdf|; the reader is encouraged to examine it in case s/he is willing to use it.
\begin{figure}\centering\unitlength=0.004\textwidth
\begin{picture}(220,120)(-50,-20)
@@ -1152,11 +1226,12 @@ with the current color.
when few arcs are used to draw it. With arcs specified with more
complicated macros the approximation is better even with a lower number
of arcs. With many arcs it is possible to approximate almost anything.
- On the left side a modest approximation is obtained with just three
- standard arcs obtained with |\Curve| and four node specifications;
- on the right we have just two arcs created with |CBezierBetween|
- with tension specification and control point distances; this drawing
- is almost undistinguishable from a real sinusoid.
+ On the left side of figure~\ref{fig:sinewave} a modest approximation is
+ obtained with just three standard arcs obtained with |\Curve| and four
+ node specifications; on the right we have just two arcs created with
+ |\CBezierBetween| with tension specification and control point
+ distances; this drawing is almost undistinguishable from a real
+ sinusoid.
\begin{figure}[!htb]
\begin{minipage}{\linewidth}\small
@@ -1191,7 +1266,7 @@ with the current color.
\end{picture}
\end{minipage}
\caption{A sequence of arcs; the left figure has been drawn with the
- \cs{Curve} command with a sequence of four couples of point-direction
+ \cs{Curve} command with a sequence of four couples of node-direction
arguments; the right figure has been drawn with two commands
\cs{CbezierBetween} that include also the specification of the control
points}
@@ -1271,24 +1346,28 @@ with the current color.
The |curve2e-v161| package, attached to this bundle, has been corrected;
therefore it is not actually identical to the previous version,
although the latter one performed correctly for everything else except
- for color-filled quadratic paths.
+ for color filled quadratic paths.
%%
\item The new version of |\multiput| is backwards compatibile with
the original version contained in the \LaTeX\ kernel. The new macro
adds the handling of the coordinate increments from one position to
the next for the \meta{object} to include in the drawing.
-
- On page~\pageref{pag:multiput} we show the code for the figure shown
- there. The red grid is nothing new, except that it displays the
- traditional |\multiput| used in this code, shown in a previous example,
- produces exactly the same result. But for what concerns the four
- “graphs” on the grid, it displays an alignment of black dots along the
- diagonal of the grid (again traditional |\multiput| rendered with the
- new version); a number of blue dots along a parabola; another number of
- magenta coloured dots alined along a half sine wave; a number of little
- green squares aligned along a $-15~\circ$ sloping line starting from
- the center of the grid; notice the polar values that are used as polar
- relative coordinate increments.
+ The syntax is the following:
+ \begin{sintassi}\setfontsize{8.5}
+ |\multiput|\parg{initial point}\parg{increment}\marg{number of items}\marg{object}\oarg{handler}
+ \end{sintassi}
+The only small change is the addition of the last optional argument that allows to do several interesting actions on the sequence o objects to be repeated, for example, to set them on a curved line, instead of on a straight line, as shown in figure~\ref{pag:multiput}.
+
+ In this figure we show the code for the picture shown there. The red grid
+ is nothing new, except that it displays the traditional |\multiput| used
+ in this code, shown in a previous example, produces exactly the same
+ result. But for what concerns the four “graphs” on the grid, it displays
+ an alignment of black dots along the diagonal of the grid (again
+ traditional |\multiput| rendered with the new version); a number of blue
+ dots along a parabola; another number of magenta coloured dots alined
+ along a half sine wave; a number of little green squares aligned along
+ a $-15~\circ$ sloping line starting from the center of the grid; notice
+ the polar values that are used as polar relative coordinate increments.
\noindent\begin{figure}[!htb]
\begin{minipage}{0.45\linewidth}
@@ -1341,9 +1420,9 @@ with the current color.
\end{figure}
A new command |\xmultiput| (not available with the previous versions
- of \pack{curve2e}) extended with respect to the original |\multiput| is
- defined by using some L3 functions; in particular the cycling
- counter is accessible to the \LaTeX\ commands and it is stepped
+ of \pack{curve2e}) is extended with respect to the original
+ |\multiput|; it is defined by using some L3 functions; in particular the
+ cycling counter is accessible to the \LaTeX\ commands and it is stepped
up from~1 to the value specified in the proper command argument
(in the original command it starts from that value and is stepped down
to zero). See the figure on page~\ref{pag:orologio} to inspect its
@@ -1351,6 +1430,13 @@ with the current color.
has to be used, as in the example of figure~\ref{pag:orologio}, the
package |graphicx| should be also loaded, because \pack{curve2e} does
not load it.
+
+ Th |\xmultiput| syntax is the is similar to that of |\multiput| but besides the stepping up or down of the iteration counter, it can access and modify certain internal with the commands that appear in the \meta{handler} argument. Actually this \meta{handler} is available also with |\multiput|. In both cases the handler can be defined to modify some internals, including the iteration counter only for |\xmultipot|, but also the |\R| and |\D| internals; |\R| contains the coordinates where to put the \meta{object}, while |\D|, if set, contains the angle of rotation of the object. The code and picture examples in figures~\ref{pag:multiput} and~\ref{pag:orologio} show some examples of usage through tis \meta{handler} code.
+.
+\begin{sintassi}\small
+|\xmultiput|\parg{initial point}\parg{increment}\marg{iterations}\marg{object}\oarg{handler}
+\end{sintassi}
+
\begin{figure}[!htb]
\begin{minipage}{0.45\textwidth}\setfontsize{9.5}%
@@ -1393,11 +1479,11 @@ with the current color.
|\fptest|, |\fpdowhile|, |\fpwhiledo| to the two already contained and
documented in the latter package. The syntax of such new commands
is the following
- \begin{flushleft}\obeylines
+ \begin{sintassi}\obeylines
\cs{fptest}\marg{test}\marg{true}\marg{false}
\cs{fpdowhile}\marg{test}\marg{operations to be repeated}
\cs{fpwhiledo}\marg{test}\marg{operations to be repeated}
- \end{flushleft}
+ \end{sintassi}
The macro |\fptest| requires two further arguments that contain
what to do if the \meta{test} is true, and what to do if the
\meta{test} is false.
@@ -1412,7 +1498,7 @@ with the current color.
work also between logical variables, therefore the \meta{test} may
contain an interesting mixture of relation and logical operators.
- Before using |\fpdowhile| and |\fpwhiledo| the arguments of \meta{test}
+ Before using |\fpdowhile| and |\fpwhiledo|, the arguments of \meta{test}
depends-on must be set so that the test is true; during the execution
of the \meta{operations to be repeated} there must be some setting
that eventually renders the \meta{test} false. The user should
@@ -1432,7 +1518,7 @@ with the current color.
with |\fpwhiledo| should be safer and should be preferred.
Nevertheless such commands are very useful also for drawing graphics;
- the |xmultiput| already makes use of such L3~functions.
+ the |xmultiput| command already makes use of such L3~functions.
As an example of use, we show how to plot a mathematical function
expressed in parametric form:
@@ -1443,7 +1529,7 @@ y = f_2(t)
The plot is executed with a piecewise linear approximation of the
curve; if the $t$ steps are sufficiently small, the plot turns out to
be very nice; here we show an example where we plot a Lissajous curve
- with two sinusoids of different period.
+ with two sinusoids of different periods.
We start by defining the Lissajous function with arguments
to specify the parameter $t$, the sinusoid amplitudes $A_1, A_2$,
@@ -1487,12 +1573,12 @@ y = f_2(t)
\end{verbatim}
The syntax is the following:
-\begin{flushleft}\obeylines
+\begin{sintassi}\obeylines
\cs{Lissajous}\marg{in}\Oarg{\meta{$A_1$},\meta{$N_1$},\meta{$\phi_1$},\meta{$A_2$},\meta{$N_2$},\meta{$\phi_2$}}\meta{$P_{\mathrm{out}}$}
-\end{flushleft}
+\end{sintassi}
where \meta{$P_{\mathrm{out}}$} is a macro that gets
defined with the cartesian coordinates of the computed output
- point. Arguments \meta{in} (the $t$ parameter) and \meta{$P_\mathrm{out}$} (the computed coordinates) need not be enclosed within braces if they are given as macros; actually the code shown in figure~\ref{fig:lissajous} shows such procedure that renders the input code simpler to read.
+ point. Arguments \meta{in} (the $t$ parameter) and \meta{$P_\mathrm{out}$} (the comput coordinates) need not be enclosed within braces if they are given as macros; actually the code shown in figure~\ref{fig:lissajous} shows such procedure that renders the input code simpler to read.
After this definition the diagram is plotted in
figure~\ref{fig:lissajous}.
@@ -1505,7 +1591,7 @@ y = f_2(t)
\VECTOR(-50,0)(50,0)\Pbox(50,0)[tr]{x}[0]
\VECTOR(0,-50)(0,50)\Pbox(0,50)[tr]{y}[0]
\Pbox(0,0)[tr]{O}[2]
-%
+\thicklines
{\countdef\I=2560 \I=0
\fpdowhile{\I !> 360}{%
\fptest{\I=0}%
@@ -1529,19 +1615,113 @@ y = f_2(t)
and/or to be used as the second argument of a
\cs{rotatebox}\marg{angle} command so as to rotate the whole
diagram.
+%
+\item Another useful application of |\fpdowhile| is the following: when making a diagram the axes should get suitable labeled ticks in order to show the graduations; the label of each tick should lay close to the axis on the other side than the tick. It is also necessary to know if the axis to be marked is horizontal or vertical, since in the former case each tick is vertical, while in the latter case it is horizontal. The example in figure~\ref{fig:ticks} shows both the code and its usage. The syntax of the |\Tbox| macro is the following.
+\begin{sintassi}
+|\Tbox|\parg{coordinates}\oarg{reference}\marg{label}\oarg{size}\aarg{direction}
+\end{sintassi}
+where \meta{coordinates} indicates the position of the tick base along its axis; \meta{reference} is a letter, either |t| (if the axis is on top of the label) or |b|(if the axis is at the bottom of the label) for vertical ticks or either |r| (if the axis is at the right of the label) or |l| (if the axis is at the left of the label) for horizontal ticks; \meta{label} is the value of the scale or a literal label that by default is typeset in math mode, so that a math symbol may be used without the need of entering math mode, while in the unusual circumstance that a textual label is to be used, users should use the |\text| macro; the \meta{size} argument is the size of the tick: if such size is zero, just the label is set, but in this case the |\Tbox| macro behaves as the the |\Zbox| one, and accepts two reference codes in order to print the label the same as |\Zbox| would do when the dot size is zero; the \meta{direction} argument is the letter |V| for vertical ticks, and |H| for horizontal ticks. There is some redundancy because |\Tbox| may behave as |\Zbox|, but experience shows that this is not a problem.
+
+The source preamble should contain the following code.
+{\small\begin{verbatim}
+\makeatletter
+\NewDocumentCommand\Tbox{D(){0,0} O{cc} m O{0pt} D<>{Z}}{\bgroup
+\edef\TBoxCode{#5}\dimen0=#4\relax %
+\edef\tempE{\fpeval{round(#4/\unitlength,3)}}%
+\put(#1){%
+\ifdim\dimen0=\z@
+ \Zbox(0,0)[#2]{#3}[\z@]%
+\else
+ \if\TBoxCode V\relax
+ \let\tempC=b\relax
+ \if\tempC #2\edef\tempD{0,-\tempE}\else\edef\tempD{0,\tempE}\fi
+ \segment(0,0)(\tempD)\Zbox(0,0)[#2]{#3}[\z@]%
+ \else
+ \if\TBoxCode H\relax
+ \let\tempC=l\relax%
+ \if\tempC #2\edef\tempD{-\tempE,0}\else\edef\tempD{\tempE,0}\fi
+ \segment(0,0)(\tempD)\Zbox(0,0)[#2]{#3}[\z@]%
+ \else
+ \typeout{The specified code\space #5\space is invalid!}%
+ \typeout{\string\Tbox\space command ignored}%
+ \fi
+ \fi
+\fi
+}\egroup\ignorespaces}%
+\end{verbatim}
+}
+If the code is contained in a personal |.sty| file the |\makeatletter| should be omitted.
- \end{enumerate}
+As it can be seen, the fifth argument code is preset to to |Z| so that if users forget to specify it, error messages pop op and can be seen in both the console window and in the log file, but no tick and label are typeset. This kind of commands to label in one way or another may be very useful depending on the users' kind of drawings. Figure~\ref{fig:labeled diagram} contains also the iterations to label the axes and are done with the
+|\fpdowhile| macro; it can be seen that the actual coordinate of each tick is transformed into the actual label that si put in its position by the
+|\Zbox| command' of course the diagram scale and the actual label are related to one another but do not have the same value.
+
+\begin{figure}
+{\small\begin{verbatim}
+\centering\unitlength=0.007\linewidth
+\begin{picture}(100,70)(-50,-10)%
+\AutoGrid
+\thicklines
+\VECTOR(-50,0)(50,0)\Zbox(50,0)[br]{x}[0pt]%
+\VECTOR(0,0)(0,60)\Zbox(0,60)[tl]{y}[0pt]%
+%
+{\def\Coord{-40}%
+\fpdowhile{\Coord<=40}{\edef\X{\fpeval{round(\Coord/20,1)}}%
+\Tbox(\Coord,0)[t]{\X}[1.5mm]<V>\edef\Coord{\fpeval{\Coord+10}}}%
+%
+\def\Coord{10}%
+\fpdowhile{\Coord<=50}{\edef\Y{\fpeval{round(\Coord/20,1)}}%
+\Tbox(0,\Coord)[r]{\Y}[1.5mm]<H>\edef\Coord{\fpeval{\Coord+10}}}%
+}%
+%
+{\color{blue}\linethickness{1.5pt}%
+\Curve(-40,0)<1,0>(0,20)<45:1>% Parabola: y=0.25(x_2)^2
+\Curve(0,20)<1,0>(20,0)<0,-1>% Quarter circle: x^2+y^2=1
+\Curve(20,0)<0,1>(40,34.64)<49:1>}% Hyperbola:x^2-y^=1
+\thinlines
+\Dashline(0,0)(45,45){2}% asymptote
+\end{picture}
+\end{verbatim}
+}
+\bigskip
+
+\centering\unitlength=0.007\linewidth
+\begin{picture}(100,70)(-50,-10)%
+\AutoGrid
+\thicklines
+\VECTOR(-50,0)(50,0)\Zbox(50,0)[br]{x}[0pt]%
+\VECTOR(0,0)(0,60)\Zbox(0,60)[tl]{y}[0pt]%
+%
+{\def\Coord{-40}%
+\fpdowhile{\Coord<=40}{\edef\X{\fpeval{round(\Coord/20,1)}}%
+\Tbox(\Coord,0)[t]{\X}[1ex]<V>\edef\Coord{\fpeval{\Coord+10}}}%
+%
+\def\Coord{10}%
+\fpdowhile{\Coord<=50}{\edef\Y{\fpeval{round(\Coord/20,1)}}%
+\Tbox(0,\Coord)[r]{\Y}[1ex]<H>\edef\Coord{\fpeval{\Coord+10}}}%
+}%
+{\color{blue}\linethickness{1.5pt}%
+\Curve(-40,0)<1,0>(0,20)<45:1>% Parabola: y=0.25(x_2)^2
+\Curve(0,20)<1,0>(20,0)<0,-1>% Quarter circle: x^2+y^2=1
+\Curve(20,0)<0,1>(40,34.64)<49:1>}% Hyperbola:x^2-y^2=1
+\thinlines
+\Dashline(0,0)(45,45){2}% asymptote
+\end{picture}
+\caption{The code to draw a diagram with labeled axes}\label{fig:labeled diagram}
+\end{figure}
+%
+\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \section{Remark}
+ \section{Remarks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
In spite of the relative simplicity of the macros contained in this
package, the described macros, as well as the original ones included in
- the \pack{pict2e} package, they allow to produce fine drawings that were
+ the \pack{pict2e} package, allow to produce fine drawings that were
unconceivable with the original \LaTeX\ picture environment. Leslie
Lamport himself announced an extension to his environment when \LaTeXe\
- was first released in 1994; in the |latexnews| news-letter of December
+ was first released in 1994; in the |ltnews| news-letter of December
2003, the first implementation of Lamport's extension was announced;
the first version of this package \pack{curve2e} was issued in 2006.
It was time to have a better drawing environment; this package
@@ -1550,13 +1730,12 @@ y = f_2(t)
There are other packages in the \textsc{ctan} archives that deal with
tracing curves of various kinds. \pack{PSTricks} and \pack{pgf/tikz} are
- the most powerful ones. And they are becoming the standard for
- programmed drawing.
- Their documentation is huge and the multitude of extra modules to
- perform special tasks is countless. Therefore they are difficult to use;
- when the user gets used to their particular syntax and got sufficient
- familiarity with several modules, s/he can use these bundles very
- comfortably.
+ the most powerful ones. And they are becoming the standard for computer
+ drawing. Their documentation is huge and the multitude of extra modules
+ to perform special tasks is countless. Therefore they are difficult to
+ use; when the user gets used to their particular syntax and got
+ sufficient familiarity with several modules, s/he can use these bundles
+ very comfortably.
This difficulty in becoming a TikZ or PS expert is why I think a simpler
drawing machinery should be appreciated. I admit it: I like the
@@ -1597,6 +1776,11 @@ y = f_2(t)
interfaces very well with |tikz|; it has not (yet) been adapted to the
common \env{picture} environment extended with \pack{pict2e}, and,
why not, with \pack{curve2e}.
+
+If you are interested in further extensions of |curve2e|, besides creating yourself the macros you need, examine the |euclideangeometry| package; I created it in order to have available further functionalities useful to deal with more complicated geometrical constructions. Another small extension is |graphpaper| by which users can produce themselves drawing paper with bilinear coordinates, semi-logarithmic and bi-logarithmic coordinates, polar linear or semilogarithmic coordinates, and Smith charts. They are an extension chain of the packages that extend the picture environment: |graphpaper| calls |euclideangeometry| which calls
+|curve2e| which calls |pict2e|. I find all this very useful. Of corse these packages and their documentation are all contained in \TeX~Live.
+
+I am about to complete a book on electromagnetism and electronic circuit theory: it contains some 300 drawings, diagrams, electronic circuits. I created them with |curve2e| and some macros based on this |picture| extension package. The graphics of my book are pretty nice, and I am sure that a professional technical artist can draw better ones, but such an artist would be very expensive and the process would require a lot of time to correct, modify, add details, and so on, while doing things by oneself is certainly a better solution. Packages |tikz|/|pgfplots| and |PStricks|? Certainly they are very good and much more powerful, but, besides being sort of difficult to learn to use, they require a lot of working memory and more often than not I ran out of computer memory.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Acknowledgements}
@@ -1606,34 +1790,31 @@ y = f_2(t)
errors and very kindly submitted them to me so that I was able to
correct them.
- Josef Tkadlec and the author collaborated extensively in order to
+ I collaborated extensively with Josef Tkadlec in order to
implement a better real long division so as to get correctly the
quotient fractional part and to avoid as much as possible any numeric
overflow; many Josef's ideas are incorporated in the macro that was
implemented in the previous version of this package, although the
macro used by Josef was slightly different. Both versions aim/aimed
at a better accuracy and at widening the operand ranges. In this
- version of \pack{curve2e} we abandoned our long division macro, and
+ version of \pack{curve2e} I abandoned our long division macro, and
substituted it with the floating point division provided by the |xfp|
- package.
+ package functionalities that are now part of the \LaTeX\ kernel.
- Daniele Degiorgi spotted a fault in the kernel definition of
- |\linethickness| that heavily influenced also \pack{curve2e}; see in
- the code documentation \file{curve2e.pdf} file.
+Daniele Degiorgi spotted a fault in the kernel definition of
+|\linethickness| that heavily influenced also \pack{curve2e}; see in
+the code documentation \file{curve2e.pdf} file.
- Many thanks to Domenicus van der Wijst who spotted a sneaky bug in the updated |\Arc| macro; for arcs non wider that $180^\circ$ it worked properly, while for larger angle apertures it produced syntax errors. It was just a typo, but very sneaky.
+Many thanks to Domenicus van der Wijst who spotted a sneaky bug in the updated |\Arc| macro; for arcs not wider that $180^\circ$ it worked properly, while for larger angle apertures it produced syntax errors. It was just a typo, but very sneaky.
- Thanks also to Jin-Hwan Cho and Juho Lee who suggested a small but
+Thanks also to Jin-Hwan Cho and Juho Lee who suggested a small but
crucial modification in order to have \pack{curve2e} work smoothly
also with XeTeX (XeLaTeX). Actually if \pack{pict2e}, version 0.2x or
- later dated 2009/08/05 or later, is being used, such modification is
+ later, dated 2009/08/05 or later, is being used, such modification is
not necessary any more, but it is true that it becomes imperative when
legacy versions were used.
- Many thanks also to Ashish Kumar Das who spotted
- an inconsistency in the design of vectors with PostScript style arrow
- tips with large line width settings, that did not show up with \LaTeX\
- styled ones.
+Many thanks also to Ashish Kumar Das who spotted an inconsistency in the design of vectors with PostScript style arrow tips with large line width settings, that did not show up with \LaTeX\ styled ones.
\end{document}
diff --git a/macros/latex/contrib/curve2e/curve2e.dtx b/macros/latex/contrib/curve2e/curve2e.dtx
index 342761876f..9145b6dad6 100644
--- a/macros/latex/contrib/curve2e/curve2e.dtx
+++ b/macros/latex/contrib/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>
- [2023-01-01 v.2.2.22 Extension package for pict2e]
+ [2023-07-04 v.2.3.1 Extension package for pict2e]
%</package|readme>
%<*driver>
\documentclass{ltxdoc}\errorcontextlines=9
@@ -161,7 +161,7 @@ README.txt and curve2e-v161.sty.
%</driver>
% \fi
%
-% \CheckSum{5602}
+% \CheckSum{5678}
% \begin{abstract}
% This file documents the |curve2e| extension package to the |pict2e|
% bundle implementation; the latter was described by Lamport
@@ -421,7 +421,11 @@ README.txt and curve2e-v161.sty.
% and transcendental functions can be computed in the background with the
% stable internal floating point facilities. We maintain some computation
% with complex number algebra, but use the |xfp| functionalities to
-% implement them and to make other calculations.
+% implement them and to make other calculations. Most |xfp| code has been
+% included into the \LaTeX\ kernel, so that most of this package
+% functionality is already available without the need of loading the
+% package. Loading is necessary only when a small set of special
+% functionalities are needed, that have not made their way to the kernel.
%
% Many aspects of this extension could be fine tuned for better
% performance; many new commands could be defined in order to further
@@ -585,6 +589,7 @@ README.txt and curve2e-v161.sty.
% protected so as to avoid overwriting register values loaded by other
% macro packages.
% \begin{macrocode}
+\newif\ifCV@polare \let\ifCV@polare\iffalse
\ifx\undefined\@tdA \newdimen\@tdA \fi
\ifx\undefined\@tdB \newdimen\@tdB \fi
\ifx\undefined\@tdC \newdimen\@tdC \fi
@@ -934,8 +939,11 @@ README.txt and curve2e-v161.sty.
% closed by the macro itself, so that no traces remain behind after its
% expansion.
% \begin{macrocode}
-\def\GetCoord(#1)#2#3{\bgroup\edef\x{\egroup\noexpand\IsPolar#1:?}\x
+\def\GetCoord(#1)#2#3{\let\ifCV@polare\iffalse
+\bgroup\edef\x{\egroup
+\noexpand\IsPolar#1:?}\x
{% Polar
+ \let\ifCV@polare\iftrue
\bgroup\edef\x{\egroup\noexpand\SplitPolar(#1)}\x\SCt@X\SCt@Y}%
{% Cartesian
\bgroup\edef\x{\egroup\noexpand\SplitCartesian(#1)}\x\SCt@X\SCt@Y}%
@@ -2099,7 +2107,40 @@ Computations go on, but the results may be meaningless}}{%
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsubsection{Arcs}
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% We start with tracing a circular arc of arbitrary center, arbitrary
+% We provide two ways of producing arcs so as to use different although
+% similar macros macros; they follow the following syntax:
+%\begin{flushleft}
+% \cs{Arc}\parg{center coordinates}\parg{starting cartesian point}\marg{angle}
+%
+% \cs{Arc}\parg{centercoordinates}\parg{starting polar point}\marg{ange}
+%\end{flushleft}
+%The difference between these macros and that of the standard
+% \pack{pict2e} package assumes that these new ones are easier to use;
+% the standard one; The latter does no require the center coordinates
+% and must be put in place with a |\put| command; its reference point
+% becomes the arc center; is it necessary to specify the coordinates
+% of both the starting and the ending point angles and the radius;
+% this implies that the user specifies compatible data; not too
+% difficult, but it is delicate for choosing the correct angles and
+% the correct distance from the implicit center.
+%
+% These new alternative macros leave the calculation of the radius
+% the software and the Pythagorean distance between the center and
+% the staring point and require the specification of the rotation
+% angle; but even in this way, used in the previous version of this
+% package, the cartesian coordinates of the staring point are very
+% easy when they imply an angle of an inter number of right angles
+% starting from the $x$ axis, but thy bicome non that easy when the
+% center and the starting point don't share either their abscissas
+% or their ordinates. The new alternate syntax uses the polar
+% coordinates; their reference point is the arc center and it appears
+% to be easier to specify the position of the starting point, because
+% its angle and it distance are both specified by the user. With the
+% drawings madre with the extended |picture| environment it seem to
+% be easier to have available both the absolute cartesian specification
+% and the centred polar specification.
+%
+% Therefore wetracing a circular arc of arbitrary center, arbitrary
% starting point and arbitrary aperture; the first macro checks the
% aperture; if this is not zero it actually proceeds with the necessary
% computations, otherwise it does nothing.
@@ -2113,7 +2154,7 @@ Computations go on, but the results may be meaningless}}{%
% \end{macrocode}
% The aperture is already memorised in |\@tdA|; the |\@Arc| macro
% receives the center coordinates in the first argument and the
-% coordinates of the starting point in the second argument.
+% coordinates of the starting point in the second argument. Fo easier calculation we assume that the angles are positve when rotating counterclockwise; if the user specificato is negative, we change sign, but remember the original sign so that in the end the arc will floe in the right direction
% \begin{macrocode}
\def\@Arc(#1)(#2){%
\ifdim\@tdA>\z@
@@ -2142,9 +2183,17 @@ Computations go on, but the results may be meaningless}}{%
% Now the radius is determined and the drawing point is moved to the
% starting point.
% \begin{macrocode}
-\SubVect#2from#1to\@V \ModOfVect\@V to\@Raggio
-\CopyVect#2to\@pPun
-\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
+\GetCoord(#2)\@pPunX\@pPunY
+\ifCV@polare
+ \ModOfVect#2to\@Raggio
+ \CopyVect#1to\@Cent
+ \AddVect#2and#1to\@pPun% punto da cui parte l'arco
+ \GetCoord(\@pPun)\@pPunX\@pPunY
+\else
+ \SubVect#2from#1to\@V \ModOfVect\@V to\@Raggio
+ \CopyVect#2to\@pPun
+ \CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
+\fi
% \end{macrocode}
% From now on it's better to define a new macro that will be used also in
% the subsequent macros that draw arcs; here we already have the starting
@@ -2255,9 +2304,9 @@ Computations go on, but the results may be meaningless}}{%
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsubsection{Arc vectors}
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% We exploit much of the above definitions for the |\Arc| macro for
+% We exploit much of the above definitions of the |\Arc| macro for
% drawing circular arcs with an arrow at one or both ends; the first
-% macro |\VerctorArc| draws an arrow at the ending point of the arc; the
+% macro |\VectorArc| draws an arrow at the ending point of the arc; the
% second macro |\VectorARC| (alias |\VVectorArc|) draws arrows at both
% ends; the arrows tips have the same shape as those for vectors;
% actually they are drawn by putting a vector of zero length at the
@@ -2265,9 +2314,13 @@ Computations go on, but the results may be meaningless}}{%
% PostScript arrows according to the specific option to the
% \texttt{pict2e} package.
%
+% It goes by itself the the ending point may be specified as absolute
+% cartesian coordinates or centred polar ones, the same as it was
+% described above for the arcs without vector tips.
+%
% But the arc drawing done here shortens it so as not to overlap on the
-% arrow tip(s); the only arrow tip (or both tips) are also lightly tilted in
-% order to avoid the impression of a corner where the arc enters the
+% arrow tip(s); the only arrow tip (or both tips) are also lightly tilted
+% in order to avoid the impression of a corner where the arc enters the
% arrow tip.
%
% All these operations require a lot of ``playing'' with vector
@@ -2299,11 +2352,13 @@ Computations go on, but the results may be meaningless}}{%
\@VARC(#1)(#2)%
\fi
\endgroup\ignorespaces}%
+%
\let\VVectorArc\VectorARC
+%
% \end{macrocode}
%
-% The single arrow tiped arc is defined with the following long macro where
-% all the described operations are performed more or less in the
+% The single arrow tipped arc is defined with the following long macro
+% where all the described operations are performed more or less in the
% described succession; probably the macro requires a little cleaning,
% but since it works fine we did not try to optimise it for time or
% number of tokens. The final part of the macro is almost identical to
@@ -2330,16 +2385,26 @@ Computations go on, but the results may be meaningless}}{%
to the range 0--360 taking the sign into consideration}%
\@whiledim\@tdA>360\p@\do{\advance\@tdA-360\p@}%
\fi
-\SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun
-\@tdE=\pIIe@FAW\@wholewidth \@tdE=\pIIe@FAL\@tdE
+\GetCoord(#2)\@pPunX\@pPunY
+\ifCV@polare
+ \ModOfVect#2to\@Raggio \CopyVect#2to\@V
+ \CopyVect#1to\@Cent
+ \AddVect#2and#1to\@pPun% punto da cui parte l'arco
+ \GetCoord(\@pPun)\@pPunX\@pPunY
+\else
+ \SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio
+ \CopyVect#2to\@pPun
+ \CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
+\fi
+\@tdE=\pIIe@FAW\@wholewidth \@tdE=\pIIe@FAL\@tdE
\DividE\@tdE by \@Raggio\unitlength to\DeltaGradi
\@tdD=\DeltaGradi\p@
-\@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD
-\@tdD=\ifx\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD
-\DirFromAngle\@tempa to\@Dir
-\Multvect{\@V}{\@Dir}\@sPun
+\@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD
+\@tdD=\ifx\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD
+\DirFromAngle\@tempa to\@Dir
+\Multvect{\@V}{\@Dir}\@sPun
\edef\@tempA{\ifx\Segno-\m@ne\else\@ne\fi}%
-\Multvect{\@sPun}{0,\@tempA}\@vPun
+\Multvect{\@sPun}{0,\@tempA}\@vPun
\DirOfVect\@vPun to\@Dir
\AddVect\@sPun and #1 to \@sPun
\GetCoord(\@sPun)\@tdX\@tdY
@@ -2354,6 +2419,7 @@ Computations go on, but the results may be meaningless}}{%
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc
\strokepath\ignorespaces}%
+%
% \end{macrocode}
%
% The macro for the arc terminated with arrow tips at both ends is again
@@ -2373,10 +2439,21 @@ Computations go on, but the results may be meaningless}}{%
to the range 0--360 taking the sign into consideration}%
\@whiledim\@tdA>360\p@\do{\advance\@tdA-360\p@}%
\fi
-\SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun
-\@tdE=\pIIe@FAW\@wholewidth \@tdE=0.8\@tdE
+\GetCoord(#2)\@pPunX\@pPunY
+\ifCV@polare
+ \ModOfVect#2to\@Raggio \CopyVect#2to\@V
+ \CopyVect#1to\@Cent
+ \AddVect#2and#1to\@pPun% punto da cui parte l'arco
+ \GetCoord(\@pPun)\@pPunX\@pPunY
+\else
+ \SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio
+ \CopyVect#2to\@pPun
+ \CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
+\fi
+\@tdE=\pIIe@FAW\@wholewidth \@tdE=\pIIe@FAL\@tdE
\DividE\@tdE by \@Raggio\unitlength to\DeltaGradi
-\@tdD=\DeltaGradi\p@ \@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD
+\@tdD=\DeltaGradi\p@
+\@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD
\@tdD=\if\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD
\DirFromAngle\@tempa to\@Dir
\Multvect{\@V}{\@Dir}\@sPun% corrects the end point
@@ -2411,6 +2488,7 @@ Computations go on, but the results may be meaningless}}{%
\GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc
\strokepath\ignorespaces}%
+
% \end{macrocode}
%
% It must be understood that the curved vectors, the above circular arcs
diff --git a/macros/latex/contrib/curve2e/curve2e.pdf b/macros/latex/contrib/curve2e/curve2e.pdf
index bbf3b4eb68..3969cc4e45 100644
--- a/macros/latex/contrib/curve2e/curve2e.pdf
+++ b/macros/latex/contrib/curve2e/curve2e.pdf
Binary files differ
diff --git a/macros/latex/contrib/exam/README b/macros/latex/contrib/exam/README
index c640150cd6..c3b4ae7e90 100644
--- a/macros/latex/contrib/exam/README
+++ b/macros/latex/contrib/exam/README
@@ -1,5 +1,4 @@
-This is version 2.7 of the exam document class, dated February 26,
-2021.
+This is version 2.704 of the exam document class, dated July 9, 2023.
The exam document class, together with its user's guide examdoc.tex,
attempts to make it easy for even a LaTeX novice to prepare exams.
diff --git a/macros/latex/contrib/exam/exam.cls b/macros/latex/contrib/exam/exam.cls
index ae851ef203..002100639d 100644
--- a/macros/latex/contrib/exam/exam.cls
+++ b/macros/latex/contrib/exam/exam.cls
@@ -4,7 +4,7 @@
%% exam.cls
%% Copyright (c) 1994, 1997, 2000, 2004, 2008, 2011,
-%% 2015, 2017, 2021 Philip S. Hirschhorn
+%% 2015, 2017, 2021, 2023 Philip S. Hirschhorn
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -32,8 +32,8 @@
% from my web page: http://www-math.mit.edu/~psh/
-\def\fileversion{2.7}
-\def\filedate{2021/02/26}
+\def\fileversion{2.704}
+\def\filedate{2023/07/09}
%---------------------------------------------------------------------
%---------------------------------------------------------------------
%
@@ -86,6 +86,53 @@
% Changelog since version 2.4:
%--------------------------------------------------------------------
+% Version 2.704, 2023/07/08
+
+% No longer betatest.
+
+%--------------------------------------------------------------------
+% Version 2.703$\beta$, 2023/02/12
+
+% We modify the definition of \colorfbox to eliminate the warning
+
+% Package xcolor Warning: Incompatible color definition
+
+% when the user has loaded xcolor.sty instead of color.sty. We fixed
+% this by having \colorfbox check whether the user has loaded
+% xcolor.sty or color.sty, and then using the appropriate command when
+% saving the current color.
+
+%--------------------------------------------------------------------
+% Version 2.702$\beta$, 2022/07/04
+
+% We modify the changes in version 2.701$\beta$ so that they only have
+% effect if the user gives the command \solutionsreseteqcounter, so
+% that the default behavior is identical to the behavior before
+% version 2.701$\beta$. This can be cancelled at any point by giving
+% the command \nosolutionsreseteqcounter. There is also a new
+% documentclass option ``solutionsreseteqcounter'', which is
+% equivalent to giving the command \solutionsreseteqcounter at the
+% beginning of the file.
+%
+%--------------------------------------------------------------------
+% Version 2.701$\beta$, 2022/07/02
+
+% All solution environments (solution, solutionorbox, solutionorlines,
+% solutionordottedlines, solutionorgrid, and solutionbox) now save the
+% current value of the equation counter and then reset the equation
+% counter to zero, so that equations numbers start from one within
+% each solution, and then restore the saved value of the equation
+% counter at the end of the environment. This corrects the problemn
+% that if an equation anvironment appeared inside of a solution, it
+% would affect the equation numbers appearing later in the document,
+% even if solutions weren't being printed.
+%
+% Note: This was modified in version 2.702$\beta$ so that it only
+% takes effect if the user gives the command \solutionsreseteqcounter,
+% and so the default behavior is identical tothe behavior before
+% version 2.701$\beta$.
+
+%--------------------------------------------------------------------
% Version 2.7, 2021/02/26
% No longer betatest.
@@ -646,6 +693,11 @@
\DeclareOption{cancelspace}{\cancelspacetrue}
\DeclareOption{nocancelspace}{\cancelspacefalse}
+\newif\ifsolutionsreseteqcounter
+\solutionsreseteqcounterfalse
+\DeclareOption{solutionsreseteqcounter}{\solutionsreseteqcountertrue}
+\DeclareOption{nosolutionsreseteqcounter}{\solutionsreseteqcounterfalse}
+
% The following keeps track of whether the user has requested that we
% add up the points on the exam. We make the default false so that
% users who put other than numbers into the points argument of a
@@ -4609,9 +4661,9 @@
in order to use the command \protect\colorfillwithlines
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -4708,9 +4760,9 @@
in order to use the command \protect\colorfillwithdottedlines
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -4799,9 +4851,9 @@
\space\space\protect\usepackage{color}\MessageBreak
in order to use the command \protect\colorgrids
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -7621,7 +7673,17 @@
\def\nounstarredvspace{\@unstarredvspacefalse}
\nounstarredvspace
+% If the documentclass options include ``solutionsreseteqcounter'',
+% then the command \solutionsreseteqcounter is given at the beginning
+% of the run.
+% If the documentclass options include ``nosolutionsreseteqcounter'',
+% then the command \nosolutionsreseteqcounter is given at the beginning
+% of the run.
+
+\def\solutionsreseteqcounter{\solutionsreseteqcountertrue}
+\def\nosolutionsreseteqcounter{\solutionsreseteqcounterfalse}
+
% \if@insolution will be true while we're inside of any of the
% solution environments. This is used to supress \PgInfo@write and
% \label commands generated if there's a parts (or subparts, or
@@ -7636,6 +7698,12 @@
}
\SolutionEmphasis{}
+% When we enter any of the solution (etc.) environments we save the
+% value of the equation counter, set the equation counter to zero, and
+% then restore the value of the equation counter at the end of the
+% environment.
+\newcounter{exam@saved@eqnum}
+
% If printanswers is true, we print the solution using a TheSolution
% environment. If printanswers is false and cancelspace is false, we
% insert blank vertical space equal to the optional argument (the
@@ -7644,6 +7712,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7669,6 +7741,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7681,6 +7756,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7720,6 +7799,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7730,6 +7812,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7751,6 +7837,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7761,6 +7850,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7782,6 +7875,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7792,6 +7888,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7813,6 +7913,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
@@ -7874,9 +7977,9 @@
in order to use the command \protect\shadedsolutions
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -7947,9 +8050,9 @@
in order to use the command \protect\colorsolutionboxes
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -7963,6 +8066,10 @@
\newenvironment{solutionbox}[1]{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\def\solutionbox@size{#1}% saved for end of environment
% Change, 2016/02/08: So that the solutionbox environment will work
% correctly inside of a tabular environment, we use \hsize instead of
@@ -8022,12 +8129,16 @@
% Starting in version 2.502, 2016/03/23,the decision of whether to
% color the box is made in the \makeemptybox command:
\makeemptybox{\solutionbox@size}
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}% End of the second argument of \newenvironment{solutionbox}
%--------------------------------------------------------------------
%--------------------------------------------------------------------
% Added in version 2.502: 2016/03/23, \colorfbox
+% Modified in version 2.703, 2023/02/12
% The \colorfbox command is used in our modification of framed.sty
% that allows us to print the frame around the solution in color when
@@ -8035,25 +8146,66 @@
% arguments, the first being the color for the frame, and the second
% being the stuff to be framed.
+% When you define a color mycolor using either color.sty or
+% xcolor.sty, a macro \csname\string\color@ mycolor\endcsname is
+% defined (i.e., the macro name is \\color@mycolor).
+
% If we had assumed that xcolor.sty was used (instead of just
% color.sty), then the line that saves the current color in
% saved@color could have been just
% \colorlet{saved@color}{.}
-% but we wanted to make this work even if color.sty is being used.
+% but we wanted to make this work even if color.sty was being used, when
+% the command needed to save the color is
-% When you define a color mycolor using either color.sty or
-% xcolor.sty, a macro \csname\string\color@ mycolor\endcsname is
-% defined (i.e., the macro name is \\color@mycolor).
+% \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+
+% To make this useable whether either color.sty or xcolor.sty was
+% being used, the original version of this command saved the current
+% color using the command that works for color.sty, which also seemed
+% to work for xcolor.sty. Alas, it turned out that if the user was
+% using xcolor sty, then \colorsolutionboxes worked OK except that
+% xcolor.sty put the warning
+
+% Package xcolor Warning: Incompatible color definition
+
+% into the log file. It turned out that the reason for the warning is
+% that, although both color.sty and xcolor.sty create the same macro
+% name, xcolor.sty puts more information into that macro than
+% color.sty does, and so when xcolor.sty sees a color definition in
+% the form used by color.sty, it generates that warning.
+
+% To eliminate that warning, in version 2.703 we changed the
+% \colorfbox command to check whether xcolor.sty is loaded (in which
+% case we use the \colorlet command) or color.sty is loaded (in which
+% case we use the longer command that works for color.sty).
+
+% \newcommand{\colorfbox}[2]{%
+% % Save the current color in saved@color:
+% \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+% % Create the box in color #1, with the text in saved@color
+% % (the braces are to confine the color change commands):
+% {\color{#1}\fbox{\color{saved@color}#2}}%
+% }% colorfbox
+
\newcommand{\colorfbox}[2]{%
% Save the current color in saved@color:
- \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+ \@ifundefined{colorlet}{%
+ % color.sty was used
+ \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+ }%
+ {%
+ % xcolor.sty was used
+ \colorlet{saved@color}{.}%
+ }%
% Create the box in color #1, with the text in saved@color
% (the braces are to confine the color change commands):
{\color{#1}\fbox{\color{saved@color}#2}}%
-}% colorfbox
+}% newcommand
+
+
%--------------------------------------------------------------------
%--------------------------------------------------------------------
diff --git a/macros/latex/contrib/exam/exam.md5 b/macros/latex/contrib/exam/exam.md5
index c7a6e049d9..44ae8fcbec 100644
--- a/macros/latex/contrib/exam/exam.md5
+++ b/macros/latex/contrib/exam/exam.md5
@@ -1,3 +1,3 @@
-b210b790c86d89aeccb508074bd001ae exam.cls
-08261e0c96d341f948483d8fbf78a118 examdoc.pdf
-b44eb4ab2c875e46f5239d5c27c37d64 examdoc.tex
+cf61070d137ac4d18fa1ab3aa514381e exam.cls
+4d780e1174ccd0bf6457779c74cc98ee examdoc.pdf
+2ac54d161ee18bd44b0a1289f662e305 examdoc.tex
diff --git a/macros/latex/contrib/exam/examdoc.pdf b/macros/latex/contrib/exam/examdoc.pdf
index dcd7c71f3d..4ae10be84c 100644
--- a/macros/latex/contrib/exam/examdoc.pdf
+++ b/macros/latex/contrib/exam/examdoc.pdf
Binary files differ
diff --git a/macros/latex/contrib/exam/examdoc.tex b/macros/latex/contrib/exam/examdoc.tex
index dfca897c85..9b733c935b 100644
--- a/macros/latex/contrib/exam/examdoc.tex
+++ b/macros/latex/contrib/exam/examdoc.tex
@@ -8,7 +8,7 @@
% The exam documentclass itself is in the file exam.cls.
-%%% Copyright (c) 1997, 2000, 2004, 2008, 2011, 2015, 2017, 2021
+%%% Copyright (c) 1997, 2000, 2004, 2008, 2011, 2015, 2017, 2021, 2023
% Philip S. Hirschhorn
%
% This work may be distributed and/or modified under the
@@ -52,8 +52,8 @@
% Usage: \texttt{\bs documentclass}
\newcommand{\bs}{\texorpdfstring{\char`\\}{}}
-\newcommand{\docversion}{2.7}
-\newcommand{\docdate}{August 14, 2022}
+\newcommand{\docversion}{2.704}
+\newcommand{\docdate}{July 9, 2023}
%\newcommand{\docdate}{Draft: \today}
%--------------------------------------------------------------------
@@ -74,7 +74,7 @@
\newcommand{\indtsub}[2]{\index{#1@\texttt{#1}!#2}}
\newcommand{\indtstart}[1]{\index{#1@\texttt{#1}|(}}
\newcommand{\indtstop}[1]{\index{#1@\texttt{#1}|)}}
-
+\index{xcolor|see{color}}
%---------------------------------------------------------------------
\newenvironment{example}%
{\bigskip\filbreak
@@ -132,7 +132,7 @@
Wellesley, MA 02481\\
psh@math.mit.edu\\[\bigskipamount]
Copyright \copyright~1994, 1997, 2000, 2004, 2008, 2011, 2015, 2017,
- 2021\\
+ 2021, 2023\\
Philip Hirschhorn\\
All rights reserved}
@@ -3547,10 +3547,10 @@ which would cause correct choices to be printed in italics when
solutions are being printed.
For another example, if you give the command
-\verb"\usepackage{color}"\indt{color} in the preamble\index{preamble}
-of your document (i.e., after the \verb"\documentclass" command and
-before the \verb"\begin{document}"), and then give the
- command\indc{CorrectChoiceEmphasis}\indc{color}
+\verb"\usepackage{color}"\indt{color} (or \verb"\usepackage{xcolor}")
+in the preamble\index{preamble} of your document (i.e., after the
+\verb"\documentclass" command and before the \verb"\begin{document}"),
+ and then give the command\indc{CorrectChoiceEmphasis}
\begin{center}
\verb"\CorrectChoiceEmphasis{\color{red}}"
\end{center}
@@ -3558,9 +3558,10 @@ then when solutions are being printed the correct choices will be
printed in red (assuming your printer can produce that color).
For another example, if you give the command
-\verb"\usepackage{color}"\indt{color} in the preamble of your document
-(i.e., after the \verb"\documentclass" command and before the
-\verb"\begin{document}" command) and then give the command\indc{color}
+\verb"\usepackage{color}"\indt{color} (or \verb"\usepackage{xcolor}")
+in the preamble of your document (i.e., after the
+\verb"\documentclass" command and before the \verb"\begin{document}"
+ command) and then give the command
\begin{center}
\verb"\CorrectChoiceEmphasis{\color{red}\bfseries}"
\end{center}
@@ -4219,9 +4220,10 @@ commands\indc{colorfillwithlines}\index{color package}
\verb"\colorfillwithlines"
\end{tabular}
\end{center}
-then the lines will be in color, by default a light gray. That
-default color was defined by the
-command\indc{definecolor}\indt{FillWithLinesColor}
+(or \verb"\usepackage{xcolor}" instead of
+\verb"\usepackage{color}")(or \verb"\usepackage{xcolor}") then the
+lines will be in color, by default a light gray. That default color
+was defined by the command\indc{definecolor}\indt{FillWithLinesColor}
\begin{center}
\verb"\definecolor{FillWithLinesColor}{gray}{0.8}"
\end{center}
@@ -4360,6 +4362,7 @@ commands\indc{colorfillwithdottedlines}\index{color package}
\verb"\colorfillwithdottedlines"
\end{tabular}
\end{center}
+(or \verb"\usepackage{xcolor}" instead of \verb"\usepackage{color}")
then the dotted lines will be in color, by default a light gray. That
default color was defined by the
command\indc{definecolor}\indt{FillWithDottedLinesColor}
@@ -4490,6 +4493,7 @@ commands\indc{colorgrids}\index{color package}
\verb"\colorgrids"
\end{tabular}
\end{center}
+(or \verb"\usepackage{xcolor}" instead of \verb"\usepackage{color}")
then the grids will be in color, by default a light gray. That
default color was defined by the
command\indc{definecolor}\indt{GridColor}
@@ -4605,7 +4609,8 @@ the following into your preamble (i.e., after the
{}
{Page \thepage\ of \numpages}
\end{verbatim}
-
+(You could also use \verb"\usepackage{xcolor}" instead of
+\verb"\usepackage{color}")
%--------------------------------------------------------------------
\subsubsection{Printing graph paper}
@@ -5072,9 +5077,11 @@ command\index{color package}
\begin{center}
\verb"\usepackage{color}"
\end{center}
-in the preamble of your document (i.e., after the
-\verb"\documentclass" command and before the \verb"\begin{document}"
- command), then you can give the command\indc{shadedsolutions}
+(or the \verb"xcolor" package with the command
+\verb"\usepackage{xcolor}") in the preamble of your document (i.e.,
+after the \verb"\documentclass" command and before the
+\verb"\begin{document}" command), then you can give the
+ command\indc{shadedsolutions}
\begin{center}
\verb"\shadedsolutions"
\end{center}
@@ -5246,10 +5253,11 @@ example, you give the command
\verb"\SolutionEmphasis{\itshape\small}"
\end{center}
then the solutions will be set in italics, in small type. For another
-example, if you've given the command \verb"\usepackage{color}" in the
-preamble of your document (i.e., after the \verb"\documentclass"
-command and before the \verb"\begin{document}") and you give the
-command\indc{SolutionEmphasis}
+example, if you've given the command \verb"\usepackage{color}" (or
+\verb"\usepackage{xcolor}") in the preamble of your document (i.e.,
+after the \verb"\documentclass" command and before the
+\verb"\begin{document}") and you give the
+ command\indc{SolutionEmphasis}
\begin{center}
\verb"\SolutionEmphasis{\color{red}}"
\end{center}
@@ -5562,9 +5570,10 @@ If you've given the command
\begin{center}
\verb"\usepackage{color}"\index{color package}
\end{center}
-in the preamble of your document (i.e., after the
-\verb"\documentclass" command and before the \verb"\begin{document}"
-command), then you can give the command\indc{colorsolutionboxes}
+(or \verb"\usepackage{xcolor}") in the preamble of your document
+(i.e., after the \verb"\documentclass" command and before the
+\verb"\begin{document}" command), then you can give the
+ command\indc{colorsolutionboxes}
\begin{center}
\verb"\colorsolutionboxes"
\end{center}
@@ -5584,6 +5593,49 @@ the command\indc{nocolorsolutionboxes}
\verb"\nocolorsolutionboxes"
\end{center}
+%--------------------------------------------------------------------
+\subsection{Equations inside solutions}
+\label{sec:EqsInSolutions}
+
+If you use an \verb"equation" environment inside of a solution, then
+that environment (like all \verb"equation" environments) will be
+numbered using the \verb"equation" counter%
+\index{equation counter@\texttt{equation} counter}, which will affect
+the numbering of equations that follow. However, if you then print a
+version of your exam without using the \verb"\printanswers" command
+(or the documentclass option \verb"answers"), then the equation inside
+the solution environment will not appear, and this will change the
+equation numbers of the later \verb"equation" environments.
+
+If you want to avoid having \verb"equation" numbers change depending
+on whether or not solutions are being printed, you can do this either
+by using the documentclass option
+\begin{center}
+ \verb"solutionsreseteqcounter"
+\end{center}
+or by giving the command
+\begin{center}
+ \verb"\solutionsreseteqcounter"\indc{solutionsreseteqcounter}
+\end{center}
+at the beginning of your file. That command causes equation numbers
+inside each solution to be independent of the equation numbers outside
+of the solution environment or in other solution environments.
+
+In more detail: If you give the command
+\verb"\solutionsreseteqcounter" then every time you begin one of the
+solution environments, the \verb"equation" counter will be reset to
+zero (so that the first \verb"equation" environment in the solution
+will be number 1), and when you end that solution environment the
+\verb"equation" counter will be restored to whatever it was before the
+solution environment.
+
+If you've given the command \verb"\solutionsreseteqcounter" and you
+want to change back to not having solutions reset the equation
+counter, you can do that by giving the command
+\begin{center}
+ \verb"\nosolutionsreseteqcounter"\indc{nosolutionsreseteqcounter}
+\end{center}
+
%--------------------------------------------------------------------
diff --git a/macros/latex/contrib/tagpdf/README.md b/macros/latex/contrib/tagpdf/README.md
index bb0353de51..2196a3b515 100644
--- a/macros/latex/contrib/tagpdf/README.md
+++ b/macros/latex/contrib/tagpdf/README.md
@@ -1,6 +1,6 @@
#tagpdf — A package to create tagged pdf
-Packageversion: 0.98i
-Packagedate: 2023/06/14
+Packageversion: 0.98j
+Packagedate: 2023/07/08
Author: Ulrike Fischer
## License
diff --git a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
index a9c4763358..66a6e7ff7c 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*luatex>
-\ProvidesExplFile {tagpdf-luatex.def} {2023-06-14} {0.98i}
+\ProvidesExplFile {tagpdf-luatex.def} {2023-07-08} {0.98j}
{tagpdf~driver~for~luatex}
% \end{macrocode}
% \section{Loading the lua}
@@ -158,8 +158,8 @@
local ProvidesLuaModule = {
name = "tagpdf",
- version = "0.98i", --TAGVERSION
- date = "2023-06-14", --TAGDATE
+ version = "0.98j", --TAGVERSION
+ date = "2023-07-08", --TAGDATE
description = "tagpdf lua code",
license = "The LATEX Project Public License 1.3c"
}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
index 81fd2c8d95..eddfe3eca3 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx
@@ -48,7 +48,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% \section{Commands}
@@ -76,7 +76,7 @@
% The LaTeX commands will do that automatically
% at some time but it is in the responsability of the user to
% ensure that when using low-level code.
-% If the internal command doesn't exist the box is assumed to be tagged.
+% If the internal command doesn't exist the box is assumed to be untagged.
% \end{function}
% \section{Description of log messages}
% \subsection{\cs{ShowTagging} command}
@@ -312,7 +312,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-checks-code} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-checks-code} {2023-07-08} {0.98j}
{part of tagpdf - code related to checks, conditionals, debugging and messages}
%</header>
% \end{macrocode}
@@ -471,12 +471,11 @@
% parent tags.
% \begin{macrocode}
\msg_new:nnn { tag } {role-parent-child}
- { Rule~'#1'~-->~'#2'~is~#3~\msg_line_context:}
+ { Parent-Child~'#1'~-->~'#2'.\\Relation~is~#3~\msg_line_context:}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{role-parent-child}
-% This is info and warning message about the containment rules between child and
-% parent tags.
+% \begin{macro}{role-remapping}
+% This is info and warning message about role-remapping
% \begin{macrocode}
\msg_new:nnn { tag } {role-remapping}
{ remapping~tag~to~#1 }
@@ -579,19 +578,19 @@
% The LaTeX commands will do that automatically
% at some time but it is in the responsability of the user to
% ensure that when using low-level code.
-% If the internal command doesn't exist the box is assumed to be tagged.
+% If the internal command doesn't exist the box is assumed to be untagged.
% \begin{macrocode}
%<*base>
\prg_new_conditional:Npnn \tag_if_box_tagged:N #1 {p,T,F,TF}
{
\tl_if_exist:cTF {l_tag_box_\int_use:N #1_tl}
{
- \int_compare:nNnTF {\tl_use:c{l_tag_box_\int_use:N #1_tl}}>{0}
+ \int_compare:nNnTF {0\tl_use:c{l_tag_box_\int_use:N #1_tl}}>{0}
{ \prg_return_true: }
{ \prg_return_false: }
}
{
- \prg_return_true:
+ \prg_return_false:
% warning??
}
}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-code.pdf b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
index 5784294ea4..cb4f7968bb 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-code.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf-data.dtx b/macros/latex/contrib/tagpdf/tagpdf-data.dtx
index 57dc3d356e..164fb7d728 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-data.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-data.dtx
@@ -47,7 +47,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% This files contains a various data files which are read in
@@ -60,7 +60,7 @@
% It lists the new tag, the rolemap and the namespace of the rolemap.
% \begin{macrocode}
%<*ns-latex>
-%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-07-08} {0.98j}
%% {latex} {https://www.latex-project.org/ns/dflt/2022}{}
title, Title, pdf2,
part, Title, pdf2,
@@ -92,7 +92,7 @@ text, P, pdf2,
% It is bound to change
% \begin{macrocode}
%<*ns-latex-book>
-%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-07-08} {0.98j}
%% {latex-book} {https://www.latex-project.org/ns/book/2022}{}
chapter, H1,pdf2,
section, H2,pdf2,
@@ -108,7 +108,7 @@ subparagraph, H6,pdf2,
% It is bound to change a lot!
% \begin{macrocode}
%<*ns-latex-inline>
-%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-07-08} {0.98j}
%% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{}
chapter, Span, pdf2,
section, Span, pdf2,
@@ -122,7 +122,7 @@ P, Span, pdf2,
% \section{The pdf namespace data}
% \begin{macrocode}
%<*ns-pdf>
-%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-07-08} {0.98j}
%% {pdf} {http://iso.org/pdf/ssn}{}
StructTreeRoot,StructTreeRoot,pdf,D,
Document,Document,pdf,D,
@@ -190,7 +190,7 @@ Strong,Span,pdf,I,
% \section{The pdf 2.0 namespace data}
% \begin{macrocode}
%<*ns-pdf2>
-%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-07-08} {0.98j}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
Document,Document,pdf2,D,
Part,Part,pdf2,G,
@@ -246,7 +246,7 @@ Strong,Strong,pdf2,I,
% \section{The mathml namespace data}
% \begin{macrocode}
%<*ns-mathml>
-%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-07-08} {0.98j}
% {mathml}{http://www.w3.org/1998/Math/MathML}{}
abs,abs,mathml,
and,and,mathml,
@@ -481,7 +481,7 @@ xor,xor,mathml,
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child>
-%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-07-08} {0.98j}
,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC
Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅
@@ -536,7 +536,7 @@ MC,both,---,∅,∅,∅,∅,∅,∅,0..n,‡,∅,∅,∅,0..n,0..n,0..n,0..n,0..
% This will perhaps change in future.
% \begin{macrocode}
%<*parent-child-2>
-%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-06-14} {0.98i}
+%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-07-08} {0.98j}
,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC
Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅
DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
index 97732c57bf..d8c1f52cca 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% \end{documentation}
@@ -55,11 +55,11 @@
% \begin{macrocode}
%<@@=tag>
%<*generic>
-\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-07-08} {0.98j}
{part of tagpdf - code related to marking chunks - generic mode}
%</generic>
%<*debug>
-\ProvidesExplPackage {tagpdf-debug-generic} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-debug-generic} {2023-07-08} {0.98j}
{part of tagpdf - debugging code related to marking chunks - generic mode}
%</debug>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
index 261a3ff73f..99039a9744 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{implementation}
% The code is splitted into three parts: code shared by all engines,
@@ -86,7 +86,7 @@
% \begin{macrocode}
%<@@=tag>
%<*luamode>
-\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-07-08} {0.98j}
{tagpdf - mc code only for the luamode }
%</luamode>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
index 9c9d4ec735..9a9a1046b6 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -181,7 +181,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-07-08} {0.98j}
{part of tagpdf - code related to marking chunks -
code shared by generic and luamode }
%</header>
diff --git a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
index fcfd5f7534..736eac4a70 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% \begin{function}
@@ -98,7 +98,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-roles-code} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-roles-code} {2023-07-08} {0.98j}
{part of tagpdf - code related to roles and structure names}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-space.dtx b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
index e6b5e02513..c1798f16c6 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-space.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-space.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% \begin{function}{interwordspace (setup-key)}
@@ -64,7 +64,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-space-code} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-space-code} {2023-07-08} {0.98j}
{part of tagpdf - code related to real space chars}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
index d2bb7a2b08..a7bee487a4 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% \section{Public Commands}
@@ -247,7 +247,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-struct-code} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-struct-code} {2023-07-08} {0.98j}
{part of tagpdf - code related to storing structure}
%</header>
% \end{macrocode}
@@ -1740,7 +1740,7 @@
% \section{Attributes and attribute classes}
% \begin{macrocode}
%<*header>
-\ProvidesExplPackage {tagpdf-attr-code} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-attr-code} {2023-07-08} {0.98j}
{part of tagpdf - code related to attributes and attribute classes}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
index 393a7c359f..010e9a3fcc 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx
@@ -47,13 +47,13 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{implementation}
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-tree-code} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-tree-code} {2023-07-08} {0.98j}
{part of tagpdf - code related to writing trees and dictionaries to the pdf}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf-user.dtx b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
index be082172ef..f33d710e36 100644
--- a/macros/latex/contrib/tagpdf/tagpdf-user.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf-user.dtx
@@ -46,7 +46,7 @@
% }^^A
% }
%
-% \date{Version 0.98i, released 2023-06-14}
+% \date{Version 0.98j, released 2023-07-08}
% \maketitle
% \begin{documentation}
% \section{Setup commands}
@@ -250,7 +250,7 @@
% \begin{macrocode}
%<@@=tag>
%<*header>
-\ProvidesExplPackage {tagpdf-user} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-user} {2023-07-08} {0.98j}
{tagpdf - user commands}
%</header>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf.dtx b/macros/latex/contrib/tagpdf/tagpdf.dtx
index b5898d0ed4..add2dceced 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.dtx
+++ b/macros/latex/contrib/tagpdf/tagpdf.dtx
@@ -92,7 +92,7 @@
% \begin{macrocode}
%<@@=tag>
%<*package>
-\ProvidesExplPackage {tagpdf} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf} {2023-07-08} {0.98j}
{ A package to experiment with pdf tagging }
\bool_if:nF
@@ -118,7 +118,7 @@
% \end{macrocode}
%<*debug>
% \begin{macrocode}
-\ProvidesExplPackage {tagpdf-debug} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-debug} {2023-07-08} {0.98j}
{ debug code for tagpdf }
\@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput}
% \end{macrocode}
@@ -141,7 +141,7 @@
% we define a base package with dummy functions
% \begin{macrocode}
%<*base>
-\ProvidesExplPackage {tagpdf-base} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdf-base} {2023-07-08} {0.98j}
{part of tagpdf - provide base, no-op versions of the user commands }
%</base>
% \end{macrocode}
diff --git a/macros/latex/contrib/tagpdf/tagpdf.pdf b/macros/latex/contrib/tagpdf/tagpdf.pdf
index 329b97b8a5..4a68c8dbb8 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.pdf
+++ b/macros/latex/contrib/tagpdf/tagpdf.pdf
Binary files differ
diff --git a/macros/latex/contrib/tagpdf/tagpdf.tex b/macros/latex/contrib/tagpdf/tagpdf.tex
index 1ee0abb181..8f54068192 100644
--- a/macros/latex/contrib/tagpdf/tagpdf.tex
+++ b/macros/latex/contrib/tagpdf/tagpdf.tex
@@ -16,8 +16,8 @@
}
\DebugBlocksOff
\makeatletter
-\def\UlrikeFischer@package@version{0.98i}
-\def\UlrikeFischer@package@date{2023-06-14}
+\def\UlrikeFischer@package@version{0.98j}
+\def\UlrikeFischer@package@date{2023-07-08}
\makeatother
\documentclass[bibliography=totoc,a4paper]{article}
@@ -2222,6 +2222,164 @@ This is in pdftex a primitive. It inserts the dummy space glyph. \pkg{tagpdf} de
\section{Storing and reusing boxes}\label{sec:savebox}
+\section{Saving and using boxes}
+
+\TeX{} allows to store material in boxes and to use these box once or
+multiple times in other places. This poses some challenges to tagging. The
+listings in the following examples uses low-level \TeX{} box commands to
+avoid that changes in the \LaTeX{} commands that improve tagging interfere
+in case you want to test this. To keep the examples short they don't show
+the needed \cs{ExplSyntaxOn}/\cs{ExplSyntaxOff}.
+
+\subsection{Boxes without tagging commands}
+
+
+If no tagging commands were used (or if they were inactive) when the box
+was stored then there is no problem to use this box with
+pdf\LaTeX{}/generic mode in various places. So
+
+\begin{taglstlisting}
+\newbox\mybox
+The\setbox\mybox\hbox{yellow} duck
+
+The \box\mybox{} sun
+\end{taglstlisting}
+
+will produce (assuming para tagging is activated) the paragraph structures
+\enquote{The duck} and \enquote{The yellow sun}.
+
+
+With lua\LaTeX{}/lua mode this is different: The nodes in the box will have
+the mc-attribute value attached which were active when the box was saved
+and this value is recorded as kid of the first paragraph. So when the lua
+code later wanders through the box to find all kids of structure it will
+also find the content of the \cs{usebox}. This means with lua\LaTeX{} we
+get the two paragraph structures \enquote{The duck yellow} and \enquote{The
+sun}.
+
+The solution here is to reset the attributes before using the box:
+
+\begin{taglstlisting}
+The\setbox\mybox\hbox{yellow} duck
+
+The \tag_mc_reset_box:N\mybox\box\mybox{} sun
+\end{taglstlisting}
+
+
+The box can in both modes be used without problems many times.
+
+
+\subsection{Boxes with tagging commands}
+
+We assume in the following that the box contains only well balanced tagging
+commands and no parts that are \enquote{untagged}. It should be possible to
+copy the whole box inside a \verb+\tagstructbegin+/\verb+\tagstructend+
+pair. So the following is fine as box content
+\begin{taglstlisting}
+box=\tagstructbegin{...}\tagmcbegin{} balanced content\tagmcend\tagstructend
+box=
+ \tagmcbegin{}text\tagmcend
+ \tagstructbegin{...}\tagmcbegin{} balanced content\tagmcend\tagstructend
+ \tagmcbegin{}text\tagmcend
+\end{taglstlisting}
+but this not (this case could probably be handled nevertheless with a bit
+care at least in lua mode)
+\begin{taglstlisting}
+box= text\tagmcend\tagstructbegin{...}...\tagstructend\tagmcbegin{}text
+\end{taglstlisting}
+and this is absolutely unusable:
+\begin{taglstlisting}
+box= text\tagmcend\tagstructbegin{...}\tagmcbegin{}text
+\end{taglstlisting}
+
+We also assume that we want to move the structure of the box to the place
+where the box is used (if the structure should stay where the box is saved,
+simply save it and that will happen). For this we must add a structure that
+we can stash and label.
+
+\begin{taglstlisting}
+\tag_mc_end_push: % interrupt an open mc
+\tagstructbegin{tag=NonStruct,stash}
+ \edef\myboxnum{\tag_get:n{struct_num}} % store structure number
+ \setbox\mybox\hbox %or \vbox or ...
+ {content}
+\tagstructend
+\tag_mc_begin_pop:n{}% restart open mc
+\end{taglstlisting}
+
+At the place where the box is then used we also have to inject this
+structure:
+
+\begin{taglstlisting}
+\tag_mc_end_push: % interrupt an open mc
+\tag_struct_use_num:n {\myboxnum} % use structure
+\box\mybox % use box
+\tag_mc_begin_pop:n{}% restart open mc
+\end{taglstlisting}
+
+With pdf\LaTeX{} Boxes with tagging commands can currently be used only
+once. The tagging commands set labels and reusing the box gives multiple
+label warnings.
+
+With lua\LaTeX{} it is possible to reset the attributes as done with the
+untagged box and then to reuse at least the content.
+
+\subsection{Detecting tagging commands}
+
+It is possible to detect if a box contains tagging commands by comparing
+the state of the mc and structure counter:
+\begin{verbatim}
+\def\statebeforebox\inteval{\tag_get:n{struct_counter}+\tag_get:n{mc_counter}}
+\setbox\mybox ...
+%compare numbers against \statebeforebox
+\end{verbatim}
+
+
+
+\subsection{Putting everything together}
+
+To tag boxes that can be both (without tagging commands or with balanced
+tagging commands) the following strategy can be used:
+
+\begin{itemize}
+\item when storing the box put around it a structure as need by the
+ tagged variant:
+\begin{verbatim}
+\tag_mc_end_push: % interrupt an open mc
+\tagstructbegin{tag=NonStruct,stash}
+\edef\myboxnum{\tag_get:n{struct_num}} % store structure number
+ \def\statebeforebox{\inteval{\tag_get:n{struct_counter}+\tag_get:n{mc_counter}}}
+ \setbox\mybox\hbox %or \vbox or ...
+ {content}
+ %check if there is tagging content and store that
+\tagstructend
+\tag_mc_begin_pop:n{}% restart open mc
+\end{verbatim}
+
+\item when using the box the first time
+ \begin{itemize}
+ \item if it has no tagging commands then reset the attribute and use
+ the box.
+ \begin{verbatim}
+ The \tagmcresetbox\mybox\box\mybox{} sun
+ \end{verbatim}
+ The stashed \texttt{NonStruct} structure is then thrown away.
+ \item if there is a structure then use the stashed structure
+ \begin{verbatim}
+ \tag_mc_end_push: % interrupt an open mc
+ \tag_struct_use_num:n {\myboxnum} % use structure
+ \box\mybox % use box
+ \tag_mc_begin_pop:n{}% restart open mc
+ \end{verbatim}
+ \end{itemize}
+
+ \item if the box is used a second time then throw an error with
+ pdf\LaTeX{}. With lua\LaTeX{} reset the attributes and issue a
+ warning.
+
+\end{itemize}
+
+
\section{Accessibility is not only tagging}
diff --git a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
index 0628a46660..49becf6a1f 100644
--- a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
+++ b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty
@@ -1,5 +1,5 @@
%\RequirePackage[enable-debug]{expl3}[2018/06/14]
-\ProvidesExplPackage {tagpdfdocu-patches} {2023-06-14} {0.98i}
+\ProvidesExplPackage {tagpdfdocu-patches} {2023-07-08} {0.98j}
{patches/commands for the tagpdf documentation}
\RequirePackage{etoolbox,xpatch}