summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-05-29 20:25:11 +0000
committerKarl Berry <karl@freefriends.org>2021-05-29 20:25:11 +0000
commita8029f11221860bf15a745fbc04869def0221f4d (patch)
tree612b469ef1211e1f4351fbb4639aa3ea7a512b10 /Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty
parent70af71c72e5d0a76f8adf71fb52c6e16261e77c6 (diff)
lwarp (29may21)
git-svn-id: svn://tug.org/texlive/trunk@59390 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty52
1 files changed, 34 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty
index b1f4c17acfd..e4213c168d6 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty
@@ -21,25 +21,41 @@
\LWR@ProvidesPackageDrop{wrapfig}[2003/01/31]
\newcommand*{\LWR@wrapposition}{}
+\newcommand{\LWR@wrapfig@printHTMLwidth}{width:\LWR@printlength{\LWR@templengthone}}
+
+\AtBeginDocument{
+ \@ifpackageloaded{keyfloat}{
+ \renewcommand{\LWR@wrapfig@printHTMLwidth}{%
+ \ifboolexpr{
+ test {\ifnumgreater{\value{KFLT@keyfloatdepth}}{0}} or
+ bool {KFLT@inkeysubfloats}
+ }%
+ {\LWR@printpercentlength{\LWR@templengthone}{\linewidth}\%; }%
+ {\LWR@printlength{\LWR@templengthone}}%
+ }%
+ }{}
+}
+
\newcommand*{\LWR@subwrapfigure}[2]{%
-\renewcommand*{\LWR@wrapposition}{}%
-\ifthenelse{%
- \equal{#1}{r}\OR\equal{#1}{R}\OR%
- \equal{#1}{o}\OR\equal{#1}{O}%
-}%
- {\renewcommand*{\LWR@wrapposition}{float:right}}%
- {\renewcommand*{\LWR@wrapposition}{float:left}}%
-\setlength{\LWR@templengthone}{#2}%
-\LWR@BlockClassWP{%
- width:\LWR@printlength{\LWR@templengthone}; \LWR@wrapposition; %
- margin:10pt%
-}%
-{%
- width:\LWR@printlength{\LWR@templengthone}; \LWR@wrapposition; %
-}%
-(note)%
-{marginblock}%
-\setlength{\linewidth}{\LWR@templengthone}%
+ \renewcommand*{\LWR@wrapposition}{}%
+ \ifthenelse{%
+ \equal{#1}{r}\OR\equal{#1}{R}\OR%
+ \equal{#1}{o}\OR\equal{#1}{O}%
+ }%
+ {\renewcommand*{\LWR@wrapposition}{float:right}}%
+ {\renewcommand*{\LWR@wrapposition}{float:left}}%
+ \setlength{\LWR@templengthone}{#2}%
+ \LWR@BlockClassWP{%
+ width:\LWR@printlength{\LWR@templengthone}; \LWR@wrapposition; %
+ margin:10pt%
+ }%
+ {%
+ width:\LWR@wrapfig@printHTMLwidth; %
+ \LWR@wrapposition; %
+ }%
+ (note)%
+ {marginblock}%
+ \setlength{\linewidth}{\LWR@templengthone}%
}
\NewDocumentEnvironment{wrapfigure}{o m o m}