diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-29 20:24:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-29 20:24:04 +0000 |
commit | 70af71c72e5d0a76f8adf71fb52c6e16261e77c6 (patch) | |
tree | c52dbad337ddede13fb57f227ac70a5b3916bb58 | |
parent | 8b1303eb20633b1b95746ba0d96e0bc8d31bf998 (diff) |
keyfloat (29may21)
git-svn-id: svn://tug.org/texlive/trunk@59389 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/keyfloat/README.txt | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf | bin | 1036937 -> 1008908 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx | 245 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty | 47 |
4 files changed, 250 insertions, 46 deletions
diff --git a/Master/texmf-dist/doc/latex/keyfloat/README.txt b/Master/texmf-dist/doc/latex/keyfloat/README.txt index ca229e6579f..21aec3ea01f 100644 --- a/Master/texmf-dist/doc/latex/keyfloat/README.txt +++ b/Master/texmf-dist/doc/latex/keyfloat/README.txt @@ -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 diff --git a/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf b/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf Binary files differindex d0ec4a58b3c..c102b8e14f4 100644 --- a/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf +++ b/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf diff --git a/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx b/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx index 08acaf860a7..317856b7da9 100644 --- a/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx +++ b/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx @@ -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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% %<*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,8 +352,9 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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} @@ -377,7 +378,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % % \bigskip % -% {\small\textcopyright{} 2016--2019} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} +% {\small\textcopyright{} 2016--2021} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} % % \vspace{.5in} % @@ -431,10 +432,10 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % 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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % 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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % 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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % % % \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,39 +1474,42 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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} % % % \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,6 +1546,22 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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 @@ -1836,12 +1878,12 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % % % The list of prohibited packages: +% \changes{v2.02}{2021/05/18}{Work with \pkg{float}.} % \begin{macrocode} \KFLT@prohibitpackage{floatrow}{caption and subcaption} \KFLT@prohibitpackage{subfig}{subcaption} \KFLT@prohibitpackage{subfigure}{subcaption} \KFLT@prohibitpackage{subfloat}{subcaption} -\KFLT@prohibitpackage{float}{newfloat} \KFLT@prohibitpackage{floatflt}{wrapfig} % \end{macrocode} % @@ -2318,7 +2360,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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@key{KFLT@keys}{mo}{\setlength{\KFLT@mo}{#1}} % \end{macrocode} @@ -2334,7 +2376,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % % 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@key{KFLT@keys}{wp}{\renewcommand{\KFLT@wp}{#1}} % \end{macrocode} @@ -2345,10 +2387,40 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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@key{KFLT@keys}{wlw}{% + \renewcommand{\KFLT@wlw}{#1}% + \setlength{\KFLT@ww}{0pt}% +} +% \end{macrocode} +% +% \begin{macro}{\KFLT@wlw} Wrapped figure, fraction of linewidth storage: ``|.5|'' +% \begin{macrocode} +\newcommand*{\KFLT@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@key{KFLT@keys}{ww}{% + \setlength{\KFLT@ww}{#1}% + \renewcommand{\KFLT@wlw}{}% +} +% \end{macrocode} +% +% \begin{macro}{\KFLT@ww} Wrapped figure, width storage: ``3cm'' +% \begin{macrocode} +\newlength{\KFLT@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@key{KFLT@keys}{va}{\renewcommand{\KFLT@va}{#1}} % \end{macrocode} @@ -2610,11 +2682,18 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \newlength{\KFLT@boxwidth} % \end{macrocode} % +% \DescribeLength{\KFLT@wrapwidth} Computed width of the wrapped figure +% \changes{v2.02}{2021/05/27}{Added \optn{ww} and \optn{wlw}.} +% \begin{macrocode} +\newlength{\KFLT@wrapwidth} +% \end{macrocode} + % % \begin{macro}{\KFLT@findwidths} Figure out how wide to make an image and its container % \begin{macrocode} \newcommand*{\KFLT@findwidths}{% % \end{macrocode} +% % Default to a box of full \cs{linewidth} minus the potential frame: % \begin{macrocode} \ifbool{KFLT@ft}% tight frame? @@ -2625,21 +2704,48 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% {\setlength{\KFLT@boxwidth}{\linewidth}}% no frame }% not tight frame % \end{macrocode} +% % Several width options exist. First see if width was given: % \begin{macrocode} \ifdimgreater{\KFLT@w}{0pt}% % \end{macrocode} +% % Width was given: % \begin{macrocode} {\setlength{\KFLT@imagewidth}{\KFLT@w}}% {% width not given % \end{macrocode} +% % Use full \cs{linewidth} or only a fraction: % \begin{macrocode} - \ifcsempty{\KFLT@lw}% + \ifcsempty{KFLT@lw}% {\setlength{\KFLT@imagewidth}{\KFLT@boxwidth}}% {\setlength{\KFLT@imagewidth}{\KFLT@lw\KFLT@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@ww}{0pt}% +% \end{macrocode} +% +% Width was given: +% \begin{macrocode} + {% + \setlength{\KFLT@wrapwidth}{\KFLT@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@wlw}% + {% + \setlength{\KFLT@wrapwidth}{\KFLT@imagewidth}}% + {% + \setlength{\KFLT@wrapwidth}{\KFLT@wlw\KFLT@boxwidth}}% + }% width not given } % \end{macrocode} % \end{macro} @@ -3085,6 +3191,8 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \renewcommand{\KFLT@stretch}{1}% \setlength{\KFLT@mo}{-1.2ex}% \renewcommand{\KFLT@wp}{O}% + \renewcommand{\KFLT@wlw}{}% + \setlength{\KFLT@ww}{0pt}% \renewcommand{\KFLT@va}{c}% } % \end{macrocode} @@ -3185,6 +3293,12 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % 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@boxouter}{m m} @@ -3473,20 +3595,34 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \begin{macrocode} {% [W] % \end{macrocode} +% % Temporarily figure out \cs{KFLT@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@findwidths% \wrapfloat{\KFLT@type}{\KFLT@wp}% - {\KFLT@imagewidth+2\KFLTlooseframewidth}% - \minipage{\KFLT@imagewidth+2\KFLTlooseframewidth}% + {\KFLT@wrapwidth+2\KFLTlooseframewidth}% + \minipage{\KFLT@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@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@lw}{}% \renewcommand{\KFLT@w}{\KFLT@imagewidth}% + \renewcommand{\KFLT@wlw}{}% + \renewcommand{\KFLT@ww}{0pt}% }% [W] {% not [W] % \end{macrocode} @@ -3694,7 +3830,14 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \begin{macrocode} \NewDocumentCommand{\KFLT@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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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@font\normalsize% }% {% not [H]: @@ -4322,6 +4473,14 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \wrapfloat{\KFLT@subgrptype}{O}{.5\linewidth}% \setlength{\KFLT@rowboxwidth}{.5\KFLT@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@font\normalsize% }% {% not [H]: @@ -4618,6 +4777,10 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % % % \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 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \addtolength{\KFLT@keywrapwidth}{-#1}% \addtolength{\KFLT@keywrapwidth}{-2em}% \minipage[t]{\KFLT@keywrapwidth}% - % +% \setlength{\parskip}{\KFLT@keywrapparskip}% \setlength{\parindent}{\KFLT@keywrapparindent}% \booltrue{KFLT@keywrap}% @@ -4641,6 +4804,14 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \begin{minipage}[t]{#1}% \booltrue{KFLT@keywrap}% \normalcolor\reset@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}% diff --git a/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty b/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty index 6c18d0c7f2b..8662890c5c0 100644 --- a/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty +++ b/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty @@ -18,7 +18,9 @@ \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.] + + @@ -59,7 +61,6 @@ \KFLT@prohibitpackage{subfig}{subcaption} \KFLT@prohibitpackage{subfigure}{subcaption} \KFLT@prohibitpackage{subfloat}{subcaption} -\KFLT@prohibitpackage{float}{newfloat} \KFLT@prohibitpackage{floatflt}{wrapfig} \RequirePackage{etoolbox}[2011/01/03]% \RequirePackage{xparse} @@ -204,6 +205,17 @@ \define@key{KFLT@keys}{wp}{\renewcommand{\KFLT@wp}{#1}} \newcommand{\KFLT@wp}{O} +\define@key{KFLT@keys}{wlw}{% + \renewcommand{\KFLT@wlw}{#1}% + \setlength{\KFLT@ww}{0pt}% +} +\newcommand*{\KFLT@wlw}{} +\define@key{KFLT@keys}{ww}{% + \setlength{\KFLT@ww}{#1}% + \renewcommand{\KFLT@wlw}{}% +} +\newlength{\KFLT@ww} + \define@key{KFLT@keys}{va}{\renewcommand{\KFLT@va}{#1}} \newcommand{\KFLT@va}{c} @@ -282,6 +294,8 @@ \newlength{\KFLT@imagewidth} \newlength{\KFLT@boxwidth} +\newlength{\KFLT@wrapwidth} + \newcommand*{\KFLT@findwidths}{% \ifbool{KFLT@ft}% tight frame? {\setlength{\KFLT@boxwidth}{\linewidth - 2\KFLTtightframewidth}}% @@ -293,10 +307,20 @@ \ifdimgreater{\KFLT@w}{0pt}% {\setlength{\KFLT@imagewidth}{\KFLT@w}}% {% width not given - \ifcsempty{\KFLT@lw}% + \ifcsempty{KFLT@lw}% {\setlength{\KFLT@imagewidth}{\KFLT@boxwidth}}% {\setlength{\KFLT@imagewidth}{\KFLT@lw\KFLT@boxwidth}}% }% width not given + \ifdimgreater{\KFLT@ww}{0pt}% + {% + \setlength{\KFLT@wrapwidth}{\KFLT@ww}}% + {% width not given + \ifcsempty{KFLT@wlw}% + {% + \setlength{\KFLT@wrapwidth}{\KFLT@imagewidth}}% + {% + \setlength{\KFLT@wrapwidth}{\KFLT@wlw\KFLT@boxwidth}}% + }% width not given } \newcommand{\KFLTtightframe}[1]{% \setlength{\fboxsep}{0pt}% @@ -519,6 +543,8 @@ \renewcommand{\KFLT@stretch}{1}% \setlength{\KFLT@mo}{-1.2ex}% \renewcommand{\KFLT@wp}{O}% + \renewcommand{\KFLT@wlw}{}% + \setlength{\KFLT@ww}{0pt}% \renewcommand{\KFLT@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@optionalname{\csuse{KFLT@#1a#2p}}% @@ -681,11 +709,14 @@ {% [W] \KFLT@findwidths% \wrapfloat{\KFLT@type}{\KFLT@wp}% - {\KFLT@imagewidth+2\KFLTlooseframewidth}% - \minipage{\KFLT@imagewidth+2\KFLTlooseframewidth}% + {\KFLT@wrapwidth+2\KFLTlooseframewidth}% + \minipage{\KFLT@wrapwidth+2\KFLTlooseframewidth}% + \hbadness=10000\relax% \normalcolor\reset@font\normalsize% \renewcommand{\KFLT@lw}{}% \renewcommand{\KFLT@w}{\KFLT@imagewidth}% + \renewcommand{\KFLT@wlw}{}% + \renewcommand{\KFLT@ww}{0pt}% }% [W] {% not [W] \ifstrequal{#2}{M}% @@ -781,7 +812,7 @@ \NewDocumentCommand{\KFLT@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@font\normalsize% }% {% not [H]: @@ -1102,6 +1134,7 @@ \wrapfloat{\KFLT@subgrptype}{O}{.5\linewidth}% \setlength{\KFLT@rowboxwidth}{.5\KFLT@rowboxwidth}% \minipage{\linewidth}% + \hbadness=10000\relax% \normalcolor\reset@font\normalsize% }% {% not [H]: @@ -1234,7 +1267,6 @@ \addtolength{\KFLT@keywrapwidth}{-#1}% \addtolength{\KFLT@keywrapwidth}{-2em}% \minipage[t]{\KFLT@keywrapwidth}% - % \setlength{\parskip}{\KFLT@keywrapparskip}% \setlength{\parindent}{\KFLT@keywrapparindent}% \booltrue{KFLT@keywrap}% @@ -1246,6 +1278,7 @@ \begin{minipage}[t]{#1}% \booltrue{KFLT@keywrap}% \normalcolor\reset@font\normalsize% + \hbadness=10000\relax% #2% \par% \unskip\vspace{\smallskipamount}% |