summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wrapfig2
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/wrapfig2')
-rw-r--r--macros/latex/contrib/wrapfig2/README.txt64
-rw-r--r--macros/latex/contrib/wrapfig2/wrapfig2.dtx194
-rw-r--r--macros/latex/contrib/wrapfig2/wrapfig2.pdfbin706149 -> 705915 bytes
3 files changed, 90 insertions, 168 deletions
diff --git a/macros/latex/contrib/wrapfig2/README.txt b/macros/latex/contrib/wrapfig2/README.txt
index 45260e1909..b8169719a7 100644
--- a/macros/latex/contrib/wrapfig2/README.txt
+++ b/macros/latex/contrib/wrapfig2/README.txt
@@ -1,39 +1,47 @@
%%%% README.txt file
-This README.txt for package wrapfig2[2023-02-23 v.6.1.1 ...]
+This README.txt for package wrapfig2[2023-09-01 v.6.2.0 ...]
This work is author maintained
-This work consists of wrapfig2.dtx, the main file, this README.txt
-and the derived files wrapfig2.pdf and wrapfig2.sty.
+This work consists of wrapfig2.dtx, the main file,
+this README.txt and the derived files wrapfig2.pdf
+and wrapfig2.sty.
-The package besides the source documented source file contains the
-image file stele-todi-small.jpg, a slightly cropped image downloaded from
-the internet site of the Gregorian Etruscan Museum in Rome. Apparently
-this image is free provided the source is duly acknowledged.
+The package besides the source documented source
+file contains the image file stele-todi-small.jpg,
+a slightly cropped image downloaded from the
+internet site of the Gregorian Etruscan Museum in
+Rome. Apparently this image is free provided the
+source is duly acknowledged.
Licence appended to the wrapfig2.sty file.
-The software contained herein is a fork of Donald Arseneau wrapfig
-package. It uses most of his code, but adds a new environment,
-wraptext, to the existing wrapfigure and wraptable ones.
-
-Supposedly this software is backwards compatible with Arseneau's
-original environments. Future experience may confirm this statement.
-
-The user commands are defined by means of the LaTeX3 functionalities.
-Therefore this package does not work with LaTeX2e kernels older than
-about 2018, although a warning is issued if the LaTeX format file is
-older than 1st January 2019. In any case this package loading is
-aborted in order to avoid conflicts, and in some other circumstances;
-the error messages describe why the process was aborted.
-
-Version 6 of this package accepts options in the form key = value.
-Options are available to fall back to version 5 and version 4.
-
-IMPORTANT NOTICE: An incompatibility with the amsmath package was
-discovered, but it vanishes if amsmath is loaded after wrapfig2.
-The source of this incompatibility was not discovered, therefore
-wrapfig2 produces an error message when it is loaded after amsmath.
+The software contained herein is a fork of Donald
+Arseneau wrapfig package. It uses most of his code,
+but adds a new environment, wraptext, to the
+existing wrapfigure and wraptable ones.
+
+Supposedly this software is backwards compatible
+with Arseneau's original environments. Future
+experience may confirm this statement.
+
+The user commands are defined by means of the
+LaTeX3 functionalities. Therefore this package does
+not work with LaTeX2e kernels older than about
+2018, although a warning is issued if the LaTeX
+format file is older than 1st January 2019.
+In any case this package loading is aborted in
+order to avoid conflicts, and in some other
+circumstances; the error messages describe why the
+process was aborted.
+
+Version 6 of this package accepts options in the
+form key = value. Options are available to fall
+back to version 5 and version 4.
+
+IMPORTANT NOTICE: An incompatibility with the
+amsmath package but with version 6.2.0 this
+incompatibility was corrected.
Claudio Beccari
diff --git a/macros/latex/contrib/wrapfig2/wrapfig2.dtx b/macros/latex/contrib/wrapfig2/wrapfig2.dtx
index f54c71c6c2..c7a30fa316 100644
--- a/macros/latex/contrib/wrapfig2/wrapfig2.dtx
+++ b/macros/latex/contrib/wrapfig2/wrapfig2.dtx
@@ -45,14 +45,14 @@ wrapfig2.sty and wrapfig2.pdf, plus this file README.txt.
%<+package>\ProvidesPackage{wrapfig2}%
%^^A<+readme>File README.txt for package wrapfig2
%<*package|readme>
- [2023-02-23 v.6.1.1 Wrap text around figures, tables, framed text blocks]
+ [2023-09-01 v.6.2.0 Wrap text around figures, tables, framed text blocks]
%</package|readme>
%<*driver>
%
\documentclass{ltxdoc}\errorcontextlines=100
\hfuzz 10pt
\usepackage[greek.ancient, english]{babel}
-\usepackage[utf8]{inputenc}
+\usepackage[utf8]{inputenc}% for vintage exec.s
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{mflogo}
@@ -644,62 +644,21 @@ X\ifdim\fontdimen1\font=0pt\kern-0.15em\fi
%^^A
%\end{description}
%
-% This version~6 has a more flexible way compared to version~5
-% to specify the details relative to the framed text, but they are
-% relevant only for the \cs{includeframedtext} command; the syntax
-% for the \Env{wraptext} environment opening command is identical.
-% As it was previously shown, the syntax of environment \Env{wraptext}
-% for version~6 and~5 is practically identical to the one used for the
-% other two environments; actually, as it can be seen below in
-% the code description of version~6 and~5, it has a fairly
-% longer definition; it is required by the necessity of avoiding
-% the \cs{caption} changes foreseen in package{wrapfig} when
-% \pack{float} is used to define another floating object, but in
-% effects the new definition of the \Env{wraptext} environment uses
-% the same \cs{wrapfloat} and \cs{endwrapfloat} commands.
-%
-% In all three cases the \meta{width} parameter is a \emph{braced optional
-% argument}; for the \Env{wraptext} environment its preset value is
-% half the column width, that in one column typesetting mode
-% coincides with the text width. The wrapped text is typeset
-% in justified mode within a \cs{parbox} argument; the
-% measure of this text box should not be too small (unless
-% the text is less than one line long) otherwise the inter
-% word spacing might be too large; at the same time the measure
-% of the mini paragraph cannot be too large, otherwise the indented
-% wrapping lines, generally justified, might get a bad word
-% spacing. As it was already explained, it is reccommended to avoid
-% specifying the optional \meta{widh} outside the range of 40\% to 60\%
-% the column width. Actually specifying \texttt{0.2\cs{textwidth}}
-% or \texttt{0.4\cs{columnwidth}} when typesetting in two column
-% mode produces approximately the same result, because
-% \cs{columnwidth} is a little less than half the \cs{textwidth}.
-% In any case versions~6 and~5 of \Env{wrapfig2} reset any specified
-% width outside the above range to the nearest range bound.
+% This version~6 has a more flexible way compared to version~5 to specify the details relative to the framed text, but they are relevant only for the \cs{includeframedtext} command; the syntax for the \Env{wraptext} environment opening command is identical. As it was previously shown, the syntax of environment \Env{wraptext} for version~6 and~5 is practically identical to the one used for both other environments; actually, as it can be seen below in the code description of version~6 and~5, it has a fairly longer definition; it is required by the necessity of avoiding the \cs{caption} changes foreseen in package{wrapfig} when \pack{float} is used to define another floating object, but in effects the new definition of the \Env{wraptext} environment uses the same \cs{wrapfloat} and \cs{endwrapfloat} commands.
+%
+% In all three cases the \meta{width} parameter is a \emph{braced optional argument}; for the \Env{wraptext} environment its preset value is half the column width, that in one column typesetting mode coincides with the text width. The wrapped text is typeset in justified mode within a \cs{parbox} argument; the measure of this text box should not be too small (unless the text is less than one line long) otherwise the inter word spacing might be too large; at the same time the measure of the mini paragraph cannot be too large, otherwise the indented wrapping lines, generally justified, might get a bad word spacing. As it was already explained, it is recommended to avoid specifying the optional \meta{widh} outside the range of 40\% to 60\% the column width. Actually specifying \texttt{0.2\cs{textwidth}} or \texttt{0.4\cs{columnwidth}} when typesetting in two column mode produces approximately the same result, because \cs{columnwidth} is a little less than half the \cs{textwidth}. In any case versions~6 and~5 of \Env{wrapfig2} reset any specified width outside the above range to the nearest range bound.
%
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \section{Remarks}
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% The syntax of the original environments \amb{wrapfigure} and
-% \amb{wraptable} has not been changed, except for a last optional
-% star. The fact that the last \emph{braced argument is optional} does not
-% change the backward compatibility with the original environments.
-%
-% Therefore the optional \meta{line number} argument maintains its
-% meaning, unless the optional star is specified; in such a case that
-% number assumes the meaning of a correction to the computed number
-% of the indented lines.
-%
-% The mandatory \meta{location} maintains its meaning and the legal
-% values are \texttt{l} (left), \texttt{r} (right), \texttt{L}
-% (floating left), \texttt{R} (floating right), \texttt{i}
-% (inner margin), \texttt{o} (outer margin), \texttt{I}
-% (floating inner margin), \texttt{O} (floating outer margin).
+% The syntax of the original environments \amb{wrapfigure} and \amb{wraptable} has not been changed, except for a last optional star. The fact that the last \emph{braced argument is optional} does not change the backward compatibility with the original environments.
+%
+% Therefore the optional \meta{line number} argument maintains its meaning, unless the optional star is specified; in such a case that number assumes the meaning of a correction to the computed number of the indented lines.
+%
+% The mandatory \meta{location} maintains its meaning and the legal values are \texttt{l} (left), \texttt{r} (right), \texttt{L} (floating left), \texttt{R} (floating right), \texttt{i} (inner margin), \texttt{o} (outer margin), \texttt{I} (floating inner margin), \texttt{O} (floating outer margin).
%
-% We tested all of them, but as a (possibly questionable) personal
-% choice we prefer to place the wrapped object at the left of the text,
-% without floating it and irrespective of the folio parity.
+% We tested all of them, but as a (possibly questionable) personal choice we prefer to place the wrapped object at the left of the text, without floating it and irrespective of the folio parity.
%
%\begin{wraptext}{l}{0.5\textwidth}%
%\includegraphics[width=\hsize]{stele-todi-small}
@@ -884,15 +843,18 @@ X\ifdim\fontdimen1\font=0pt\kern-0.15em\fi
% scenes uses a very heavy set of multifunctional macros that offer
% functionalities that are not required for this problem.
%
-% Warm thanks also to Juan Luis Varona Malumbres for his precious
-% feedback and his suggestions.
+% Warm thanks also to Juan Luis Varona
+% Malumbresfor his precious feedback and his
+% suggestions.
%
-% Herbert Voß spotted the necessity to follow a specific loading
-% order if the \pack{amsmath} needs to be used; he was so kind to
-% send me a bug notice together with a minimum working example.
-% Thanks a lot Herbert! The best I could do to manage this bug
-% consisted in adding an error message, if \pack{wrapfig2} during its
-% loading process found \pack{amsmath} already loaded.
+% Herbert Voß spotted the necessity to follow a
+% specific loading order if the \pack{amsmath}
+% needs to be used; he was so kind to send me a
+% bug notice together with a minimum working
+% example.
+% Thanks to Bruno Pagani whos pinpointed the exact
+% point that conflicts with \pack{wrapfig2} so
+% that I could fix this conflict.
%
%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \CheckSum{1428}
@@ -938,13 +900,14 @@ X\ifdim\fontdimen1\font=0pt\kern-0.15em\fi
%
% \begin{macrocode}
\ifcsname c@WF@wrappedlines\endcsname
-\PackageError{wrapfig2}{ \MessageBreak
- ****************************************************\MessageBreak
+\PackageError{wrapfig2}{
+\MessageBreak
+**************************************************\MessageBreak
Package `wrapfig' has already been loaded perhaps \MessageBreak
by other packages, for example caption or subcaption.\MessageBreak
Such packages are incompatible with wrapfig2 \MessageBreak
Loading of`wrapfig2' is aborted \MessageBreak
- ****************************************************\MessageBreak
+**************************************************\MessageBreak
}{You might type X <return> and might get along without\MessageBreak
this package if you don't use the new environment \MessageBreak
`wraptext' and the new commands; otherwise you get \MessageBreak
@@ -954,31 +917,13 @@ X\ifdim\fontdimen1\font=0pt\kern-0.15em\fi
% \end{macrocode}
%
-% {\color{red}{\paragraph{Loading order} Some users needed to use
-% \pack{wrapfig2} in documents where they required also the
-% \pack{amsmath} package functionalities; they noticed that some
-% incompatibility showed up if package \pack{amsmath} was input
-% before \pack{wrapfig2}. Such incompatibility vanishes if
-% \pack{amsmath} is loaded \emph{after} \pack{wrapfig2}. This
-% package now issues an error message if it finds \pack{amsmath}
-% already loaded.}}
-% \begin{macrocode}
-\@ifpackageloaded{amsmath}{%
- \PackageError{wrapfig2}{ \MessageBreak
- +++++++++++++++++++++++++++++++++++++++++++\MessageBreak
- Package amsmath already loaded \MessageBreak
- If you need amsmath, load it after wrapfig2\MessageBreak
- Expect error messages \MessageBreak
- +++++++++++++++++++++++++++++++++++++++++++\MessageBreak
- \MessageBreak
- }{Abort the job}}{\relax}
-% \end{macrocode}
-%
-% We keep the original definition of the \cs{WF@warning} and the
-% original definition of the \opt{verbose} option; but we add the
-% new \opt{WFold} and \opt{WFfive} options in order to fall back
-% to the functionalities of the previous version~4 or~5, at least
-% for what concerns the \Env{wraptext} environment.
+% We keep the original definition of the
+% \cs{WF@warning} and the original definition of
+% the \opt{verbose} option; but we add the new
+% \opt{WFold} and \opt{WFfive} options in order to
+% fall back to the functionalities of the previous
+% version~4 or~5, at least for what concerns the
+% \Env{wraptext} environment.
%
%
% \begin{macrocode}
@@ -1040,6 +985,16 @@ X\ifdim\fontdimen1\font=0pt\kern-0.15em\fi
% redefines some \pack{color} internal commands; everything is
% explained in the \pack{xcolor} documentation.}
%
+% Here we have a little trick for avoiding
+% conflicts with \pack{amsmath} and its|\text|
+% command-
+% \begin{macrocode}
+\@ifpackageloaded{amsmath}{%
+\let\amsmathtext\text
+\AtEndPreamble{\let\text\amsmathtext}%
+}{\relax}
+% \end{macrocode}
+%
% In order to define the new floating object \texttt{text} we have
% to load the package \pack{float}, but only if versions~5 or~6
% are used; in other words only if the \cs{ifWFnew} switch
@@ -1210,13 +1165,11 @@ backgroundcolor, textcolor, fontstyle, radius, insertionwidth}
% Here is the code of some extra macros and of the \Env{wraptext}
% environment.
%
-% We start with two different \cs{includeframedtext}, one for
-% version~6, that accepts \texttt{key=velue} options, and
-% another one for version~5, that requires only a comma
-% separated list of dimensional values.
+% We start with two different \cs{includeframedtext}, one for version~6, that accepts \texttt{key=velue} options, and another one for version~5, that requires only a comma separated list of dimensional values.
% \begin{macrocode}
\ifbool{WFnew}{%
-\NewDocumentCommand\includeframedtext{O{\insertwidth} m O{} o}{\bgroup%
+\NewDocumentCommand\includeframedtext{%
+ O{\insertwidth} m O{} o}{\bgroup%
\ExecuteOptionsX<wraptext>{#3}% executes possible key=value options
\insertwidth=#1\WFscalewidth
\framedbox{#2}{\fboxrule}{\fboxsep}[\radius]\egroup}
@@ -1244,48 +1197,9 @@ backgroundcolor, textcolor, fontstyle, radius, insertionwidth}
%\cs{includeframedtext}\oarg{text width}\marg{text}\oarg{dimensions}\oarg{radius}
%\end{ttsintassi}
%
-% The optional \meta{text width} is the (possibly scaled) width computed
-% by the \Env{wraptext} environment; but if the authors use this command
-% outside the \Env{wraptext} environment, they should specify a width;
-% in any case the default value is half the current measure
-% \cs{linewidth}. The \meta{text} is the unformatted text to be wrapped;
-% it will be boxed and framed by the service macro \cs{framedbox}; the
-% \meta{dimensions} are passed on to \cs{framedbox} command; they are a
-% comma separated list of dimensions, namely the thickness of the frame
-% and the necessary frame distance from the formatted text. The
-% \meta{options} contains a comma separated list of zero to nine options
-% with the syntax \texttt{key=vale} that are going to be used by both
-% the \cs{includeframedtext} and \cs{framedbox}. The last optional
-% \meta{radius} is the curvature radius of the rounded frame corners;
-% the default value is going to be set to \cs{fboxsep}: in
-% version~5 \cs{framedbox} by default sets it equal to the frame
-% separation width, while with version~6 its value is received with
-% the option \texttt{radius=\meta{dimension}}; the default value is
-% certainly the best one, but the users can specify a different value,
-% of course not too different from the default one. See some examples
-% in figure~\ref{fig:framed text}.
-%
-% The definition of the \cs{framedbox} command appears to be
-% complicated; it is just an apparent complication due to the
-% fact that it uses the powerful \cs{Curve} command that draws an
-% arbitrary curved line or fills the area delimited by such
-% curved line; it suffices to specify the nodes and the tangents
-% to each node; the nodes are the points the line should pass
-% through, their tangents may be specified with arbitrary vector
-% components along the horizontal and vertical axes. For a
-% rectangle such vector components are just 0 or $\pm 1$. The
-% node coordinates of the rounded corners, on the opposite, must be
-% determined with accuracy; we used the \cs{fpeval} function of
-% package \pack{xfp}, that performs precise computations on operands
-% in fractional decimal numbers; if the operands are dimensions, the
-% operands are their fractional decimal values in printer points, the
-% results of such operations are pure fractional decimal numbers
-% without units; if the numerical result is to be interpreted again
-% as the measure of a dimensional entity, \texttt{pt} must be appended
-% to the assignments to a dimension register; within the \Env{picture}
-% environment, any coordinate is expressed in multiples of
-% \cs{unitlength}, therefore no unit of measure is necessary, once
-% \cs{unitlength} has been specified.
+% The optional \meta{text width} is the (possibly scaled) width computed by the \Env{wraptext} environment; but if the authors use this command outside the \Env{wraptext} environment, they should specify a width; in any case the default value is half the current measure \cs{linewidth}. The \meta{text} is the unformatted text to be wrapped; it will be boxed and framed by the service macro \cs{framedbox}; the \meta{dimensions} are passed on to \cs{framedbox} command; they are a comma separated list of dimensions, namely the thickness of the frame and the necessary frame distance from the formatted text. The \meta{options} contains a comma separated list of zero to nine options with the syntax \texttt{key=vale} that are going to be used by both the \cs{includeframedtext} and \cs{framedbox}. The last optional \meta{radius} is the curvature radius of the rounded frame corners; the default value is going to be set to \cs{fboxsep}: in version~5 \cs{framedbox} by default sets it equal to the frame separation width, while with version~6 its value is received with the option \texttt{radius=\meta{dimension}}; the default value is certainly the best one, but the users can specify a different value, of course not too different from the default one. See some examples in figure~\ref{fig:framed text}.
+%
+% The definition of the \cs{framedbox} command appears to be complicated; it is just an apparent complication due to the fact that it uses the powerful \cs{Curve} command that draws an arbitrary curved line or fills the area delimited by such curved line; it suffices to specify the nodes and the tangents to each node; the nodes are the points the line should pass through, their tangents may be specified with arbitrary vector components along the horizontal and vertical axes. For a rectangle such vector components are just 0 or $\pm 1$. The node coordinates of the rounded corners, on the opposite, must be determined with accuracy; we used the \cs{fpeval} function of package \pack{xfp}, that performs precise computations on operands in fractional decimal numbers; if the operands are dimensions, the operands are their fractional decimal values in printer points, the results of such operations are pure fractional decimal numbers without units; if the numerical result is to be interpreted again as the measure of a dimensional entity, \texttt{pt} must be appended to the assignments to a dimension register; within the \Env{picture} environment, any coordinate is expressed in multiples of \cs{unitlength}, therefore no unit of measure is necessary, once \cs{unitlength} has been specified.
%
% For a rectangle with curved corners of a given radius \cs{R}
% we have four quarter circles joined by straight lines; therefore
@@ -1307,10 +1221,10 @@ backgroundcolor, textcolor, fontstyle, radius, insertionwidth}
\NewDocumentCommand\framedbox{ m m m O{#3}}{\bgroup
\fboxrule=#2\fboxsep=#3\relax
\setbox0\hbox{\fboxrule=\z@\fboxsep=#3\relax
-\framebox{\parbox{% draw a framed box without the frame
+\framebox{\parbox{% draw a framed box without the frame
\fpeval{\insertwidth-2\fboxrule-2\fboxsep}\p@}{\textcolor{WFtext}{#1}}}}
-\unitlength=\fpeval{\wd0/100}\p@ % set the picture \unitlength
+\unitlength=\fpeval{\wd0/100}\p@ % set the picture \unitlength
% determine the picture coordinates and displacement of the axes origin
\edef\x{100}%
\edef\y{\fpeval{(\ht0 +\dp0)/\unitlength}}%
@@ -1464,15 +1378,15 @@ backgroundcolor, textcolor, fontstyle, radius, insertionwidth}
\def\textplacement{#2}%
\def\textcorrection{#1}%
\def\textoverhang{#3}%
- \IfBooleanTF{#5}{\PackageWarning{wrapfig2}{%
+ \IfBooleanT{#5}{\PackageWarning{wrapfig2}{%
*********************************************\MessageBreak
With wraptext the optional star is useless \MessageBreak
because the first optional argument always \MessageBreak
means the "lines number CORRECTION" \MessageBreak
- *********************************************\MessageBreak}}{}%%%<------------------
+ *********************************************\MessageBreak}}
\bgroup\edef\x{\egroup\noexpand\wrapfloat{text}%
[\textcorrection]{\textplacement}[\textoverhang]{\insertwidth}*}\x%
- \def\caption{\unskip
+ \def\caption{\unskip\unskip
\refstepcounter\@captype
\let\@tempf\@caption
\unless\ifcsname @float@c@\@captype\endcsname
diff --git a/macros/latex/contrib/wrapfig2/wrapfig2.pdf b/macros/latex/contrib/wrapfig2/wrapfig2.pdf
index 22c81080cf..823efb6847 100644
--- a/macros/latex/contrib/wrapfig2/wrapfig2.pdf
+++ b/macros/latex/contrib/wrapfig2/wrapfig2.pdf
Binary files differ