texlive[44306] Master/texmf-dist: keyfloat (12may17)

commits+karl at tug.org commits+karl at tug.org
Sat May 13 00:00:38 CEST 2017


Revision: 44306
          http://tug.org/svn/texlive?view=revision&revision=44306
Author:   karl
Date:     2017-05-13 00:00:38 +0200 (Sat, 13 May 2017)
Log Message:
-----------
keyfloat (12may17)

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	2017-05-12 22:00:19 UTC (rev 44305)
+++ trunk/Master/texmf-dist/doc/latex/keyfloat/README.txt	2017-05-12 22:00:38 UTC (rev 44306)
@@ -1,8 +1,8 @@
 The LaTeX keyfloat package
 Provides a key/value interface for generating floats.
 
-v0.14 — 2017/02/09
-Copyright 2016 Brian Dunn — www.BDTechConcepts.com
+v0.15 — 2017/05/12
+Copyright 2016-2017 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	2017-05-12 22:00:19 UTC (rev 44305)
+++ trunk/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx	2017-05-12 22:00:38 UTC (rev 44306)
@@ -1,4 +1,4 @@
-
+%
 % \iffalse meta-comment
 %
 % Copyright 2016 Brian Dunn
@@ -17,7 +17,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{keyfloat}
-%<package>    [2017/02/09 v0.14 Key/value interface for floats and the subcaption package.]
+%<package>    [2017/05/12 v0.15 Key/value interface for floats and the subcaption package.]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -316,7 +316,7 @@
 %<*package>
 % \fi
 %
-% \CheckSum{1022}
+% \CheckSum{1102}
 %
 % \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
@@ -342,12 +342,12 @@
 % \changes{v0.13}{2017/01/18}{\ 2017/01/18}
 % \changes{v0.13}{2017/01/12}{Docs: Other Settings.}
 % \changes{v0.14}{2017/02/09}{\ 2017/02/09}
+% \changes{v0.15}{2017/05/12}{\ 2017/05/12}
 
 
 
 
 
-
 % \GetFileInfo{\mypackagename.sty}
 %
 % \DoNotIndex{\newcommand,\renewcommand,\addtocounter,\begin,\end,\begingroup,\endgroup}
@@ -405,9 +405,9 @@
 % When used with the \pkg{tocdata} package, the name also appears in the
 % List of Figures.
 %
-% Floats may be placed into a row environment, and are
+% Floats may be placed into a multi-row environment, and are
 % typeset to fit within the given number of columns,
-% continuing to the next row if necessary.
+% continuing to the next rows as necessary.
 % Nested sub-rows may be used to generate layouts such as
 % two small figures placed vertically next to
 % one larger figure.
@@ -421,6 +421,21 @@
 % As an example, a typical command to include a figure with a framed image of half \cs{linewidth}
 % could be: \\
 % \hspace*{1em}\verb|\keyfig*[hbp]{f,lw=.5,c={A caption},l={fig:label}}{image}|
+% \bigskip
+%
+% \footnotesize
+% \begin{description}
+% \item[License:] \
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+%   http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+% \end{description}
+%
 % \end{abstract}
 %
 % \vspace*{\fill}
@@ -475,22 +490,22 @@
 % Attempting to add additional features such as frames and continued floats
 % hits the limit of nine parameters for a \TeX\ macro,
 % requiring that new features use some kind of change-state macros instead.
-% Attempting to support rows of floats or subfloats only made things more complicated still.
+% Attempting to support rows of floats or subfloats only makes things more complicated still.
 % 
 % A key/value system solves the problem of adding more features,
 % does not require much additional typing, is a more self-documenting
-% syntax, and allows the sharing of keys with subfloats as well.
+% syntax, and allows a shared syntax with subfloats and groups of floats as well.
 % Thus, the \pkg{keyfloat} package.
 %
 % \subsection{The \pkg{keyfloat} Package}
 % 
