summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty131
1 files changed, 120 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty
index 4a1f1f193d7..15f121cb67e 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty
@@ -18,7 +18,26 @@
-\LWR@ProvidesPackageDrop{wrapfig2}[2021-12-21]
+
+\@ifpackageloaded{color}{}{%
+ \@ifpackageloaded{xcolor}{}{\LWR@origRequirePackage{xcolor}}%
+ }
+
+\RequirePackage{float}
+
+\IfPackageLoadedWithOptionsTF{wrapfig2}{WFold}
+{}% v4.0
+{% v5+
+ \floatstyle{plain}
+ \ifcsname chapter\endcsname
+ \newfloat{text}{tbp}{lotx}[chapter]
+ \else
+ \newfloat{text}{tbp}{lotx}
+ \fi
+ \floatname{text}{Text}
+}
+
+\LWR@ProvidesPackageDrop{wrapfig2}[2022-02-16]
\LWR@origRequirePackage{lwarp-wrapfig}
\RenewDocumentEnvironment{wrapfigure}{o m o G{0pt} s}% original
@@ -39,17 +58,107 @@
\endLWR@BlockClassWP%
\end{LWR@setvirtualpage}%
}
+\IfPackageLoadedWithOptionsTF{wrapfig2}{WFold}
+{% v4.0:
+ \NewDocumentEnvironment{wraptext}%
+ {O{l} D||{0.5\columnwidth} D<>{0} D(){figure}}%
+ {%
+ \wrapfloat{#4}[]{#1}[]{#2}%
+ \tcolorbox%
+ }
+ {%
+ \endtcolorbox%
+ \endwrapfloat%
+ \ignorespaces%
+ }
+}{}
-\NewDocumentEnvironment{wraptext}%
- {O{l} D||{0.5\columnwidth} D<>{0} D(){figure}}%
-{%
- \wrapfloat{#4}[]{#1}[]{#2}%
- \tcolorbox%
-}
-{%
- \endtcolorbox%
- \endwrapfloat%
- \ignorespaces%
+\IfPackageLoadedWithOptionsTF{wrapfig2}{WFfive}
+{% v5
+ \definecolor{WFbackground}{rgb}{0.95,0.95,0.95}
+ \definecolor{WFframe}{rgb}{0.1,0.1,0.1}
+ \colorlet{WFtext}{black}
+ \def\SetWFbgd#1{\colorlet{WFbackground}{#1}}
+ \def\SetWFfrm#1{\colorlet{WFframe}{#1}}
+ \def\SetWFtxt#1{\colorlet{WFtext}{#1}}
+ \def\WFsplitdimens#1,#2!{\fboxrule=#1\relax\fboxsep=#2\relax}
+
+ \NewDocumentEnvironment{wraptext}{O{0} m O{0pt} G{0.5\columnwidth}}
+ {%
+ \wrapfloat{text}[]{#2}[]{#4}%
+ }
+ {%
+ \endwrapfloat%
+ \ignorespaces%
+ }
+
+ \NewDocumentCommand\includeframedtext{O{\insertwidth} m O{1pt,1ex} o}%
+ {%
+ \WFsplitdimens #3!
+ \convertcolorspec{named}{WFtext}{HTML}\LWR@tempcolor%
+ \LWR@HTML@fcolorboxBlock%
+ [named]{WFframe}[named]{WFbackground}{#2}%
+ (%
+ color:\ \LWR@origpound\LWR@tempcolor ; %
+ border-radius:\ 1ex%
+ )%
+ }
+}{% v6+
+ \RequirePackage{xkeyval}
+
+ \definecolor{WFbackground}{rgb}{0.95,0.95,0.95}
+ \definecolor{WFframe}{rgb}{0.1,0.1,0.1}
+ \colorlet{WFtext}{black}
+ \def\SetWFbgd#1{\colorlet{WFbackground}{#1}}
+ \def\SetWFfrm#1{\colorlet{WFframe}{#1}}
+ \def\SetWFtxt#1{\colorlet{WFtext}{#1}}
+ \def\WFsplitdimens#1,#2!{\fboxrule=#1\relax\fboxsep=#2\relax}
+
+ \newlength{\LWR@wrapfigtwo@radius}
+ \setlength{\LWR@wrapfigtwo@radius}{1ex}
+
+ \DeclareOptionX<wraptext>{scalefactor}[0.8]{%
+ }
+ \DeclareOptionX<wraptext>{fboxrule}[1pt]{\fboxrule=#1}
+ \DeclareOptionX<wraptext>{fboxsep}[1ex]{\fboxsep=#1}
+ \DeclareOptionX<wraptext>{framecolor}[WFframe]{\SetWFfrm{#1}}
+ \DeclareOptionX<wraptext>{backgroundcolor}[WFbackground]{\SetWFbgd{#1}}
+ \DeclareOptionX<wraptext>{textcolor}[WFtext]{\SetWFtxt{#1}}
+ \DeclareOptionX<wraptext>{fontstyle}[\normalfont]{#1}
+ \DeclareOptionX<wraptext>{radius}[\fboxsep]{%
+ \setlength{\LWR@wrapfigtwo@radius}{#1}%
+ }
+ \DeclareOptionX<wraptext>{insertionwidth}[0.5\columnwidth]{%
+ }
+
+ \DeclareOptionX*{\PackageWarning{wrapfig2}{`\CurrentOption' ignored}}
+
+ \ExecuteOptionsX<wraptext>{scalefactor, fboxrule, fboxsep, framecolor,
+ backgroundcolor, textcolor, fontstyle, radius, insertionwidth}
+
+ \ProcessOptionsX*
+
+ \NewDocumentEnvironment{wraptext}{O{0} m O{0pt} G{0.5\columnwidth}}
+ {%
+ \wrapfloat{text}[]{#2}[]{#4}%
+ }
+ {%
+ \endwrapfloat%
+ \ignorespaces%
+ }
+
+ \NewDocumentCommand\includeframedtext{O{\insertwidth} m O{} o}
+ {%
+ \ExecuteOptionsX<wraptext>{#3}% executes possible key=value options
+ \convertcolorspec{named}{WFtext}{HTML}\LWR@tempcolor%
+ \LWR@HTML@fcolorboxBlock%
+ [named]{WFframe}[named]{WFbackground}%
+ {\LWR@textcurrentfont{#2}}%
+ (%
+ color:\ \LWR@origpound\LWR@tempcolor ; %
+ border-radius:\ \LWR@printlength{\LWR@wrapfigtwo@radius}%
+ )%
+ }
}
\endinput