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.sty41
1 files changed, 34 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
index 86e466408e4..20124144cfa 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
@@ -6,7 +6,7 @@
%%
%% lwarp.dtx (with options: `keyfloat')
%% This is a generated file.
-%% Copyright 2016-2017 Brian Dunn
+%% Copyright 2016-2018 Brian Dunn
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -20,15 +20,42 @@
\LWR@ProvidesPackagePass{keyfloat}
\AtBeginDocument{
-
-\let\KFLT@boxinner\relax
-\let\endKFLT@boxinner\relax
-
-\NewEnviron{KFLT@boxinner}
+\RenewDocumentCommand{\KFLT@onefigureimage}{}
+{%
+\LWR@traceinfo{KFLT@onefigureimage}%
+\ifthenelse{\NOT\equal{\KFLT@lw}{}}%
+{\includegraphics%
+[scale=\KFLT@s,width=\KFLT@imagewidth]{\KFLT@i}}%
+{% not linewidth
+\ifthenelse{\dimtest{\KFLT@w}{>}{0pt}}%
+{% width is given
+\ifthenelse{\dimtest{\KFLT@h}{>}{0pt}}%
+{% w and h
+\includegraphics%
+[scale=\KFLT@s,%
+width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
+}% w and h
+{% only w
+\includegraphics%
+[scale=\KFLT@s,width=\KFLT@imagewidth]{\KFLT@i}%
+}% only w
+}% width is given
+{% width is not given
+\ifthenelse{\dimtest{\KFLT@h}{>}{0pt}}%
+{\includegraphics%
+[scale=\KFLT@s,height=\KFLT@h]{\KFLT@i}}%
+{\includegraphics%
+[scale=\KFLT@s]{\KFLT@i}}%
+}% width is not given
+}% not linewidth
+\LWR@traceinfo{KFLT@onefigureimage: done}%
+}
+\RenewDocumentEnvironment{KFLT@boxinner}{}
{%
\LWR@traceinfo{KFLT@boxinner}%
\LWR@stoppars%
-\KFLT@frame{\BODY}%
+}
+{
\LWR@startpars%
\LWR@traceinfo{KFLT@boxinner: done}%
}