texlive[59389] Master/texmf-dist: keyfloat (29may21)

commits+karl at tug.org commits+karl at tug.org
Sat May 29 22:24:04 CEST 2021


Revision: 59389
          http://tug.org/svn/texlive?view=revision&revision=59389
Author:   karl
Date:     2021-05-29 22:24:04 +0200 (Sat, 29 May 2021)
Log Message:
-----------
keyfloat (29may21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/keyfloat/README.txt
    trunk/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf
    trunk/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx
    trunk/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty

Modified: trunk/Master/texmf-dist/doc/latex/keyfloat/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/keyfloat/README.txt	2021-05-29 20:23:46 UTC (rev 59388)
+++ trunk/Master/texmf-dist/doc/latex/keyfloat/README.txt	2021-05-29 20:24:04 UTC (rev 59389)
@@ -1,8 +1,8 @@
 The LaTeX keyfloat package
 Provides a key/value interface for generating floats.
 
-v2.01
-Copyright 2016-2019 Brian Dunn — www.BDTechConcepts.com
+v2.03
+Copyright 2016-2021 Brian Dunn — www.BDTechConcepts.com
 
 LaTeX Project Public License, version 1.3
 

Modified: trunk/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx	2021-05-29 20:23:46 UTC (rev 59388)
+++ trunk/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx	2021-05-29 20:24:04 UTC (rev 59389)
@@ -17,7 +17,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{keyfloat}
-%<package>    [2019/09/23 v2.01 Key/value interface for floats and subfloats.]
+%<package>    [2021/05/28 v2.03 Key/value interface for floats and subfloats.]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -317,7 +317,7 @@
 %<*package>
 % \fi
 %
-% \CheckSum{1251}
+% \CheckSum{1298}
 %
 % \CharacterTable
 % {Upper-case     \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -352,11 +352,12 @@
 % \changes{v2.00}{2019/03/17}{Added custom float types.}
 % \changes{v2.00}{2019/03/17}{Added float authors.}
 % \changes{v2.01}{2019/09/23}{2019/09/23}
+% \changes{v2.02}{2021/05/28}{2021/05/27}
+% \changes{v2.03}{2021/05/28}{Fixed \cs{hbadness} w/ \cs{relax}.}
+% \changes{v2.03}{2021/05/28}{2021/05/28}
 
 
 
-
-
 % \GetFileInfo{\mypackagename.sty}
 %
 % \DoNotIndex{\newcommand,\renewcommand,\addtocounter,\begin,\end,\begingroup,\endgroup}
@@ -377,7 +378,7 @@
 %
 % \bigskip
 %
-% {\small\textcopyright{} 2016--2019} Brian Dunn\\ \small \texttt{bd at BDTechConcepts.com}
+% {\small\textcopyright{} 2016--2021} Brian Dunn\\ \small \texttt{bd at BDTechConcepts.com}
 %
 % \vspace{.5in}
 %
@@ -431,10 +432,10 @@
 % \vfill
 %
 % \noindent \pkg{keyfloat} uses the \pkg{caption}, \pkg{subcaption},
-% \pkg{newfloat}, and \pkg{wrapfig} packages,
+% \pkg{newfloat} or \pkg{float}, and \pkg{wrapfig} packages,
 % \watchout
 % and cannot be used with the
-% \pkg{subfig}, \pkg{subfigure}, \pkg{subfloat}, \pkg{floatrow}, \pkg{float},
+% \pkg{subfig}, \pkg{subfigure}, \pkg{subfloat}, \pkg{floatrow},
 % or \pkg{floatflt} packages.
 %
 % \vfill
@@ -610,7 +611,7 @@
 % \end{sourcedisplay}
 %
 %
-% If you wish to have artist's names appear in the list of figures,
+% If you wish to have artists' names appear in the list of figures,
 % \DescribePackage{tocdata}
 % \DescribePackage{tocloft}
 % \DescribePackage{titletoc}
@@ -624,7 +625,14 @@
 % 	\cs{usepackage}\{keyfloat\}
 % \end{sourcedisplay}
 %
-% To use custom float types, use the \pkg{newfloat} package:
+% To use custom float types with the \pkg{float} package:
+% \DescribePackage{float}
+% \begin{sourceverb}
+% \usepackage{float}
+% \newfloat{diagram}{htb}{lod}
+% \end{sourceverb}
+%
+% To use custom float types with the \pkg{newfloat} package:
 % \DescribePackage{newfloat}
 % \begin{sourceverb}
 % \usepackage{newfloat}
@@ -764,6 +772,11 @@
 % a paragraph with contents large enough to wrap around the float.  Do not use this
 % inside a list environment.  Select placement with the |wp| key; see
 % the \pkg{wrapfig} package documentation for more information.
+% Use \optn{w} or \optn{lw} to set the width of the item \Slash image contained
+% inside the wrap area.  By default the caption will also be contained in this width.
+% To use a larger width for the overall container and caption,
+% set \optn{w} or \optn{lw} for the size of the image, and also use
+% \optn{ww} or \optn{wlw} for a larger size for the caption.
 % Watch the log for warnings from \pkg{wrapfig}.\watchout[\pkg{wrapfig} warnings]
 %
 % \DescribeArgument{{[loc]}}
@@ -841,9 +854,15 @@
 % \textrm{Key}\tnote{a} & Description & \textrm{Example} \\
 % \midrule
 % lw &  Set the width to a fraction of \cs{linewidth}.  Cancels |w|.
-% 	If a non-image float, sets the width of the text box. & lw=.5 \\  
+% 	If a non-image float, sets the width of the text box.
+%   For wrapped objects, may be used with \optn{wlw} for a smaller item
+%       with a larger caption.
+%           & lw=.5 \\  
 % w &  Set the actual width.  Cancels |lw|.
-% 	If a non-image float, sets the width of the text box. & w=2in \\
+% 	If a non-image float, sets the width of the text box.
+%   For wrapped objects, may be used with \optn{ww} for a smaller item
+%       with a larger caption.
+%           & w=2in \\
 % h &  Set the actual height, images only.  & w=2in \\
 % s &  Set the image scale, images only.  & s=3 \\
 % a &  Set the rotation angle; counter-clockwise degrees. & r=90 \\
@@ -857,6 +876,10 @@
 %	is |O|, which places the wrapped float at the outside edge of the text.
 %	See \cref{tab:wrapplacement}.
 %	& wp=I \\
+% wlw & Sets the total width of the wrapped item to a fraction of \cs{linewidth}.
+%       May be more than the \optn{w} or \optn{lw} width. & wlw=.6 \\
+% ww & Sets the total width of the wrapped item.
+%       May be more than the \optn{w} or \optn{lw} width. & ww=2in \\
 % va & Sets the vertical alignment of the outermost minipage container for the keyfloat.
 %	Defaults to 'c'.
 %	& va=t \\
@@ -1060,8 +1083,8 @@
 % 	t={Additional text.  Multiple paragraphs may be used.
 % 	The entire text is enclosed in braces because a comma
 % 	is included. Alignment may be set by using
-% 	tags \texttt{tc}, \texttt{tl}, or \texttt{tr}
-% 	instead of \texttt{t}},
+% 	tags \optn{tc}, \optn{tl}, or \optn{tr}
+% 	instead of \optn{t}},
 % 	l=fig:options
 % }{image}
 % \end{dtxexample}