-% Using \pkg{keyfloat}, the first example above becomes:
+% Using \pkg{keyfloat}, the previous example becomes:
 % \begin{verbatim}
 % \keyfig{w=3in,c=A Figure,l=fig:somelabel}{filename}
 % \end{verbatim}
 % \unskip
 % 
-% The \cs{onefigure} example above becomes:
+% The \cs{onefigure} general case becomes:
 % \begin{verbatim}
 % \keyfig*[loc]{w=width,t={add'l text},sc=shortcap,cstar=caption,
 %     l=label}{filename}
@@ -510,11 +525,12 @@
 % \item[keyfloats:] A group of rows and columns of floats.
 % \item[keysubfigs:] A figure containing a group of rows and columns of subfigures.
 % \item[keysubtabs:] A table containing a group of rows and columns of subtables.
+% \item[keywrap:] Wraps a keyfloat around an environment of text.  Usable inside a list.
 % \item[marginfigure:] A figure environment placed into
 %	the margin.\footnote{\env{marginfigure} and \env{margintable}: The environments
 %	provided by the |tufte-book| class are used if loaded,
 %	otherwise \pkg{keyfloat} provides its own versions.}
-% \item[margintable:] A table environment placed into the margin.
+% \item[margintable:] A table environment placed in the margin.
 % \end{description}
 %
 % Additional features include:
@@ -634,6 +650,12 @@
 % May not be nested.
 % See \cref{ex:keysubtabs}.
 %
+% \DescribeEnv{keywrap} \marg{width of keyfloat} \marg{keyfloat} \\
+% Displays a keyfloat next to an environment of text.  Usable inside a list item,
+% where [W] will not work.  \meta{keyfloat} may be any of \cs{keyfig}, \env{keyfigure},
+% \env{keyfloats}, \env{keysubfigs}, etc., each with its proper arguments.
+% See \cref{ex:keywrapkeyfig}.
+%
 % \DescribeEnv{marginfigure} \oarg{offset} \\
 % A figure placed into the margin, with an optional vertical offset.
 % \cs{keyfloat} uses the version provided by the |tufte-book| class if available,
@@ -756,6 +778,9 @@
 %	is |O|, which places the wrapped float at the outside edge of the text.
 %	See \cref{tab:wrapplacement}.
 %	& wp=I \\
+% va & Sets the vertical alignment of the outermost minipage container for the keyfloat.
+%	Defaults to 'c'.
+%	& va=t \\
 % \bottomrule
 % \end{tabular}
 % \begin{tablenotes}
@@ -1173,8 +1198,8 @@
 %
 % \begin{dtxexample}[\Cref{fig:subfigs}]{Subfigures — \env{keysubfigs} environment\label{ex:keysubfigs}}
 % \begin{keysubfigs}{3}{c=Subfigures,l=fig:subfigs}
-% \keyfig{lw=1,f,c={First Subfigure},
-% 	l=fig:firstsubfig,t=Some Text}{image}
+% \keyfig{lw=1,f,c={First subfigure},
+% 	l=fig:firstsubfig,t=Some text}{image}
 % \keyfig{lw=1,f,r=90,c={Second subfigure},
 % 	l=fig:secondsubfig,
 % 	t=Lots of lots of lots of lots of text.}
@@ -1380,8 +1405,37 @@
 % \end{dtxexample}
 %
 %
+% \clearpage
 %
+% \begin{dtxexample}[\Cref{fig:keywrapfig}]
+%	{Using \cs{keywrap} with a \cs{keyfig}\label{ex:keywrapkeyfig}}
+% \begin{itemize}
+% \item First item.
+%     Several lines of text text text text text
+%     text text text text text text text text.
+% \item \begin{keywrap}{.3\linewidth}{\keyfig{%
+%       lw=1,c={Keywrap with \cs{keyfig}},l=fig:keywrapfig%
+%     }{image}}
+%         Second item.
+%         Several lines of text text text text text
+%         text text text text text text text text text
+%         text text text text text text text.
 %
+%         These paragraphs are inside the \texttt{keywrap}.
+%         A vertical gap appears below if the text is not enough to
+%         fill the space next to the \cs{keyfig}.
+%     \end{keywrap}
+%     Outside the \env{wrapfig},\margintag{notes}\
+%     but still in the second item.
+%     There is no elegant way to place only part of a paragraph
+%     inside a \env{keywrap}, and attempting to do so requires
+%     manually removing the vertical paragraph skip.
+% \item Third item.
+% \end{itemize}
+% \end{dtxexample}
+%
+%
+%
 % \clearpage
 % \subsubsection{Custom Frames}
 %
@@ -1510,7 +1564,7 @@
 % \begin{keysubfigs}{2}{
 % 	c=Artist's collection, l=fig:artistcollection,
 % 	t={Some fully-justified text just for illustrative purposes,
-% 	in case you have use for large explanations.
+% 	in case you have use for long explanations.
 % 	This text may be the full \cs{linewidth} in size. \par
 % 	Multiple paragraphs of text are allowed.},
 % 	ap=Prefix,af=First,al=Last,as={, Suffix}
@@ -1773,7 +1827,7 @@
 
 % \DescribeBoolean{KFLT at cont} Continued float?
 %    \begin{macrocode}
-\newboolean{KFLT at cont}{}
+\newboolean{KFLT at cont}
 %    \end{macrocode}
 %
 % \DescribeKey[main]{cont} Continued float?
@@ -2096,7 +2150,7 @@
 \define at key{KFLT at keys}{wp}{\renewcommand{\KFLT at wp}{#1}}
 %    \end{macrocode}
 %
-% \begin{macro}{\KFLT at wp} Storage for the vertical margin offset.
+% \begin{macro}{\KFLT at wp} Storage for the wrap placement.
 %    \begin{macrocode}
 \newcommand{\KFLT at wp}{O}
 %    \end{macrocode}
@@ -2103,9 +2157,23 @@
 % \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}.}
+%    \begin{macrocode}
+\define at key{KFLT at keys}{va}{\renewcommand{\KFLT at va}{#1}}
+%    \end{macrocode}
+%
+% \begin{macro}{\KFLT at va} Storage for the vertical alignment.
+%    \begin{macrocode}
+\newcommand{\KFLT at va}{c}
+%    \end{macrocode}
+% \end{macro}
 
 
 
+
+
 % \subsection{Nesting Control}
 
 % \DescribeCounter{KFLT at keyfloatdepth} Depth inside a keyfigs environment
@@ -2784,6 +2852,7 @@
 \renewcommand{\KFLT at stretch}{1}%
 \setlength{\KFLT at mo}{-1.2ex}%
 \renewcommand{\KFLT at wp}{O}%
+\renewcommand{\KFLT at va}{c}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -3092,14 +3161,16 @@
 % 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/12}{Adjustments for \protect\env{keywrap}.}
 %    \begin{macrocode}
 \NewDocumentEnvironment{KFLT at boxouter}{m m}
 {% boxouter
 %    \end{macrocode}
-% The \env{keytable} environment handles the contents in either of
+% The \env{keyfigure} and \env{keytable} environments handle the contents in one of
 % three possible ways, depending on whether it is
 % called alone, inside a \env{keyfloats} environment, or
-% inside a \env{keysubtabs} environment.
+% inside a \env{keysubfigs} or \env{keysubtabs} environment.
 %
 % Start the new subfigure or subtable, of the given width:
 %    \begin{macrocode}
@@ -3111,7 +3182,9 @@
 {% not subfloat:
 \ifthenelse{\cnttest{\value{KFLT at keyfloatdepth}}>{0}}%
 {% keyfloats
-\minipage{\KFLT at rowboxwidth}%
+\ifbool{KFLT at keywrap}
+{\minipage[t]{\KFLT at rowboxwidth}}%
+{\minipage[\KFLT at va]{\KFLT at rowboxwidth}}%
 \captionsetup*{type=\KFLT at type}%
 }% keyfloats
 {% not keyfloats
@@ -3119,7 +3192,20 @@
 %
 % Not a subfloat or \env{keyfloats}, so create a single float.
 %
+% See if inside a \env{keywrap}.
+% If so, force [H] and vertical align top.
+%    \begin{macrocode}
+\ifbool{KFLT at keywrap}%
+{%
+\par\addvspace{\baselineskip}%
+\noindent\minipage[t]{\linewidth}%
+\captionsetup{type=\KFLT at type}%
+}%
+{% not a keywrap
+%    \end{macrocode}
+%
 % See if the float should [W]rap:
+%
 %    \begin{macrocode}
 \ifthenelse{\equal{#2}{W}}%
 %    \end{macrocode}
@@ -3162,7 +3248,7 @@
 %    \begin{macrocode}
 {% [H]
 \par\addvspace{\baselineskip}%
-\noindent\minipage{\linewidth}%
+\noindent\minipage[\KFLT at va]{\linewidth}%
 \captionsetup{type=\KFLT at type}%
 }% [H]
 %    \end{macrocode}
@@ -3175,6 +3261,7 @@
 }% not [H]
 }% not [M]
 }% not [W]
+}% not keywrap
 }% not keyfloats
 }% not subfloat
 %    \end{macrocode}
@@ -3226,6 +3313,15 @@
 %
 % Close the minipage or float:
 %
+% See if in a \env{keywrap}:
+%    \begin{macrocode}
+\ifbool{KFLT at keywrap}{%
+\endminipage%
+\par\addvspace{\baselineskip}%
+}
+{% not keywrap
+%    \end{macrocode}
+%
 % See if the float should [W]rap:
 %    \begin{macrocode}
 \ifthenelse{\equal{#2}{W}}%
@@ -3258,6 +3354,7 @@
 }% not [H]
 }% not [M]
 }% not [W]
+}% not keywrap
 }% not keyfloats
 }% not subfloat
 }% endkeyboxouter
