From 1a6a16552bad89843c42ccbab0783c6780a0f204 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 8 Jun 2021 20:36:36 +0000 Subject: keyfloat (8jun21) git-svn-id: svn://tug.org/texlive/trunk@59523 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/keyfloat/README.txt | 2 +- Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf | Bin 1008908 -> 1012669 bytes .../texmf-dist/source/latex/keyfloat/keyfloat.dtx | 107 ++++++++++++++++----- Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty | 28 +++++- 4 files changed, 111 insertions(+), 26 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/keyfloat/README.txt b/Master/texmf-dist/doc/latex/keyfloat/README.txt index 21aec3ea01f..181f780ee7f 100644 --- a/Master/texmf-dist/doc/latex/keyfloat/README.txt +++ b/Master/texmf-dist/doc/latex/keyfloat/README.txt @@ -1,7 +1,7 @@ The LaTeX keyfloat package Provides a key/value interface for generating floats. -v2.03 +v2.04 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 index c102b8e14f4..3127cfeab0e 100644 Binary files a/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf and b/Master/texmf-dist/doc/latex/keyfloat/keyfloat.pdf differ diff --git a/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx b/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx index 317856b7da9..7be362c4210 100644 --- a/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx +++ b/Master/texmf-dist/source/latex/keyfloat/keyfloat.dtx @@ -17,7 +17,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{keyfloat} -% [2021/05/28 v2.03 Key/value interface for floats and subfloats.] +% [2021/06/08 v2.04 Key/value interface for floats and subfloats.] % %<*driver> \documentclass{ltxdoc} @@ -317,7 +317,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% %<*package> % \fi % -% \CheckSum{1298} +% \CheckSum{1326} % % \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 @@ -355,6 +355,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \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} +% \changes{v2.04}{2021/06/08}{2021/06/08} @@ -811,7 +812,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % cont & \largebullet & Continued float? & cont \\ % l & \largebullet & The label. Enclose in braces if a comma is included. % Ignored in unnumbered floats. & l=fig:A name \\ -% ap, aup & \largebullet & Artist/author's prefix, such as ``Mr.''\tnote{b} & ap=Mr. \\ +% ap, aup & \largebullet & Artist/author's prefix, such as ``Mr.''\,\tnote{b} & ap=Mr. \\ % af, auf & \largebullet & Artist/author's first name.\tnote{b} & af=First \\ % al, aul & \largebullet & Artist/author's last name.\tnote{b} & al=Last \\ % as, aus & \largebullet & Artist/author's suffix, such as |~III|.\tnote{b} & |al=~III| \\ @@ -849,44 +850,46 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \index{keys>and values} % \begin{threeparttable} % \small -% \begin{tabular}{>{\ttfamily}c>{\raggedright}p{2.5in}>{\centering\arraybackslash}>{\ttfamily\arraybackslash}p{1in}} +% \begin{tabular}{>{\ttfamily}cc>{\raggedright}p{2.5in}>{\centering\arraybackslash}>{\ttfamily\arraybackslash}p{1in}} % \toprule -% \textrm{Key}\tnote{a} & Description & \textrm{Example} \\ +% \textrm{Key} & Sub\tnote{c} & Description & \textrm{Example} \\ % \midrule -% lw & Set the width to a fraction of \cs{linewidth}. Cancels |w|. +% lw & --- & Set the width to a fraction of \cs{linewidth}. Cancels |w|. % 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|. +% w & --- & Set the actual width. Cancels |lw|. % 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 \\ -% f & Selects a loose frame with the current \cs{fboxsep}. +% 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 \\ +% f & --- & Selects a loose frame with the current \cs{fboxsep}. % Only rotated with \cs{keyfig}. & f \\ -% ft & Selects a tight frame with no \cs{fboxsep}. Useful for photographs, +% ft & --- & Selects a tight frame with no \cs{fboxsep}. Useful for photographs, % or diagrams which already have some margin built in. & ft \\ -% stretch & Sets \cs{arraystretch} inside the float. & stretch=1.5 \\ -% mo & Sets the vertical offset for a margin float. & mo=-1.2ex \\ -% wp & Sets the wrap placement for a wrapped float. The default +% stretch & --- & Sets \cs{arraystretch} inside the float. & stretch=1.5 \\ +% mo & --- & Sets the vertical offset for a margin float. & mo=-1.2ex \\ +% wn & --- & Sets the number of lines for a wrapped float. & wn=2 \\ +% wp & --- & Sets the wrap placement for a wrapped float. The default % 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}. +% wo & --- & Sets the wrap overhang for a wrapped float. & wo=8em \\ +% 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. +% 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. +% va & --- & Sets the vertical alignment of the outermost minipage container for the keyfloat. % Defaults to 'c'. % & va=t \\ % \bottomrule % \end{tabular} % \begin{tablenotes} -% \item[a:] None of the keys in Part II are used in the +% \item[c:] None of the keys in Part II are used in the % \env{keysubfigs}, \env{keysubtabs}, and \env{keysubfloats} environments. % \end{tablenotes} % \end{threeparttable} @@ -1476,7 +1479,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \begin{dtxexample}[\Cref{fig:keyfigw,tab:keytabw}] % {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, +% l=fig:keyfigw,ft,lw=.4,wp=I, wo=8em, wn=12, % t={.4\cs{linewidth} wide, placed \optn{I}.} % }{image2} % \blindtext @@ -1489,7 +1492,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \begin{dtxexample}[\Cref{fig:keyfigboxw} and the \cs{keyparbox}.] % {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, +% l=fig:keyfigboxw,f,lw=.25,wp=I, wn=7, % t=Text text text text text text text text text % }{The contents.} % \blindtext @@ -1502,7 +1505,7 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \begin{dtxexample}[\Cref{fig:keyfigurew,tab:keytablew}] % {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} +% l=fig:keyfigurew,f,w=1.5in, wo=4em,wn=5} % This is a keyfigure. % \end{keyfigure} % \blindtext @@ -1936,6 +1939,32 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % +% \subsection{Patching \pkg{wrapfig}} +% +% A minor patch to allow \pkg{wrapfig} to expand its argument for the +% number of narrow lines. +% This allows it to be programmed by \pkg{keyfloat}. +% +% \cs{WF@wr} will not be defined if using \pkg{lwarp} with \HTML\ output. +% \changes{v2.04}{2021/06/08}{Patch \pkg{wrapfig}.} +% \begin{macrocode} +\RequirePackage{xpatch} + +\ifdef{\WF@wr} +{ + \xpatchcmd{\WF@wr} + {\gdef} + {\xdef} + {} + { + \PackageError{keyfloat} + {Unable to patch wrapfig \protect\WF@wr} + {Please inform the keyfloat author.} + } +} +{} +% \end{macrocode} + % \DescribePackage{gettitlestring} Used by \pkg{hyperref} and \pkg{nameref}. @@ -2372,6 +2401,20 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \end{macro} +% \DescribeKey[main]{wn} Set wrap number of narrow lines for a wrapped float. +% +% \changes{v2.04}{2021/06/08}{Added \optn{wn} key.} +% \begin{macrocode} +\define@key{KFLT@keys}{wn}{\renewcommand{\KFLT@wn}{#1}} +% \end{macrocode} +% +% \begin{macro}{\KFLT@wn} Storage for the wrap placement. +% \begin{macrocode} +\newcommand{\KFLT@wn}{} +% \end{macrocode} +% \end{macro} + + % \DescribeKey[main]{wp} Set wrap placement for a wrapped float. % % See \cref{tab:wrapplacement} on \cpageref{tab:wrapplacement}. @@ -2387,6 +2430,21 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % \end{macrocode} % \end{macro} + +% \DescribeKey[main]{wo} Set wrap overhang for a wrapped float. +% +% \changes{v2.04}{2021/06/08}{Added \optn{wo} key.} +% \begin{macrocode} +\define@key{KFLT@keys}{wo}{\renewcommand{\KFLT@wo}{#1}} +% \end{macrocode} +% +% \begin{macro}{\KFLT@wo} Storage for the wrap placement. +% \begin{macrocode} +\newcommand{\KFLT@wo}{\wrapoverhang} +% \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} @@ -3190,7 +3248,9 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% \setboolean{KFLT@ft}{false}% \renewcommand{\KFLT@stretch}{1}% \setlength{\KFLT@mo}{-1.2ex}% + \renewcommand{\KFLT@wn}{}% \renewcommand{\KFLT@wp}{O}% + \renewcommand{\KFLT@wo}{\wrapoverhang}% \renewcommand{\KFLT@wlw}{}% \setlength{\KFLT@ww}{0pt}% \renewcommand{\KFLT@va}{c}% @@ -3600,9 +3660,10 @@ Keywords={LaTeX, floats, key/val, subcaption, rows}% % 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}.} +% \changes{v2.04}{2021/06/08}{Added \optn{wn} and \optn{wo}.} % \begin{macrocode} \KFLT@findwidths% - \wrapfloat{\KFLT@type}{\KFLT@wp}% + \wrapfloat{\KFLT@type}[\KFLT@wn]{\KFLT@wp}[\KFLT@wo]% {\KFLT@wrapwidth+2\KFLTlooseframewidth}% \minipage{\KFLT@wrapwidth+2\KFLTlooseframewidth}% % \end{macrocode} diff --git a/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty b/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty index 8662890c5c0..1e4e559f6ef 100644 --- a/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty +++ b/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty @@ -18,7 +18,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{keyfloat} - [2021/05/28 v2.03 Key/value interface for floats and subfloats.] + [2021/06/08 v2.04 Key/value interface for floats and subfloats.] @@ -73,6 +73,22 @@ \RequirePackage{placeins} \RequirePackage{wrapfig} +\RequirePackage{xpatch} + +\ifdef{\WF@wr} +{ + \xpatchcmd{\WF@wr} + {\gdef} + {\xdef} + {} + { + \PackageError{keyfloat} + {Unable to patch wrapfig \protect\WF@wr} + {Please inform the keyfloat author.} + } +} +{} + \PassOptionsToPackage{expand}{gettitlestring} @@ -202,9 +218,15 @@ \define@key{KFLT@keys}{mo}{\setlength{\KFLT@mo}{#1}} \newlength{\KFLT@mo} +\define@key{KFLT@keys}{wn}{\renewcommand{\KFLT@wn}{#1}} +\newcommand{\KFLT@wn}{} + \define@key{KFLT@keys}{wp}{\renewcommand{\KFLT@wp}{#1}} \newcommand{\KFLT@wp}{O} +\define@key{KFLT@keys}{wo}{\renewcommand{\KFLT@wo}{#1}} +\newcommand{\KFLT@wo}{\wrapoverhang} + \define@key{KFLT@keys}{wlw}{% \renewcommand{\KFLT@wlw}{#1}% \setlength{\KFLT@ww}{0pt}% @@ -542,7 +564,9 @@ \setboolean{KFLT@ft}{false}% \renewcommand{\KFLT@stretch}{1}% \setlength{\KFLT@mo}{-1.2ex}% + \renewcommand{\KFLT@wn}{}% \renewcommand{\KFLT@wp}{O}% + \renewcommand{\KFLT@wo}{\wrapoverhang}% \renewcommand{\KFLT@wlw}{}% \setlength{\KFLT@ww}{0pt}% \renewcommand{\KFLT@va}{c}% @@ -708,7 +732,7 @@ \ifstrequal{#2}{W}% {% [W] \KFLT@findwidths% - \wrapfloat{\KFLT@type}{\KFLT@wp}% + \wrapfloat{\KFLT@type}[\KFLT@wn]{\KFLT@wp}[\KFLT@wo]% {\KFLT@wrapwidth+2\KFLTlooseframewidth}% \minipage{\KFLT@wrapwidth+2\KFLTlooseframewidth}% \hbadness=10000\relax% -- cgit v1.2.3