summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty244
1 files changed, 203 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
index 329de5bc815..2e379d53ac8 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
@@ -17,40 +17,115 @@
%% version 2005/12/01 or later.
-\LWR@ProvidesPackagePass{keyfloat}[2017/05/12]
+\LWR@ProvidesPackagePass{keyfloat}[2019/03/21]
+
+\@ifpackagelater{keyfloat}{2019/03/21}{}{
+ \PackageError{lwarp-keyfloat}
+ {%
+ The keyfloat package is out of date.\MessageBreak
+ Update to keyfloat v2.00 2019/03/21 or later%
+ }
+ {%
+ Please update the keyfloat package. It's worth it!%
+ }
+}
\AtBeginDocument{
-\RenewDocumentCommand{\KFLT@onefigureimage}{}
+\providecommand*{\KFLT@LWR@hook@boxouter}{}
+\renewcommand*{\KFLT@LWR@hook@boxouter}{%
+ \ifbool{KFLT@keywrap}{}{%
+ \ifnumequal{\value{KFLT@keyfloatdepth}}{0}{%
+ \setlength{\linewidth}{6in}%
+ \setlength{\textwidth}{6in}%
+ \setlength{\textheight}{9in}%
+ }{}%
+ }%
+}
+
+\let\KFLT@LWR@hook@boxouter@minipage\relax
+\let\endKFLT@LWR@hook@boxouter@minipage\relax
+\newenvironment*{KFLT@LWR@hook@boxouter@minipage}[2][]{}{}
+
+\providecommand*{\KFLT@LWR@hook@keysubfloats}{}
+\renewcommand*{\KFLT@LWR@hook@keysubfloats}{%
+ \ifbool{KFLT@keywrap}{}{%
+ \ifnumequal{\value{KFLT@keyfloatdepth}}{0}{%
+ \setlength{\linewidth}{6in}%
+ \setlength{\textwidth}{6in}%
+ \setlength{\textheight}{9in}%
+ }{}%
+ }%
+}
+
+\let\KFLT@LWR@hook@keyfloatsminipage\relax
+\let\endKFLT@LWR@hook@keyfloatsminipage\relax
+\newenvironment*{KFLT@LWR@hook@keyfloatsminipage}[1]{}{}
+
+\providecommand*{\KFLT@LWR@hook@keyfloats}{}
+\renewcommand*{\KFLT@LWR@hook@keyfloats}{%
+ \ifbool{KFLT@keywrap}{}{%
+ \ifnumequal{\value{KFLT@keyfloatdepth}}{0}{%
+ \setlength{\linewidth}{6in}%
+ \setlength{\textwidth}{6in}%
+ \setlength{\textheight}{9in}%
+ }{}%
+ }%
+}
+
+\renewcommand*{\KFLT@maybeendfloatrow}{%
+ \ifnumless{\value{KFLT@thiscol}}{\value{KFLT@numcols}}%
+ {}% thiscol < numcols
+ {% >=
+ \defcounter{KFLT@thiscol}{0}%
+ }%
+}%
+
+\renewcommand{\KFLT@trackrows}%
+{%
+ \ifboolexpr{%
+ test {\ifnumgreater{\value{KFLT@keyfloatdepth}}{0}} or%
+ bool{KFLT@inkeysubfloats}%
+ }%
+ {% nested
+ \KFLT@maybestartfloatrow%
+ \ifnumgreater{\value{KFLT@thiscol}}{1}%
+ {%
+ }%
+ {}%
+ }% nested
+ {}% not nested
+}
+\RenewDocumentCommand{\KFLT@onefigureimage}{m}
{%
\LWR@traceinfo{KFLT@onefigureimage}%
\ifthenelse{\NOT\equal{\KFLT@lw}{}}%
{%
- \includegraphics%
- [scale=\KFLT@s,width=\KFLT@imagewidth]{\KFLT@i}%
+ \KFLT@frame{\includegraphics%
+ [scale=\KFLT@s,width=\KFLT@imagewidth]{#1}}%
}%
{% not linewidth
\ifthenelse{\dimtest{\KFLT@w}{>}{0pt}}%
{% width is given
\ifthenelse{\dimtest{\KFLT@h}{>}{0pt}}%
{% w and h
- \includegraphics%
+ \KFLT@frame{\includegraphics%
[scale=\KFLT@s,%
- width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
+ width=\KFLT@imagewidth,height=\KFLT@h]{#1}}%
}% w and h
{% only w
- \includegraphics%
- [scale=\KFLT@s,width=\KFLT@imagewidth]{\KFLT@i}%
+ \KFLT@frame{\includegraphics%
+ [scale=\KFLT@s,width=\KFLT@imagewidth]{#1}}%
}% only w
}% width is given
{% width is not given
\ifthenelse{\dimtest{\KFLT@h}{>}{0pt}}%
{%
- \includegraphics%
- [scale=\KFLT@s,height=\KFLT@h]{\KFLT@i}%
+ \KFLT@frame{\includegraphics%
+ [scale=\KFLT@s,height=\KFLT@h]{#1}}%
}%
{%
- \includegraphics%
- [scale=\KFLT@s]{\KFLT@i}%
+ \KFLT@frame{\includegraphics%
+ [scale=\KFLT@s]{#1}}%
}%
}% width is not given
}% not linewidth
@@ -58,51 +133,138 @@
}
\RenewDocumentEnvironment{KFLT@boxinner}{}
{%
-\LWR@traceinfo{KFLT@boxinner}%
-\LWR@stoppars%
+ \LWR@traceinfo{KFLT@boxinner}%
+ \LWR@stoppars%
+ \minipagefullwidth%
+ \ifboolexpr{bool{KFLT@ft} or bool{KFLT@f}}{
+ \fminipage{\KFLT@imagewidth}%
+ }{%
+ \minipage{\KFLT@imagewidth}%
+ }%
}
-{
-\LWR@startpars%
-\LWR@traceinfo{KFLT@boxinner: done}%
+{%
+ \ifboolexpr{bool{KFLT@ft} or bool{KFLT@f}}{
+ \endfminipage%
+ }{%
+ \endminipage%
+ }%
+ \LWR@startpars%
+ \LWR@traceinfo{KFLT@boxinner: done}%
}
+\newcommand*{\LWR@KFLT@settextalign}[1]{%
+ \def\LWR@KFLT@textalign{justify}%
+ \ifcsstring{KFLT@#1textalign}{\centering}%
+ {\def\LWR@KFLT@textalign{center}}%
+ {}%
+ \ifcsstring{KFLT@#1textalign}{\raggedleft}%
+ {\def\LWR@KFLT@textalign{right}}%
+ {}%
+ \ifcsstring{KFLT@#1textalign}{\raggedright}%
+ {\def\LWR@KFLT@textalign{left}}%
+ {}%
+}
+
+\renewcommand{\KFLT@addtext}[1]
+{%
+ \ifcsempty{KFLT@#1t}%
+ {}% no text
+ {% text to add
+ {% local
+ \addvspace{\smallskipamount}%
+ \LWR@KFLT@settextalign{#1}%
+ \begin{BlockClass}[text-align:\LWR@KFLT@textalign]{floatnotes}%
+ \setlength{\parskip}{1.5ex}%
+ \setlength{\parindent}{0em}%
+ \csuse{KFLT@#1t}%
+ \end{BlockClass}%
+ }% local
+ }% text to add
+}
+
+\@ifpackageloaded{tocdata}
+{}
+{% tocdata not loaded
+
+ \newcommand*{\LWR@KFLT@setnamealign}[1]{%
+ \def\LWR@KFLT@textalign{justify}%
+ \ifstrequal{#1}{\centering}%
+ {\def\LWR@KFLT@textalign{center}}%
+ {}%
+ \ifstrequal{#1}{\raggedleft}%
+ {\def\LWR@KFLT@textalign{right}}%
+ {}%
+ \ifstrequal{#1}{\raggedright}%
+ {\def\LWR@KFLT@textalign{left}}%
+ {}%
+ }
+
+ \renewcommand*{\KFLT@@addartisttext}[3]{%
+ % \end{macrocode}
+ % Add space and create the name inside a full-width minipage:
+ % \begin{macrocode}
+ % \begin{minipage}{\linewidth}%
+ \LWR@KFLT@setnamealign{#3}%
+ \begin{BlockClass}[text-align:\LWR@KFLT@textalign]{floatnotes}%
+ % \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}
+ \footnotesize\textsc{%
+ \KFLT@optionalname{\csuse{KFLT@#1a#2p}}%
+ \KFLT@optionalname{\csuse{KFLT@#1a#2f}}%
+ \csuse{KFLT@#1a#2l}%
+ \csuse{KFLT@#1a#2s}%
+ }%
+ % \end{minipage}%
+ \end{BlockClass}
+ }
+
+}% tocdata not loaded
+
\DeclareDocumentEnvironment{KFLT@marginfloat}{O{-1.2ex} m}
{%
-\LWR@BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}%
-\captionsetup{type=#2}%
+ \LWR@BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}%
+ \captionsetup{type=#2}%
+ \minipage{2in}%
}
{%
-\endLWR@BlockClassWP%
+ \endminipage%
+ \endLWR@BlockClassWP%
}
\DeclareDocumentEnvironment{marginfigure}{o}
- {\begin{KFLT@marginfloat}{figure}}
- {\end{KFLT@marginfloat}}
+ {\begin{KFLT@marginfloat}{figure}}
+ {\end{KFLT@marginfloat}}
\DeclareDocumentEnvironment{margintable}{o}
- {\begin{KFLT@marginfloat}{table}}
- {\end{KFLT@marginfloat}}
+ {\begin{KFLT@marginfloat}{table}}
+ {\end{KFLT@marginfloat}}
\DeclareDocumentEnvironment{keywrap}{m +m}
{%
-\LWR@ensuredoingapar%
-\setlength{\LWR@templengthone}{#1}%
-\begin{LWR@BlockClassWP}{%
- float:right; width:\LWR@printlength{\LWR@templengthone}; % extra space
- margin:10pt%
-}%
-{%
- width:\LWR@printlength{\LWR@templengthone}%
-}%
-{marginblock}%
-\setlength{\linewidth}{.95\LWR@templengthone}%
-#2%
-\end{LWR@BlockClassWP}%
-}
-{%
+ \LWR@ensuredoingapar%
+ \setlength{\linewidth}{6in}%
+ \setlength{\LWR@templengthone}{#1}%
+ \begin{LWR@BlockClassWP}%
+ {%
+ float:right; width:\LWR@printlength{\LWR@templengthone}; % extra space
+ margin:10pt%
+ }%
+ {%
+ width:\LWR@printlength{\LWR@templengthone}%
+ }%
+ {marginblock}%
+ \setlength{\linewidth}{.95\LWR@templengthone}%
+ \booltrue{KFLT@keywrap}%
+ #2%
+ \end{LWR@BlockClassWP}%
}
-
-
+{}
}% AtBeginDocument
\endinput