@@ -3482,6 +3579,8 @@
 % Likewise, manually-selected |w| width and |h| tags may need to be
 % adjusted to prevent overflow.
 %
+% \changes{v0.15}{2017/05/12}{Adjustments for \protect\env{keywrap}.}
+%
 %    \begin{macrocode}
 \NewDocumentEnvironment{keyfloats}{s O{tbp} m}
 {%
@@ -3490,12 +3589,13 @@
 %    \begin{macrocode}
 \addtocounter{KFLT at keyfloatdepth}{1}%
 %    \end{macrocode}
-% If [H] or nested, use a minipage instead of a float:
+% If [H], nested, subfloats, or keywrap, use a minipage instead of a float:
 %    \begin{macrocode}
 \ifthenelse{%
 \equal{#2}{H}%
 \OR\cnttest{\value{KFLT at keyfloatdepth}}>{1}%
 \OR\boolean{KFLT at inkeysubfloats}%
+\OR\boolean{KFLT at keywrap}%
 }%
 %    \end{macrocode}
 % Create an inline minipage:
@@ -3509,7 +3609,8 @@
 \OR\boolean{KFLT at inkeysubfloats}%
 }%
 {\noindent%
-\begin{minipage}{\KFLT at rowboxwidth}}%
+\begin{minipage}{\KFLT at rowboxwidth}%
+}%
 {\bigbreak%
 \noindent\begin{minipage}{\linewidth}}%
 %    \end{macrocode}
