| 1 |
%% |
| 2 |
%% This is file `lwarp-wrapfig2.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% lwarp.dtx (with options: `wrapfig2') |
| 8 |
%% This is a generated file. |
| 9 |
%% Copyright 2016-2026 Brian Dunn |
| 10 |
%% |
| 11 |
%% This work may be distributed and/or modified under the |
| 12 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 13 |
%% of this license or (at your option) any later version. |
| 14 |
%% The latest version of this license is in |
| 15 |
%% http://www.latex-project.org/lppl.txt |
| 16 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 17 |
%% version 2005/12/01 or later. |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
\@ifpackageloaded{color}{}{% |
| 23 |
\@ifpackageloaded{xcolor}{}{\LWR@origRequirePackage{xcolor}}% |
| 24 |
} |
| 25 |
|
| 26 |
\RequirePackage{float} |
| 27 |
|
| 28 |
\IfPackageLoadedWithOptionsTF{wrapfig2}{WFold} |
| 29 |
{}% v4.0 |
| 30 |
{% v5+ |
| 31 |
\floatstyle{plain} |
| 32 |
\ifcsname chapter\endcsname |
| 33 |
\newfloat{text}{tbp}{lotx}[chapter] |
| 34 |
\else |
| 35 |
\newfloat{text}{tbp}{lotx} |
| 36 |
\fi |
| 37 |
\floatname{text}{Text} |
| 38 |
} |
| 39 |
|
| 40 |
\LWR@ProvidesPackageDrop{wrapfig2}[2022-02-16] |
| 41 |
|
| 42 |
\LWR@origRequirePackage{lwarp-wrapfig} |
| 43 |
\RenewDocumentEnvironment{wrapfigure}{o m o G{0pt} s}% original |
| 44 |
{\wrapfloat{figure}[#1]{#2}[#3]{#4}}% |
| 45 |
{\endwrapfloat} |
| 46 |
|
| 47 |
\RenewDocumentEnvironment{wraptable}{o m o G{0pt} s}% original |
| 48 |
{\wrapfloat{table}[#1]{#2}[#3]{#4}}% |
| 49 |
{\endwrapfloat} |
| 50 |
|
| 51 |
\RenewDocumentEnvironment{wrapfloat}{m o m o G{0pt}}% lwarp |
| 52 |
{% |
| 53 |
\begin{LWR@setvirtualpage}*% |
| 54 |
\LWR@subwrapfigure{#3}{#5}% |
| 55 |
\renewcommand*{\@captype}{#1}% |
| 56 |
} |
| 57 |
{% |
| 58 |
\endLWR@BlockClassWP% |
| 59 |
\end{LWR@setvirtualpage}% |
| 60 |
} |
| 61 |
\IfPackageLoadedWithOptionsTF{wrapfig2}{WFold} |
| 62 |
{% v4.0: |
| 63 |
\NewDocumentEnvironment{wraptext}% |
| 64 |
{O{l} D||{0.5\columnwidth} D<>{0} D(){figure}}% |
| 65 |
{% |
| 66 |
\wrapfloat{#4}[]{#1}[]{#2}% |
| 67 |
\tcolorbox% |
| 68 |
} |
| 69 |
{% |
| 70 |
\endtcolorbox% |
| 71 |
\endwrapfloat% |
| 72 |
\ignorespaces% |
| 73 |
} |
| 74 |
}{} |
| 75 |
|
| 76 |
\IfPackageLoadedWithOptionsTF{wrapfig2}{WFfive} |
| 77 |
{% v5 |
| 78 |
\definecolor{WFbackground}{rgb}{0.95,0.95,0.95} |
| 79 |
\definecolor{WFframe}{rgb}{0.1,0.1,0.1} |
| 80 |
\colorlet{WFtext}{black} |
| 81 |
\def\SetWFbgd#1{\colorlet{WFbackground}{#1}} |
| 82 |
\def\SetWFfrm#1{\colorlet{WFframe}{#1}} |
| 83 |
\def\SetWFtxt#1{\colorlet{WFtext}{#1}} |
| 84 |
\def\WFsplitdimens#1,#2!{\fboxrule=#1\relax\fboxsep=#2\relax} |
| 85 |
|
| 86 |
\NewDocumentEnvironment{wraptext}{O{0} m O{0pt} G{0.5\columnwidth}} |
| 87 |
{% |
| 88 |
\wrapfloat{text}[]{#2}[]{#4}% |
| 89 |
} |
| 90 |
{% |
| 91 |
\endwrapfloat% |
| 92 |
\ignorespaces% |
| 93 |
} |
| 94 |
|
| 95 |
\NewDocumentCommand\includeframedtext{O{\insertwidth} m O{1pt,1ex} o}% |
| 96 |
{% |
| 97 |
\WFsplitdimens #3! |
| 98 |
\convertcolorspec{named}{WFtext}{HTML}\LWR@tempcolor% |
| 99 |
\LWR@HTML@fcolorboxBlock% |
| 100 |
[named]{WFframe}[named]{WFbackground}{#2}% |
| 101 |
(% |
| 102 |
color:\ \LWR@origpound\LWR@tempcolor ; % |
| 103 |
border-radius:\ 1ex% |
| 104 |
)% |
| 105 |
} |
| 106 |
}{% v6+ |
| 107 |
\RequirePackage{xkeyval} |
| 108 |
|
| 109 |
\definecolor{WFbackground}{rgb}{0.95,0.95,0.95} |
| 110 |
\definecolor{WFframe}{rgb}{0.1,0.1,0.1} |
| 111 |
\colorlet{WFtext}{black} |
| 112 |
\def\SetWFbgd#1{\colorlet{WFbackground}{#1}} |
| 113 |
\def\SetWFfrm#1{\colorlet{WFframe}{#1}} |
| 114 |
\def\SetWFtxt#1{\colorlet{WFtext}{#1}} |
| 115 |
\def\WFsplitdimens#1,#2!{\fboxrule=#1\relax\fboxsep=#2\relax} |
| 116 |
|
| 117 |
\newlength{\LWR@wrapfigtwo@radius} |
| 118 |
\setlength{\LWR@wrapfigtwo@radius}{1ex} |
| 119 |
|
| 120 |
\DeclareOptionX<wraptext>{scalefactor}[0.8]{% |
| 121 |
} |
| 122 |
\DeclareOptionX<wraptext>{fboxrule}[1pt]{\fboxrule=#1} |
| 123 |
\DeclareOptionX<wraptext>{fboxsep}[1ex]{\fboxsep=#1} |
| 124 |
\DeclareOptionX<wraptext>{framecolor}[WFframe]{\SetWFfrm{#1}} |
| 125 |
\DeclareOptionX<wraptext>{backgroundcolor}[WFbackground]{\SetWFbgd{#1}} |
| 126 |
\DeclareOptionX<wraptext>{textcolor}[WFtext]{\SetWFtxt{#1}} |
| 127 |
\DeclareOptionX<wraptext>{fontstyle}[\normalfont]{#1} |
| 128 |
\DeclareOptionX<wraptext>{radius}[\fboxsep]{% |
| 129 |
\setlength{\LWR@wrapfigtwo@radius}{#1}% |
| 130 |
} |
| 131 |
\DeclareOptionX<wraptext>{insertionwidth}[0.5\columnwidth]{% |
| 132 |
} |
| 133 |
|
| 134 |
\DeclareOptionX*{\PackageWarning{wrapfig2}{`\CurrentOption' ignored}} |
| 135 |
|
| 136 |
\ExecuteOptionsX<wraptext>{scalefactor, fboxrule, fboxsep, framecolor, |
| 137 |
backgroundcolor, textcolor, fontstyle, radius, insertionwidth} |
| 138 |
|
| 139 |
\ProcessOptionsX* |
| 140 |
|
| 141 |
\NewDocumentEnvironment{wraptext}{O{0} m O{0pt} G{0.5\columnwidth}} |
| 142 |
{% |
| 143 |
\wrapfloat{text}[]{#2}[]{#4}% |
| 144 |
} |
| 145 |
{% |
| 146 |
\endwrapfloat% |
| 147 |
\ignorespaces% |
| 148 |
} |
| 149 |
|
| 150 |
\NewDocumentCommand\includeframedtext{O{\insertwidth} m O{} o} |
| 151 |
{% |
| 152 |
\ExecuteOptionsX<wraptext>{#3}% executes possible key=value options |
| 153 |
\convertcolorspec{named}{WFtext}{HTML}\LWR@tempcolor% |
| 154 |
\LWR@HTML@fcolorboxBlock% |
| 155 |
[named]{WFframe}[named]{WFbackground}% |
| 156 |
{\LWR@textcurrentfont{#2}}% |
| 157 |
(% |
| 158 |
color:\ \LWR@origpound\LWR@tempcolor ; % |
| 159 |
border-radius:\ \LWR@printlength{\LWR@wrapfigtwo@radius}% |
| 160 |
)% |
| 161 |
} |
| 162 |
} |
| 163 |
|
| 164 |
\endinput |
| 165 |
%% |
| 166 |
%% End of file `lwarp-wrapfig2.sty'. |