diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty | 52 |
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} |