@@ -3562,12 +3663,16 @@
 \equal{#2}{H}%
 \OR\cnttest{\value{KFLT at keyfloatdepth}}>{1}%
 \OR\boolean{KFLT at inkeysubfloats}%
+\OR\boolean{KFLT at keywrap}%
 }%
 {\end{minipage}%
 %    \end{macrocode}
 % Spacing if nested:
 %    \begin{macrocode}
-\ifthenelse{\cnttest{\value{KFLT at keyfloatdepth}}>{0}}%
+\ifthenelse{%
+\cnttest{\value{KFLT at keyfloatdepth}}>{0}%
+\OR\boolean{KFLT at keywrap}%
+}%
 {}{\bigbreak}%
 }% was [H]
 %    \end{macrocode}
@@ -3642,6 +3747,7 @@
 % \begin{macro}{\KFLT at subfloats} \marg{starred?} \marg{loc} \marg{cols} \marg{\keyvalsarg}
 %
 % \changes{v0.13}{2017/01/16}{Fix: Subfloat type selection.}
+% \changes{v0.15}{2017/05/12}{Adjustments for \protect\env{keywrap}.}
 %
 % Start a subfloat environment
 %    \begin{macrocode}
@@ -3664,9 +3770,12 @@
 {\setlength{\KFLT at rowboxwidth}{.9\textwidth/\real{#3}}}%
 {\setlength{\KFLT at rowboxwidth}{.9\linewidth/\real{#3}}}%
 %    \end{macrocode}
-% If [H], create an inline minipage:
+% If [H], or in a \env{keywrap}, create an inline minipage:
 %    \begin{macrocode}
-\ifthenelse{\equal{#2}{H}}%
+\ifthenelse{%
+\equal{#2}{H}%
+\OR\boolean{KFLT at keywrap}%
+}%
 {%
 \bigbreak\noindent\begin{minipage}{\linewidth}%
 }%
@@ -3735,7 +3844,10 @@
 %    \end{macrocode}
 % End the float or minipage:
 %    \begin{macrocode}
-\ifthenelse{\equal{#2}{H}}%
+\ifthenelse{%
+\equal{#2}{H}%
+\OR\boolean{KFLT at keywrap}%
+}%
 {\end{minipage}\bigbreak}% was [H]
 {% not [H]:
 \IfBooleanTF{#1}% starred?
@@ -3858,20 +3970,81 @@
   {\end{KFLT at marginfloat}}
 %    \end{macrocode}
 % \end{environment}
+%
+%
+%
+%
+%
+%
+% \DescribeBoolean{KFL at keywrap} Tells the next keyfloat to wrap around some text.
+%    \begin{macrocode}
+\newboolean{KFLT at keywrap}
+\boolfalse{KFLT at keywrap}
+%    \end{macrocode}
+%
+%
+% \DescribeLength{\KFLT at keywrapwidth} The width of the object to be wrapped beside the text.
+%    \begin{macrocode}
+\newlength{\KFLT at keywrapwidth}
+%    \end{macrocode}
+%
+% \DescribeLength{\KFLT at keywrapparskip} The \cs{parskip} outside of the keywrap.
+%    \begin{macrocode}
+\newlength{\KFLT at keywrapparskip}
+%    \end{macrocode}
+%
+% \DescribeLength{\KFLT at keywrapparindent} The \cs{parindent} outside of the keywrap.
+%    \begin{macrocode}
+\newlength{\KFLT at keywrapparindent}
+%    \end{macrocode}
+%
+%
+% \begin{environment}{keywrap} \marg{width} \marg{keyfloat}
+% \changes{v0.15}{2017/05/11}{Added.}
+%    \begin{macrocode}
+\DeclareDocumentEnvironment{keywrap}{m +m}
+{%
+\par%
+\setlength{\KFLT at keywrapwidth}{\linewidth}%
+\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}%
+}
+{%
+\par
+\endminipage%
+\hfill%
+\begin{minipage}[t]{#1}%
+\booltrue{KFLT at keywrap}%
+#2%
+\par
+\unskip\vspace{\smallskipamount}
+\end{minipage}%
+\par
+}
 
-
-
-
-
+\BeforeBeginEnvironment{keywrap}{
+\setlength{\KFLT at keywrapparskip}{\parskip}
+\setlength{\KFLT at keywrapparindent}{\parindent}
+}
+%    \end{macrocode}
 %
+% \end{environment}
 %
+%
+%
+%
 % \iffalse
 %</package>
 % \fi
-
-
-
-
+%
+%
+%
+%
 % \clearpage
 % \pagestyle{plain}
 %

Modified: trunk/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty	2017-05-12 22:00:19 UTC (rev 44305)
+++ trunk/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty	2017-05-12 22:00:38 UTC (rev 44306)
@@ -16,10 +16,9 @@
 %% and version 1.3 or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
 
-
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{keyfloat}
-    [2017/02/09 v0.14 Key/value interface for floats and the subcaption package.]
+    [2017/05/12 v0.15 Key/value interface for floats and the subcaption package.]
 
 
 
@@ -69,7 +68,7 @@
 \newlength{\KFLT at rowboxwidth}
 
 
-\newboolean{KFLT at cont}{}
+\newboolean{KFLT at cont}
 \define at key{KFLT at keys}{cont}[true]{\setboolean{KFLT at cont}{#1}}
 \newcommand{\KFLT at c}{}
 \newboolean{KFLT at cstar}
@@ -157,7 +156,10 @@
 \define at key{KFLT at keys}{wp}{\renewcommand{\KFLT at wp}{#1}}
 \newcommand{\KFLT at wp}{O}
 
+\define at key{KFLT at keys}{va}{\renewcommand{\KFLT at va}{#1}}
+\newcommand{\KFLT at va}{c}
 
+
 \newcounter{KFLT at keyfloatdepth}
 \setcounter{KFLT at keyfloatdepth}{0}
 
@@ -448,6 +450,7 @@
 \renewcommand{\KFLT at stretch}{1}%
 \setlength{\KFLT at mo}{-1.2ex}%
 \renewcommand{\KFLT at wp}{O}%
+\renewcommand{\KFLT at va}{c}%
 }
 
 
@@ -574,10 +577,19 @@
 {% not subfloat:
 \ifthenelse{\cnttest{\value{KFLT at keyfloatdepth}}>{0}}%
 {% keyfloats
-\minipage{\KFLT at rowboxwidth}%
+\ifbool{KFLT at keywrap}
+{\minipage[t]{\KFLT at rowboxwidth}}%
+{\minipage[\KFLT at va]{\KFLT at rowboxwidth}}%
 \captionsetup*{type=\KFLT at type}%
 }% keyfloats
 {% not keyfloats
+\ifbool{KFLT at keywrap}%
+{%
+\par\addvspace{\baselineskip}%
+\noindent\minipage[t]{\linewidth}%
+\captionsetup{type=\KFLT at type}%
+}%
+{% not a keywrap
 \ifthenelse{\equal{#2}{W}}%
 {% [W]
 \KFLT at findwidths%
@@ -596,7 +608,7 @@
 \ifthenelse{\equal{#2}{H}}%
 {% [H]
 \par\addvspace{\baselineskip}%
-\noindent\minipage{\linewidth}%
+\noindent\minipage[\KFLT at va]{\linewidth}%
 \captionsetup{type=\KFLT at type}%
 }% [H]
 {% not [H]
@@ -605,6 +617,7 @@
 }% not [H]
 }% not [M]
 }% not [W]
+}% not keywrap
 }% not keyfloats
 }% not subfloat
 \ifthenelse{\boolean{KFLT at cont}}{\ContinuedFloat}{}%
@@ -624,6 +637,11 @@
 \ifthenelse{\cnttest{\value{KFLT at keyfloatdepth}}>{0}}% keyfloats?
 {\endminipage}% keyfloats
 {% not keyfloats
+\ifbool{KFLT at keywrap}{%
+\endminipage%
+\par\addvspace{\baselineskip}%
+}
+{% not keywrap
 \ifthenelse{\equal{#2}{W}}%
 {% [W]
 \csname endwrap\KFLT at type\endcsname%
@@ -645,6 +663,7 @@
 }% not [H]
 }% not [M]
 }% not [W]
+}% not keywrap
 }% not keyfloats
 }% not subfloat
 }% endkeyboxouter
@@ -763,6 +782,7 @@
 \equal{#2}{H}%
 \OR\cnttest{\value{KFLT at keyfloatdepth}}>{1}%
 \OR\boolean{KFLT at inkeysubfloats}%
+\OR\boolean{KFLT at keywrap}%
 }%
 {% [H] or nested
 \ifthenelse{%
@@ -770,7 +790,8 @@
 \OR\boolean{KFLT at inkeysubfloats}%
 }%
 {\noindent%
-\begin{minipage}{\KFLT at rowboxwidth}}%
+\begin{minipage}{\KFLT at rowboxwidth}%
+}%
 {\bigbreak%
 \noindent\begin{minipage}{\linewidth}}%
 \ifthenelse{\boolean{KFLT at inkeysubfloats}}%
@@ -795,9 +816,13 @@
 \equal{#2}{H}%
 \OR\cnttest{\value{KFLT at keyfloatdepth}}>{1}%
 \OR\boolean{KFLT at inkeysubfloats}%
+\OR\boolean{KFLT at keywrap}%
 }%
 {\end{minipage}%
-\ifthenelse{\cnttest{\value{KFLT at keyfloatdepth}}>{0}}%
+\ifthenelse{%
+\cnttest{\value{KFLT at keyfloatdepth}}>{0}%
+\OR\boolean{KFLT at keywrap}%
+}%
 {}{\bigbreak}%
 }% was [H]
 {% not [H]
@@ -842,7 +867,10 @@
 \IfBooleanTF{#1}%
 {\setlength{\KFLT at rowboxwidth}{.9\textwidth/\real{#3}}}%
 {\setlength{\KFLT at rowboxwidth}{.9\linewidth/\real{#3}}}%
-\ifthenelse{\equal{#2}{H}}%
+\ifthenelse{%
+\equal{#2}{H}%
+\OR\boolean{KFLT at keywrap}%
+}%
 {%
 \bigbreak\noindent\begin{minipage}{\linewidth}%
 }%
@@ -865,7 +893,10 @@
 \par\addvspace{\bigskipamount}%
 \KFLT at addartisttext{subgrp}%
 \KFLT at captioniftype{figure}{subgrp}%
-\ifthenelse{\equal{#2}{H}}%
+\ifthenelse{%
+\equal{#2}{H}%
+\OR\boolean{KFLT at keywrap}%
+}%
 {\end{minipage}\bigbreak}% was [H]
 {% not [H]:
 \IfBooleanTF{#1}% starred?
@@ -915,8 +946,39 @@
 \ProvideDocumentEnvironment{margintable}{O{-1.2ex}}
   {\begin{KFLT at marginfloat}[#1]{table}}
   {\end{KFLT at marginfloat}}
+\newboolean{KFLT at keywrap}
+\boolfalse{KFLT at keywrap}
+\newlength{\KFLT at keywrapwidth}
+\newlength{\KFLT at keywrapparskip}
+\newlength{\KFLT at keywrapparindent}
+\DeclareDocumentEnvironment{keywrap}{m +m}
+{%
+\par%
+\setlength{\KFLT at keywrapwidth}{\linewidth}%
+\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}%
+}
+{%
+\par
+\endminipage%
+\hfill%
+\begin{minipage}[t]{#1}%
+\booltrue{KFLT at keywrap}%
+#2%
+\par
+\unskip\vspace{\smallskipamount}
+\end{minipage}%
+\par
+}
 
-
+\BeforeBeginEnvironment{keywrap}{
+\setlength{\KFLT at keywrapparskip}{\parskip}
+\setlength{\KFLT at keywrapparindent}{\parindent}
+}
 \endinput
 %%
 %% End of file `keyfloat.sty'.



More information about the tex-live-commits mailing list