@@ -1414,8 +1437,8 @@
 % \end{dtxexample}
 %
 %
-% \begin{dtxexample}[\Cref{fig:keyfigm}]{Using \cs{keyfig}\texttt{[M]}\label{ex:keyfigm}}
-% \keyfig[M]{c={A \cs{keyfig}\texttt{[M]}},l=fig:keyfigm,ft,
+% \begin{dtxexample}[\Cref{fig:keyfigm}]{Using \cs{keyfig}\optn{[M]}\label{ex:keyfigm}}
+% \keyfig[M]{c={A \cs{keyfig}\optn{[M]}},l=fig:keyfigm,ft,
 % 	t=Additional text.
 % 	Text text text text text text.
 % 
@@ -1425,8 +1448,8 @@
 %
 %
 % \begin{dtxexample}[\Cref{tab:keytablem}]
-%	{Using \env{keytable}\texttt{[M]} and an offset\label{ex:keytablem}}
-% \begin{keytable}[M]{c={A \env{keytable}\texttt{[M]}},
+%	{Using \env{keytable}\optn{[M]} and an offset\label{ex:keytablem}}
+% \begin{keytable}[M]{c={A \env{keytable}\optn{[M]}},
 % 	l=tab:keytablem,mo=-.9in}
 % \centering
 % \testwidetable
@@ -1451,24 +1474,26 @@
 % \changes{v0.12}{2016/12/03}{Docs: Wrapped float examples.}
 %
 % \begin{dtxexample}[\Cref{fig:keyfigw,tab:keytabw}]
-%	{Using \cs{keyfig}\texttt{[W]} and \cs{keytab}\texttt{[W]}\label{ex:keyfigw}}
-% \keyfig[W]{c={A \cs{keyfig}\texttt{[W]}},
+%	{Using \cs{keyfig}\optn{[W]} and \cs{keytab}\optn{[W]}\label{ex:keyfigw}}
+% \keyfig[W]{c={A \cs{keyfig}\optn{[W]}},
 % 	l=fig:keyfigw,ft,lw=.4,wp=I,
-% 	t={.4\cs{linewidth} wide, placed \texttt{I}.}
+% 	t={.4\cs{linewidth} wide, placed \optn{I}.}
 % }{image2}
 % \blindtext
-% \keytab[W]{c={A \cs{keytab}\texttt{[W]}},l=tab:keytabw,w=.75in,
+
+% \keytab[W]{c={A \cs{keytab}\optn{[W]}},l=tab:keytabw,w=.75in,
 % }{\testtable}
 % \blindtext
 % \end{dtxexample}
 %
 % \begin{dtxexample}[\Cref{fig:keyfigboxw} and the \cs{keyparbox}.]
-%	{Using \cs{keyfigbox}\texttt{[W]} and \cs{keyparbox}\texttt{[W]}\label{ex:keyfigboxw}}
-% \keyfigbox[W]{c={A \cs{keyfigbox}\texttt{[W]}},
+%	{Using \cs{keyfigbox}\optn{[W]} and \cs{keyparbox}\optn{[W]}\label{ex:keyfigboxw}}
+% \keyfigbox[W]{c={A \cs{keyfigbox}\optn{[W]}},
 % 	l=fig:keyfigboxw,f,lw=.25,wp=I,
 % 	t=Text text text text text text text text text
 % }{The contents.}
 % \blindtext
+
 % \keyparbox[W]{w=1in}{A \cs{keyparbox}[W] and some more text.}
 % \blindtext
 % \end{dtxexample}
@@ -1475,15 +1500,16 @@
 %
 %
 % \begin{dtxexample}[\Cref{fig:keyfigurew,tab:keytablew}]
-%	{Using \cs{keyfigure}\texttt{[W]} and \cs{keytable}[W]\label{ex:keyfiguretablew}}
-% \begin{keyfigure}[W]{c={A \cs{keyfigure}\texttt{[W]}},
+%	{Using \cs{keyfigure}\optn{[W]} and \cs{keytable}\optn{[W]}\label{ex:keyfiguretablew}}
+% \begin{keyfigure}[W]{c={A \cs{keyfigure}\optn{[W]}},
 % 	l=fig:keyfigurew,f,w=1.5in}
 % This is a keyfigure.
 % \end{keyfigure}
 % \blindtext
 %
-% \begin{keytable}[W]{c={A \env{keytable}\texttt{[W]}},
-% 	l=tab:keytablew,w=2in,wp=L,tc=Placed \texttt{L} and 2in wide.}
+% \begin{keytable}[W]{c={A \env{keytable}\optn{[W]}},
+% 	l=tab:keytablew,w=2in,wp=L,
+%   tc=Placed \optn{L} and 2in wide.}
 % \centering
 % \testwidetable
 % \end{keytable}
@@ -1520,8 +1546,24 @@
 % \end{itemize}
 % \end{dtxexample}
 %
+% \clearpage
 %
+% \begin{dtxexample}[\Cref{fig:keyfigwlw,fig:keyfigww}]
+%   {Using wrap width \optn{ww} and \optn{wlw}\label{ex:keyfigwlw}}
+% \keyfig[W]{c={A \cs{keyfig}\optn{[W] with \optn{wlw}}},
+%   l=fig:keyfigwlw,ft,lw=.15,wlw=.4,wp=I,
+%   t={.15\cs{linewidth} wide, in a .4\cs{linewidth} box.}
+% }{image2}
+% \blindtext[1]
 %
+% \keyfig[W]{c={A \cs{keyfig}\optn{[W] with \optn{ww}}},
+%   l=fig:keyfigww,ft,w=1cm,ww=3cm,wp=I,
+%   t={1cm wide, in a 3cm box.}
+% }{image2}
+% \blindtext[1]
+% \end{dtxexample}
+%
+%
 % \clearpage
 % \subsubsection{Custom frames}
 %
@@ -1836,12 +1878,12 @@
 %
 %
 % The list of prohibited packages:
+% \changes{v2.02}{2021/05/18}{Work with \pkg{float}.}
 %    \begin{macrocode}
 \KFLT at prohibitpackage{floatrow}{caption and subcaption}
 \KFLT at prohibitpackage{subfig}{subcaption}
 \KFLT at prohibitpackage{subfigure}{subcaption}
 \KFLT at prohibitpackage{subfloat}{subcaption}
-\KFLT at prohibitpackage{float}{newfloat}
 \KFLT at prohibitpackage{floatflt}{wrapfig}
 %    \end{macrocode}
 %
@@ -2318,7 +2360,7 @@
 
 
 % \DescribeKey[main]{mo} Set vertical offset for a margin float.
-% \changes{v0.12}{2016/12/03}{Added \texttt{mo} key.}
+% \changes{v0.12}{2016/12/03}{Added \optn{mo} key.}
 %    \begin{macrocode}
 \define at key{KFLT at keys}{mo}{\setlength{\KFLT at mo}{#1}}
 %    \end{macrocode}
@@ -2334,7 +2376,7 @@
 %
 % See \cref{tab:wrapplacement} on \cpageref{tab:wrapplacement}.
 % 
-% \changes{v0.12}{2016/12/03}{Added \texttt{wp} key.}
+% \changes{v0.12}{2016/12/03}{Added \optn{wp} key.}
 %    \begin{macrocode}
 \define at key{KFLT at keys}{wp}{\renewcommand{\KFLT at wp}{#1}}
 %    \end{macrocode}
@@ -2345,10 +2387,40 @@
 %    \end{macrocode}
 % \end{macro}
 
+% \DescribeKey[main]{wlw} Wrapped figure, fraction of \cs{linewidth}
+% \changes{v2.02}{2021/05/27}{Added \optn{ww} and \optn{wlw}.}
+%    \begin{macrocode}
+\define at key{KFLT at keys}{wlw}{%
+    \renewcommand{\KFLT at wlw}{#1}%
+    \setlength{\KFLT at ww}{0pt}%
+}
+%    \end{macrocode}
+%
+% \begin{macro}{\KFLT at wlw} Wrapped figure, fraction of linewidth storage: ``|.5|''
+%    \begin{macrocode}
+\newcommand*{\KFLT at wlw}{}
+%    \end{macrocode}
+% \end{macro}
+%
+% \DescribeKey[main]{ww} Wrapped figure, fixed width
+% \changes{v2.02}{2021/05/27}{Added \optn{ww} and \optn{wlw}.}
+%    \begin{macrocode}
+\define at key{KFLT at keys}{ww}{%
+    \setlength{\KFLT at ww}{#1}%
+    \renewcommand{\KFLT at wlw}{}%
+}
+%    \end{macrocode}
+%
+% \begin{macro}{\KFLT at ww} Wrapped figure, width storage: ``3cm''
+%    \begin{macrocode}
+\newlength{\KFLT at ww}
+%    \end{macrocode}
+% \end{macro}
 
+
 % \DescribeKey[main]{va} Set vertical alignment of the outermost minipage container.
 %
-% \changes{v0.15}{2017/05/09}{Added vertical alignment key \texttt{va}.}
+% \changes{v0.15}{2017/05/09}{Added vertical alignment key \optn{va}.}
 %    \begin{macrocode}
 \define at key{KFLT at keys}{va}{\renewcommand{\KFLT at va}{#1}}
 %    \end{macrocode}
@@ -2610,11 +2682,18 @@
 \newlength{\KFLT at boxwidth}
 %    \end{macrocode}
 %
+% \DescribeLength{\KFLT at wrapwidth} Computed width of the wrapped figure
+% \changes{v2.02}{2021/05/27}{Added \optn{ww} and \optn{wlw}.}
+%    \begin{macrocode}
+\newlength{\KFLT at wrapwidth}
+%    \end{macrocode}
+
 %
 % \begin{macro}{\KFLT at findwidths} Figure out how wide to make an image and its container
 %    \begin{macrocode}
 \newcommand*{\KFLT at findwidths}{%
 %    \end{macrocode}
+%
 % Default to a box of full \cs{linewidth} minus the potential frame:
 %    \begin{macrocode}
     \ifbool{KFLT at ft}% tight frame?
@@ -2625,21 +2704,48 @@
                 {\setlength{\KFLT at boxwidth}{\linewidth}}% no frame
         }% not tight frame
 %    \end{macrocode}
+%
 % Several width options exist.  First see if width was given:
 %    \begin{macrocode}
     \ifdimgreater{\KFLT at w}{0pt}%
 %    \end{macrocode}
+%
 %  Width was given:
 %    \begin{macrocode}
         {\setlength{\KFLT at imagewidth}{\KFLT at w}}%
         {% width not given
 %    \end{macrocode}
+%
 % Use full \cs{linewidth} or only a fraction:
 %    \begin{macrocode}
-            \ifcsempty{\KFLT at lw}%
+            \ifcsempty{KFLT at lw}%
                 {\setlength{\KFLT at imagewidth}{\KFLT at boxwidth}}%
                 {\setlength{\KFLT at imagewidth}{\KFLT at lw\KFLT at boxwidth}}%
         }% width not given
+%    \end{macrocode}
+%
+% The wrap width is the same as the image width, unless specified:
+% \changes{v2.02}{2021/05/27}{Added \optn{ww} and \optn{wlw}.}
+%    \begin{macrocode}
+    \ifdimgreater{\KFLT at ww}{0pt}%
+%    \end{macrocode}
+%
+%  Width was given:
+%    \begin{macrocode}
+        {%
+            \setlength{\KFLT at wrapwidth}{\KFLT at ww}}%
+        {% width not given
+%    \end{macrocode}
+%
+% If \optn{wlw}, use a fraction of line width,
+% else if none given use the same as the image width.
+%    \begin{macrocode}
+            \ifcsempty{KFLT at wlw}%
+                {%
+                    \setlength{\KFLT at wrapwidth}{\KFLT at imagewidth}}%
+                {%
+                    \setlength{\KFLT at wrapwidth}{\KFLT at wlw\KFLT at boxwidth}}%
+        }% width not given
 }
 %    \end{macrocode}
 % \end{macro}
@@ -3085,6 +3191,8 @@
     \renewcommand{\KFLT at stretch}{1}%
     \setlength{\KFLT at mo}{-1.2ex}%
     \renewcommand{\KFLT at wp}{O}%
+    \renewcommand{\KFLT at wlw}{}%
+    \setlength{\KFLT at ww}{0pt}%
     \renewcommand{\KFLT at va}{c}%
 }
 %    \end{macrocode}
@@ -3185,6 +3293,12 @@
         \addvspace{\smallskipamount}%
         \begin{minipage}{\linewidth}%
 %    \end{macrocode}
+%
+% Inside this minipage, temporarily prevent underfull \cs{hbox} warnings:
+% \changes{v2.02}{2021/05/28}{Avoid underfull \cs{hbox} warning.}
+%    \begin{macrocode}
+        \hbadness=10000\relax%
+%    \end{macrocode}
 % Set the alignment and some text parameters:
 %    \begin{macrocode}
         \csuse{KFLT@#1textalign}%
@@ -3276,10 +3390,18 @@
         \addvspace{\medskipamount}%
     \begin{minipage}{\linewidth}%
 %    \end{macrocode}
+%
+% Inside this minipage, temporarily prevent underfull \cs{hbox} warnings:
+% \changes{v2.02}{2021/05/28}{Avoid underfull \cs{hbox} warning.}
+%    \begin{macrocode}
+    \hbadness=10000\relax%
+%    \end{macrocode}
+%
 % Text alignment is |#3|, and depends on artist or author:
 %    \begin{macrocode}
     #3%
 %    \end{macrocode}
+%
 % |#1| is empty or '|subgrp'| \\
 % |#2| is empty for artist, `|u|' for author:
 %    \begin{macrocode}
@@ -3416,7 +3538,7 @@
 % Not used by subfigures.
 %
 % \changes{v0.12}{2016/12/03}{[M] and [W] floats.}
-% \changes{v0.15}{2017/05/09}{Handle vertical alignment key \protect\texttt{va}.}
+% \changes{v0.15}{2017/05/09}{Handle vertical alignment key \optn{va}.}
 % \changes{v0.15}{2017/05/12}{Adjustments for \protect\env{keywrap}.}
 %    \begin{macrocode}
 \NewDocumentEnvironment{KFLT at boxouter}{m m}
@@ -3473,20 +3595,34 @@
 %    \begin{macrocode}
                 {% [W]
 %    \end{macrocode}
+%
 % Temporarily figure out \cs{KFLT at imagewidth},
 % and make the wrapped figure environment as wide as the
 % desired image size plus frame:
+% \changes{v2.02}{2021/05/27}{Added \optn{ww} and \optn{wlw}.}
 %    \begin{macrocode}
                     \KFLT at findwidths%
                     \wrapfloat{\KFLT at type}{\KFLT at wp}%
-                        {\KFLT at imagewidth+2\KFLTlooseframewidth}%
-                    \minipage{\KFLT at imagewidth+2\KFLTlooseframewidth}%
+                        {\KFLT at wrapwidth+2\KFLTlooseframewidth}%
+                    \minipage{\KFLT at wrapwidth+2\KFLTlooseframewidth}%
+%    \end{macrocode}
+%
+% Inside this minipage, temporarily prevent underfull \cs{hbox} warnings:
+% \changes{v2.02}{2021/05/28}{Avoid underfull \cs{hbox} warning.}
+%    \begin{macrocode}
+                    \hbadness=10000\relax%
+%    \end{macrocode}
+%    \begin{macrocode}
                     \normalcolor\reset at font\normalsize%
 %    \end{macrocode}
+%
 % Change the interior image to the discovered fixed width.
+% \changes{v2.02}{2021/05/27}{Added \optn{ww} and \optn{wlw}.}
 %    \begin{macrocode}
                     \renewcommand{\KFLT at lw}{}%
                     \renewcommand{\KFLT at w}{\KFLT at imagewidth}%
+                    \renewcommand{\KFLT at wlw}{}%
+                    \renewcommand{\KFLT at ww}{0pt}%
                 }% [W]
                 {% not [W]
 %    \end{macrocode}
@@ -3694,7 +3830,14 @@
 %    \begin{macrocode}
 \NewDocumentCommand{\KFLT at keyflt}{m m m +m +m}
 {%
-    \ifcsdef{l@#3}{}{%
+%    \end{macrocode}
+%
+% \changes{v2.02}{2021/05/18}{Work with \pkg{float}.}
+%    \begin{macrocode}
+    \ifcsdef{ftype@#3}{}{%
+%    \end{macrocode}
+%
+%    \begin{macrocode}
         \PackageError{keyfloat}%
         {%
             \protect\keyflt: Invalid float type.\MessageBreak%
@@ -4102,6 +4245,14 @@
 %    \begin{macrocode}
             \wrapfloat{figure}{O}{.5\linewidth}%
             \minipage{\linewidth}%
+%    \end{macrocode}
+%
+% Inside this minipage, temporarily prevent underfull \cs{hbox} warnings:
+% \changes{v2.02}{2021/05/28}{Avoid underfull \cs{hbox} warning.}
+%    \begin{macrocode}
+            \hbadness=10000\relax%
+%    \end{macrocode}
+%    \begin{macrocode}
             \normalcolor\reset at font\normalsize%
         }%
         {% not [H]:
@@ -4322,6 +4473,14 @@
             \wrapfloat{\KFLT at subgrptype}{O}{.5\linewidth}%
             \setlength{\KFLT at rowboxwidth}{.5\KFLT at rowboxwidth}%
             \minipage{\linewidth}%
+%    \end{macrocode}
+%
+% Inside this minipage, temporarily prevent underfull \cs{hbox} warnings:
+% \changes{v2.02}{2021/05/28}{Avoid underfull \cs{hbox} warning.}
+%    \begin{macrocode}
+            \hbadness=10000\relax%
+%    \end{macrocode}
+%    \begin{macrocode}
             \normalcolor\reset at font\normalsize%
         }%
         {% not [H]:
@@ -4618,6 +4777,10 @@
 %
 %
 % \begin{environment}{keywrap} \marg{width} \marg{keyfloat}
+%
+% The main text is placed in a minipage to the left,
+% and the wrapped content is later placed in another minipage to the right.
+%
 % \changes{v0.15}{2017/05/11}{Added.}
 % \changes{v2.01}{2019/09/11}{Fix: Font and color.}
 % \changes{v2.01}{2019/09/16}{Fix: \cs{noindent}.}
@@ -4629,7 +4792,7 @@
     \addtolength{\KFLT at keywrapwidth}{-#1}%
     \addtolength{\KFLT at keywrapwidth}{-2em}%
     \minipage[t]{\KFLT at keywrapwidth}%
-    %
+%
     \setlength{\parskip}{\KFLT at keywrapparskip}%
     \setlength{\parindent}{\KFLT at keywrapparindent}%
     \booltrue{KFLT at keywrap}%
@@ -4641,6 +4804,14 @@
     \begin{minipage}[t]{#1}%
     \booltrue{KFLT at keywrap}%
     \normalcolor\reset at font\normalsize%
+%    \end{macrocode}
+%
+% Inside this minipage, temporarily prevent underfull \cs{hbox} warnings:
+% \changes{v2.02}{2021/05/28}{Avoid underfull \cs{hbox} warning.}
+%    \begin{macrocode}
+    \hbadness=10000\relax%
+%    \end{macrocode}
+%    \begin{macrocode}
     #2%
     \par%
     \unskip\vspace{\smallskipamount}%

Modified: trunk/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty	2021-05-29 20:23:46 UTC (rev 59388)
+++ trunk/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty	2021-05-29 20:24:04 UTC (rev 59389)
@@ -18,11 +18,13 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{keyfloat}
-    [2019/09/23 v2.01 Key/value interface for floats and subfloats.]
+    [2021/05/28 v2.03 Key/value interface for floats and subfloats.]
 
 
 
 
+
+
 \@ifpackageloaded{tocdata}{
     \@ifpackagelater{tocdata}{2019/03/21}{}{
         \PackageError{keyfloat}
@@ -59,7 +61,6 @@
 \KFLT at prohibitpackage{subfig}{subcaption}
 \KFLT at prohibitpackage{subfigure}{subcaption}
 \KFLT at prohibitpackage{subfloat}{subcaption}
-\KFLT at prohibitpackage{float}{newfloat}
 \KFLT at prohibitpackage{floatflt}{wrapfig}
 \RequirePackage{etoolbox}[2011/01/03]%
 \RequirePackage{xparse}
@@ -204,6 +205,17 @@
 \define at key{KFLT at keys}{wp}{\renewcommand{\KFLT at wp}{#1}}
 \newcommand{\KFLT at wp}{O}
 
+\define at key{KFLT at keys}{wlw}{%
+    \renewcommand{\KFLT at wlw}{#1}%
+    \setlength{\KFLT at ww}{0pt}%
+}
+\newcommand*{\KFLT at wlw}{}
+\define at key{KFLT at keys}{ww}{%
+    \setlength{\KFLT at ww}{#1}%
+    \renewcommand{\KFLT at wlw}{}%
+}
+\newlength{\KFLT at ww}
+
 \define at key{KFLT at keys}{va}{\renewcommand{\KFLT at va}{#1}}
 \newcommand{\KFLT at va}{c}
 
@@ -282,6 +294,8 @@
 \newlength{\KFLT at imagewidth}
 
 \newlength{\KFLT at boxwidth}
+\newlength{\KFLT at wrapwidth}
+
 \newcommand*{\KFLT at findwidths}{%
     \ifbool{KFLT at ft}% tight frame?
         {\setlength{\KFLT at boxwidth}{\linewidth - 2\KFLTtightframewidth}}%
@@ -293,10 +307,20 @@
     \ifdimgreater{\KFLT at w}{0pt}%
         {\setlength{\KFLT at imagewidth}{\KFLT at w}}%
         {% width not given
-            \ifcsempty{\KFLT at lw}%
+            \ifcsempty{KFLT at lw}%
                 {\setlength{\KFLT at imagewidth}{\KFLT at boxwidth}}%
                 {\setlength{\KFLT at imagewidth}{\KFLT at lw\KFLT at boxwidth}}%
         }% width not given
+    \ifdimgreater{\KFLT at ww}{0pt}%
+        {%
+            \setlength{\KFLT at wrapwidth}{\KFLT at ww}}%
+        {% width not given
+            \ifcsempty{KFLT at wlw}%
+                {%
+                    \setlength{\KFLT at wrapwidth}{\KFLT at imagewidth}}%
+                {%
+                    \setlength{\KFLT at wrapwidth}{\KFLT at wlw\KFLT at boxwidth}}%
+        }% width not given
 }
 \newcommand{\KFLTtightframe}[1]{%
     \setlength{\fboxsep}{0pt}%
@@ -519,6 +543,8 @@
     \renewcommand{\KFLT at stretch}{1}%
     \setlength{\KFLT at mo}{-1.2ex}%
     \renewcommand{\KFLT at wp}{O}%
+    \renewcommand{\KFLT at wlw}{}%
+    \setlength{\KFLT at ww}{0pt}%
     \renewcommand{\KFLT at va}{c}%
 }
 
@@ -562,6 +588,7 @@
         {% local
         \addvspace{\smallskipamount}%
         \begin{minipage}{\linewidth}%
+        \hbadness=10000\relax%
         \csuse{KFLT@#1textalign}%
         \footnotesize%
         \setlength{\parskip}{1.5ex}%
@@ -596,6 +623,7 @@
 \newcommand*{\KFLT@@addartisttext}[3]{%
         \addvspace{\medskipamount}%
     \begin{minipage}{\linewidth}%
+    \hbadness=10000\relax%
     #3%
     \footnotesize\textsc{%
         \KFLT at optionalname{\csuse{KFLT@#1a#2p}}%
@@ -681,11 +709,14 @@
                 {% [W]
                     \KFLT at findwidths%
                     \wrapfloat{\KFLT at type}{\KFLT at wp}%
-                        {\KFLT at imagewidth+2\KFLTlooseframewidth}%
-                    \minipage{\KFLT at imagewidth+2\KFLTlooseframewidth}%
+                        {\KFLT at wrapwidth+2\KFLTlooseframewidth}%
+                    \minipage{\KFLT at wrapwidth+2\KFLTlooseframewidth}%
+                    \hbadness=10000\relax%
                     \normalcolor\reset at font\normalsize%
                     \renewcommand{\KFLT at lw}{}%
                     \renewcommand{\KFLT at w}{\KFLT at imagewidth}%
+                    \renewcommand{\KFLT at wlw}{}%
+                    \renewcommand{\KFLT at ww}{0pt}%
                 }% [W]
                 {% not [W]
                     \ifstrequal{#2}{M}%
@@ -781,7 +812,7 @@
 
 \NewDocumentCommand{\KFLT at keyflt}{m m m +m +m}
 {%
-    \ifcsdef{l@#3}{}{%
+    \ifcsdef{ftype@#3}{}{%
         \PackageError{keyfloat}%
         {%
             \protect\keyflt: Invalid float type.\MessageBreak%
@@ -991,6 +1022,7 @@
         {% [W]:
             \wrapfloat{figure}{O}{.5\linewidth}%
             \minipage{\linewidth}%
+            \hbadness=10000\relax%
             \normalcolor\reset at font\normalsize%
         }%
         {% not [H]:
@@ -1102,6 +1134,7 @@
             \wrapfloat{\KFLT at subgrptype}{O}{.5\linewidth}%
             \setlength{\KFLT at rowboxwidth}{.5\KFLT at rowboxwidth}%
             \minipage{\linewidth}%
+            \hbadness=10000\relax%
             \normalcolor\reset at font\normalsize%
         }%
         {% not [H]:
@@ -1234,7 +1267,6 @@
     \addtolength{\KFLT at keywrapwidth}{-#1}%
     \addtolength{\KFLT at keywrapwidth}{-2em}%
     \minipage[t]{\KFLT at keywrapwidth}%
-    %
     \setlength{\parskip}{\KFLT at keywrapparskip}%
     \setlength{\parindent}{\KFLT at keywrapparindent}%
     \booltrue{KFLT at keywrap}%
@@ -1246,6 +1278,7 @@
     \begin{minipage}[t]{#1}%
     \booltrue{KFLT at keywrap}%
     \normalcolor\reset at font\normalsize%
+    \hbadness=10000\relax%
     #2%
     \par%
     \unskip\vspace{\smallskipamount}%



More information about the tex-live-commits mailing list.