summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/keyfloat
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-12 22:00:38 +0000
committerKarl Berry <karl@freefriends.org>2017-05-12 22:00:38 +0000
commit0f3f6bc2e482d3999fec92653eb1305308170254 (patch)
treefbe6f7fbe70c9c90d01c05ed481a1500c22d96e5 /Master/texmf-dist/tex/latex/keyfloat
parent778ba561199969808c132ea6968f1202ec315e4c (diff)
keyfloat (12may17)
git-svn-id: svn://tug.org/texlive/trunk@44306 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/keyfloat')
-rw-r--r--Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty82
1 files changed, 72 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty b/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty
index bfb62f07a9b..b3a4d566d6c 100644
--- a/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty
+++ b/Master/texmf-dist/tex/latex/keyfloat/keyfloat.sty
@@ -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 @@ provide similar functionality to floatrow.}
\newlength{\KFLT@rowboxwidth}
-\newboolean{KFLT@cont}{}
+\newboolean{KFLT@cont}
\define@key{KFLT@keys}{cont}[true]{\setboolean{KFLT@cont}{#1}}
\newcommand{\KFLT@c}{}
\newboolean{KFLT@cstar}
@@ -157,6 +156,9 @@ provide similar functionality to floatrow.}
\define@key{KFLT@keys}{wp}{\renewcommand{\KFLT@wp}{#1}}
\newcommand{\KFLT@wp}{O}
+\define@key{KFLT@keys}{va}{\renewcommand{\KFLT@va}{#1}}
+\newcommand{\KFLT@va}{c}
+
\newcounter{KFLT@keyfloatdepth}
\setcounter{KFLT@keyfloatdepth}{0}
@@ -448,6 +450,7 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
\renewcommand{\KFLT@stretch}{1}%
\setlength{\KFLT@mo}{-1.2ex}%
\renewcommand{\KFLT@wp}{O}%
+\renewcommand{\KFLT@va}{c}%
}
@@ -574,10 +577,19 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
{% not subfloat:
\ifthenelse{\cnttest{\value{KFLT@keyfloatdepth}}>{0}}%
{% keyfloats
-\minipage{\KFLT@rowboxwidth}%
+\ifbool{KFLT@keywrap}
+{\minipage[t]{\KFLT@rowboxwidth}}%
+{\minipage[\KFLT@va]{\KFLT@rowboxwidth}}%
\captionsetup*{type=\KFLT@type}%
}% keyfloats
{% not keyfloats
+\ifbool{KFLT@keywrap}%
+{%
+\par\addvspace{\baselineskip}%
+\noindent\minipage[t]{\linewidth}%
+\captionsetup{type=\KFLT@type}%
+}%
+{% not a keywrap
\ifthenelse{\equal{#2}{W}}%
{% [W]
\KFLT@findwidths%
@@ -596,7 +608,7 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
\ifthenelse{\equal{#2}{H}}%
{% [H]
\par\addvspace{\baselineskip}%
-\noindent\minipage{\linewidth}%
+\noindent\minipage[\KFLT@va]{\linewidth}%
\captionsetup{type=\KFLT@type}%
}% [H]
{% not [H]
@@ -605,6 +617,7 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
}% not [H]
}% not [M]
}% not [W]
+}% not keywrap
}% not keyfloats
}% not subfloat
\ifthenelse{\boolean{KFLT@cont}}{\ContinuedFloat}{}%
@@ -624,6 +637,11 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
\ifthenelse{\cnttest{\value{KFLT@keyfloatdepth}}>{0}}% keyfloats?
{\endminipage}% keyfloats
{% not keyfloats
+\ifbool{KFLT@keywrap}{%
+\endminipage%
+\par\addvspace{\baselineskip}%
+}
+{% not keywrap
\ifthenelse{\equal{#2}{W}}%
{% [W]
\csname endwrap\KFLT@type\endcsname%
@@ -645,6 +663,7 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
}% not [H]
}% not [M]
}% not [W]
+}% not keywrap
}% not keyfloats
}% not subfloat
}% endkeyboxouter
@@ -763,6 +782,7 @@ environment inside another, or inside a keyfloats.}%
\equal{#2}{H}%
\OR\cnttest{\value{KFLT@keyfloatdepth}}>{1}%
\OR\boolean{KFLT@inkeysubfloats}%
+\OR\boolean{KFLT@keywrap}%
}%
{% [H] or nested
\ifthenelse{%
@@ -770,7 +790,8 @@ environment inside another, or inside a keyfloats.}%
\OR\boolean{KFLT@inkeysubfloats}%
}%
{\noindent%
-\begin{minipage}{\KFLT@rowboxwidth}}%
+\begin{minipage}{\KFLT@rowboxwidth}%
+}%
{\bigbreak%
\noindent\begin{minipage}{\linewidth}}%
\ifthenelse{\boolean{KFLT@inkeysubfloats}}%
@@ -795,9 +816,13 @@ environment inside another, or inside a keyfloats.}%
\equal{#2}{H}%
\OR\cnttest{\value{KFLT@keyfloatdepth}}>{1}%
\OR\boolean{KFLT@inkeysubfloats}%
+\OR\boolean{KFLT@keywrap}%
}%
{\end{minipage}%
-\ifthenelse{\cnttest{\value{KFLT@keyfloatdepth}}>{0}}%
+\ifthenelse{%
+\cnttest{\value{KFLT@keyfloatdepth}}>{0}%
+\OR\boolean{KFLT@keywrap}%
+}%
{}{\bigbreak}%
}% was [H]
{% not [H]
@@ -842,7 +867,10 @@ environment inside another, or inside a keyfloats.}%
\IfBooleanTF{#1}%
{\setlength{\KFLT@rowboxwidth}{.9\textwidth/\real{#3}}}%
{\setlength{\KFLT@rowboxwidth}{.9\linewidth/\real{#3}}}%
-\ifthenelse{\equal{#2}{H}}%
+\ifthenelse{%
+\equal{#2}{H}%
+\OR\boolean{KFLT@keywrap}%
+}%
{%
\bigbreak\noindent\begin{minipage}{\linewidth}%
}%
@@ -865,7 +893,10 @@ environment inside another, or inside a keyfloats.}%
\par\addvspace{\bigskipamount}%
\KFLT@addartisttext{subgrp}%
\KFLT@captioniftype{figure}{subgrp}%
-\ifthenelse{\equal{#2}{H}}%
+\ifthenelse{%
+\equal{#2}{H}%
+\OR\boolean{KFLT@keywrap}%
+}%
{\end{minipage}\bigbreak}% was [H]
{% not [H]:
\IfBooleanTF{#1}% starred?
@@ -915,8 +946,39 @@ environment inside another, or inside a keyfloats.}%
\ProvideDocumentEnvironment{margintable}{O{-1.2ex}}
{\begin{KFLT@marginfloat}[#1]{table}}
{\end{KFLT@marginfloat}}
+\newboolean{KFLT@keywrap}
+\boolfalse{KFLT@keywrap}
+\newlength{\KFLT@keywrapwidth}
+\newlength{\KFLT@keywrapparskip}
+\newlength{\KFLT@keywrapparindent}
+\DeclareDocumentEnvironment{keywrap}{m +m}
+{%
+\par%
+\setlength{\KFLT@keywrapwidth}{\linewidth}%
+\addtolength{\KFLT@keywrapwidth}{-#1}%
+\addtolength{\KFLT@keywrapwidth}{-2em}%
+\minipage[t]{\KFLT@keywrapwidth}%
+\setlength{\parskip}{\KFLT@keywrapparskip}%
+\setlength{\parindent}{\KFLT@keywrapparindent}%
+\booltrue{KFLT@keywrap}%
+}
+{%
+\par
+\endminipage%
+\hfill%
+\begin{minipage}[t]{#1}%
+\booltrue{KFLT@keywrap}%
+#2%
+\par
+\unskip\vspace{\smallskipamount}
+\end{minipage}%
+\par
+}
-
+\BeforeBeginEnvironment{keywrap}{
+\setlength{\KFLT@keywrapparskip}{\parskip}
+\setlength{\KFLT@keywrapparindent}{\parindent}
+}
\endinput
%%
%% End of file `keyfloat.sty'.