| 1 |
%% |
| 2 |
%% This is file `lwarp-mdframed.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% lwarp.dtx (with options: `mdframed') |
| 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 |
\RequirePackage{xcolor}% for \convertcolorspec |
| 21 |
|
| 22 |
\LWR@ProvidesPackageDrop{mdframed}[2013/07/01] |
| 23 |
\LWR@origRequirePackage[framemethod=none]{mdframed} |
| 24 |
\AtBeginDocument{ |
| 25 |
\def\mdf@trivlist#1{% |
| 26 |
\edef\mdf@temp{% |
| 27 |
}% |
| 28 |
\let\@itemlabel\@empty% |
| 29 |
\def\makelabel##1{##1}% |
| 30 |
} |
| 31 |
|
| 32 |
\renewcommand*{\endmdf@trivlist}{% |
| 33 |
\LWR@traceinfo{endmdf@trivlist}% |
| 34 |
\LWR@listend% |
| 35 |
} |
| 36 |
}% AtBeginDocument |
| 37 |
\mdfsetup{ |
| 38 |
startcode={\LWR@mdframedstart\LWR@print@raggedright}, |
| 39 |
endcode={\LWR@mdframedend}, |
| 40 |
startinnercode={\LWR@startpars\LWR@print@raggedright}, |
| 41 |
endinnercode={\LWR@stoppars}, |
| 42 |
} |
| 43 |
\newcommand*{\LWR@mdfprintcolor}[1]{% |
| 44 |
\convertcolorspec{named}{\@nameuse{mdf@#1}}{HTML}\LWR@tempcolor% |
| 45 |
\LWR@origpound\LWR@tempcolor |
| 46 |
} |
| 47 |
|
| 48 |
\newcommand*{\LWR@mdfprintlength}[1]{% |
| 49 |
\LWR@forceminwidth{\@nameuse{mdf@#1@length}}% |
| 50 |
\LWR@printlength{\LWR@atleastonept}% |
| 51 |
} |
| 52 |
\newcommand*{\LWR@mdframedstart}{% |
| 53 |
\LWR@traceinfo{LWR@mdframedstart start}% |
| 54 |
\LWR@spanwarninvalid{mdframe}% |
| 55 |
\LWR@stoppars% |
| 56 |
\LWR@htmltagc{div class=\textquotedbl% |
| 57 |
mdframed% |
| 58 |
\ifdefstring{\LWR@mdthisenv}{mdframed}{}{ \LWR@mdthisenv}% |
| 59 |
\textquotedbl \LWR@orignewline |
| 60 |
style=\textquotedbl\LWR@orignewline |
| 61 |
background: \LWR@mdfprintcolor{backgroundcolor} ; \LWR@orignewline |
| 62 |
border: \LWR@mdfprintlength{linewidth} solid |
| 63 |
\LWR@mdfprintcolor{linecolor} ; \LWR@orignewline |
| 64 |
border-radius: \LWR@mdfprintlength{roundcorner} ; \LWR@orignewline |
| 65 |
\ifbool{mdf@shadow}{% |
| 66 |
box-shadow: |
| 67 |
\LWR@mdfprintlength{shadowsize} |
| 68 |
\LWR@mdfprintlength{shadowsize} |
| 69 |
\LWR@mdfprintlength{shadowsize} |
| 70 |
\LWR@mdfprintcolor{shadowcolor} ; |
| 71 |
} |
| 72 |
{box-shadow: none ;} |
| 73 |
\LWR@orignewline |
| 74 |
\textquotedbl} |
| 75 |
\let\hspace\LWR@print@hspace% |
| 76 |
\renewcommand*{\rule}{\LWR@print@rule} |
| 77 |
\LetLtxMacro\makebox\LWR@print@makebox% |
| 78 |
\LWR@startpars% |
| 79 |
\LWR@traceinfo{LWR@mdframedstart done}% |
| 80 |
} |
| 81 |
\newcommand*{\LWR@mdframedend}{ |
| 82 |
\LWR@traceinfo{LWR@mdframedend start}% |
| 83 |
\LWR@htmldivclassend{\LWR@mdthisenv} |
| 84 |
\gdef\LWR@mdthisenv{mdframed} |
| 85 |
\LWR@startpars% |
| 86 |
\LWR@traceinfo{LWR@mdframedend done}% |
| 87 |
} |
| 88 |
\renewenvironment{mdframed}[1][]{% |
| 89 |
\color@begingroup% |
| 90 |
\mdfsetup{userdefinedwidth=\linewidth,#1}% |
| 91 |
\mdf@startcode% |
| 92 |
\mdf@preenvsetting% |
| 93 |
\ifdefempty{\mdf@firstframetitle}{}% |
| 94 |
{\let\mdf@frametitlesave\mdf@frametitle% |
| 95 |
\let\mdf@frametitle\mdf@firstframetitle% |
| 96 |
}% |
| 97 |
\ifvmode\nointerlineskip\fi% |
| 98 |
\ifdefempty{\mdf@frametitle}{}% |
| 99 |
{\mdfframedtitleenv{\mdf@frametitle}% |
| 100 |
}% |
| 101 |
\mdf@trivlist{\mdf@skipabove@length}%% |
| 102 |
\mdf@settings% |
| 103 |
}% |
| 104 |
{% |
| 105 |
\par% |
| 106 |
\ifmdf@footnoteinside% |
| 107 |
\def\mdf@reserveda{% |
| 108 |
\mdf@footnoteoutput% |
| 109 |
}% |
| 110 |
\else% |
| 111 |
\def\mdf@reserveda{% |
| 112 |
\mdf@footnoteoutput% |
| 113 |
}% |
| 114 |
\fi% |
| 115 |
\mdf@reserveda% |
| 116 |
\aftergroup\endmdf@trivlist% |
| 117 |
\color@endgroup% |
| 118 |
\mdf@endcode% |
| 119 |
} |
| 120 |
\renewrobustcmd*\mdf@footnoteoutput{% |
| 121 |
\LWR@printpendingmpfootnotes% |
| 122 |
} |
| 123 |
\newlength{\LWR@titleroundcorner} |
| 124 |
|
| 125 |
\renewrobustcmd\mdfframedtitleenv[1]{% |
| 126 |
\LWR@traceinfo{LWR@mdframedtitleenv start}% |
| 127 |
\begin{BlockClass}[% |
| 128 |
background: |
| 129 |
\LWR@mdfprintcolor{frametitlebackgroundcolor} |
| 130 |
; \LWR@orignewline |
| 131 |
\ifbool{mdf@frametitlerule}{% |
| 132 |
border-bottom: |
| 133 |
\LWR@mdfprintlength{frametitlerulewidth} |
| 134 |
solid |
| 135 |
\LWR@mdfprintcolor{frametitlerulecolor} |
| 136 |
; \LWR@orignewline |
| 137 |
}{}% |
| 138 |
]{mdframedtitle}% |
| 139 |
\mdf@frametitlefont{\LWR@textcurrentfont{#1}}% |
| 140 |
\end{BlockClass}% |
| 141 |
\LWR@traceinfo{LWR@mdframedtitleenv end}% |
| 142 |
} |
| 143 |
\NewDocumentCommand{\LWR@mdfsubtitlecommon}{m o m} |
| 144 |
{% the following empty line is required |
| 145 |
|
| 146 |
\LWR@traceinfo{LWR@mdframedsubtitlecommon start}% |
| 147 |
\begin{BlockClass}[% |
| 148 |
background: |
| 149 |
\LWR@mdfprintcolor{#1titlebackgroundcolor} |
| 150 |
; \LWR@orignewline |
| 151 |
\ifbool{mdf@#1titleaboveline}{% |
| 152 |
border-top: |
| 153 |
\LWR@mdfprintlength{#1titleabovelinewidth} |
| 154 |
solid |
| 155 |
\LWR@mdfprintcolor{#1titleabovelinecolor} |
| 156 |
; \LWR@orignewline |
| 157 |
}{}% |
| 158 |
\ifbool{mdf@#1titlebelowline}{% |
| 159 |
border-bottom: |
| 160 |
\LWR@mdfprintlength{#1titlebelowlinewidth} |
| 161 |
solid |
| 162 |
\LWR@mdfprintcolor{#1titlebelowlinecolor} |
| 163 |
; \LWR@orignewline |
| 164 |
}{}% |
| 165 |
]{mdframed#1title}% |
| 166 |
\IfNoValueTF{#2} |
| 167 |
{\@nameuse{LWR@origmdf#1title}{\csuse{mdf@#1titlefont}{\LWR@textcurrentfont{#3}}}}% |
| 168 |
{\@nameuse{LWR@origmdf#1title}[#2]{\csuse{mdf@#1titlefont}{\LWR@textcurrentfont{#3}}}}% |
| 169 |
\end{BlockClass}% |
| 170 |
\LWR@traceinfo{LWR@mdframedsubtitlecommon end}% |
| 171 |
} |
| 172 |
\newcommand*{\LWR@mdfsubtitle}{% |
| 173 |
\LWR@mdfsubtitlecommon{sub}% |
| 174 |
} |
| 175 |
\let\mdfsubtitle\LWR@mdfsubtitle |
| 176 |
\newcommand*{\LWR@mdfsubsubtitle}{% |
| 177 |
\LWR@mdfsubtitlecommon{subsub}% |
| 178 |
} |
| 179 |
\let\mdfsubsubtitle\LWR@mdfsubsubtitle |
| 180 |
\newcommand*{\LWR@mdthisenv}{mdframed} |
| 181 |
\renewrobustcmd*\newmdenv[2][]{% |
| 182 |
\newenvironment{#2}% |
| 183 |
{% |
| 184 |
\mdfsetup{#1}% |
| 185 |
\renewcommand*{\LWR@mdthisenv}{md#2}% |
| 186 |
\begin{mdframed}% |
| 187 |
} |
| 188 |
{\end{mdframed}}% |
| 189 |
} |
| 190 |
\renewrobustcmd*{\surroundwithmdframed}[2][]{% |
| 191 |
\BeforeBeginEnvironment{#2}{% |
| 192 |
\renewcommand*{\LWR@mdthisenv}{md#2}% |
| 193 |
\begin{mdframed}[#1]}% |
| 194 |
\AfterEndEnvironment{#2}{\end{mdframed}}% |
| 195 |
} |
| 196 |
\DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }% |
| 197 |
{\ifcsdef{#2}% |
| 198 |
{\mdf@PackageWarning{Environment #2 already exits\MessageBreak}}% |
| 199 |
{% |
| 200 |
\IfNoValueTF {#3}% |
| 201 |
{%#3 not given -- number relationship |
| 202 |
\IfNoValueTF {#5}% |
| 203 |
{%#3+#5 not given |
| 204 |
\@definecounter{#2}% |
| 205 |
\expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}% |
| 206 |
\newenvironment{#2}[1][]{% |
| 207 |
\refstepcounter{#2}% |
| 208 |
\ifstrempty{##1}% |
| 209 |
{\let\@temptitle\relax}% |
| 210 |
{% |
| 211 |
\def\@temptitle{\mdf@theoremseparator% |
| 212 |
\mdf@theoremspace% |
| 213 |
\mdf@theoremtitlefont% |
| 214 |
\LWR@textcurrentfont{##1}}% lwarp |
| 215 |
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% |
| 216 |
}% |
| 217 |
\begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% |
| 218 |
\@temptitle}]}% |
| 219 |
{\end{mdframed}}% |
| 220 |
\newenvironment{#2*}[1][]{% |
| 221 |
\ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}% |
| 222 |
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% |
| 223 |
{\end{mdframed}}% |
| 224 |
}% |
| 225 |
{%#5 given -- reset counter |
| 226 |
\@definecounter{#2}\@newctr{#2}[#5]% |
| 227 |
\expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}% |
| 228 |
\expandafter\xdef\csname the#2\endcsname{% |
| 229 |
\expandafter\noexpand\csname the#5\endcsname \@thmcountersep% |
| 230 |
\@thmcounter{#2}}% |
| 231 |
\newenvironment{#2}[1][]{% |
| 232 |
\refstepcounter{#2}% |
| 233 |
\ifstrempty{##1}% |
| 234 |
{\let\@temptitle\relax}% |
| 235 |
{% |
| 236 |
\def\@temptitle{\mdf@theoremseparator% |
| 237 |
\mdf@theoremspace% |
| 238 |
\mdf@theoremtitlefont% |
| 239 |
\LWR@textcurrentfont{##1}}% lwarp |
| 240 |
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% |
| 241 |
} |
| 242 |
\begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% |
| 243 |
\@temptitle}]}% |
| 244 |
{\end{mdframed}}% |
| 245 |
\newenvironment{#2*}[1][]{% |
| 246 |
\ifstrempty{##1}% |
| 247 |
{\let\@temptitle\relax}% |
| 248 |
{% |
| 249 |
\def\@temptitle{\mdf@theoremseparator% |
| 250 |
\mdf@theoremspace% |
| 251 |
\mdf@theoremtitlefont% |
| 252 |
\LWR@textcurrentfont{##1}}% lwarp |
| 253 |
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% |
| 254 |
}% |
| 255 |
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% |
| 256 |
{\end{mdframed}}% |
| 257 |
}% |
| 258 |
}% |
| 259 |
{%#3 given -- number relationship |
| 260 |
\global\@namedef{the#2}{\@nameuse{the#3}}% |
| 261 |
\newenvironment{#2}[1][]{% |
| 262 |
\refstepcounter{#3}% |
| 263 |
\ifstrempty{##1}% |
| 264 |
{\let\@temptitle\relax}% |
| 265 |
{% |
| 266 |
\def\@temptitle{\mdf@theoremseparator% |
| 267 |
\mdf@theoremspace% |
| 268 |
\mdf@theoremtitlefont% |
| 269 |
\LWR@textcurrentfont{##1}}% lwarp |
| 270 |
\mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% |
| 271 |
} |
| 272 |
\begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% |
| 273 |
\@temptitle}]}% |
| 274 |
{\end{mdframed}}% |
| 275 |
\newenvironment{#2*}[1][]{% |
| 276 |
\ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}% |
| 277 |
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% |
| 278 |
{\end{mdframed}}% |
| 279 |
}% |
| 280 |
\BeforeBeginEnvironment{#2}{\renewcommand*{\LWR@mdthisenv}{md#2}}% lwarp |
| 281 |
\BeforeBeginEnvironment{#2*}{\renewcommand*{\LWR@mdthisenv}{md#2}}% lwarp |
| 282 |
}% |
| 283 |
} |
| 284 |
\DeclareDocumentCommand\newmdtheoremenv{O{} m o m o }{% |
| 285 |
\ifboolexpr{ test {\IfNoValueTF {#3}} and test {\IfNoValueTF {#5}} }% |
| 286 |
{\newtheorem{#2}{#4}}% |
| 287 |
{% |
| 288 |
\IfValueT{#3}{\newtheorem{#2}[#3]{#4}}% |
| 289 |
\IfValueT{#5}{\newtheorem{#2}{#4}[#5]}% |
| 290 |
}% |
| 291 |
\BeforeBeginEnvironment{#2}{% |
| 292 |
\renewcommand*{\LWR@mdthisenv}{md#2}% |
| 293 |
\begin{mdframed}[#1]}% |
| 294 |
\AfterEndEnvironment{#2}{% |
| 295 |
\end{mdframed}}% |
| 296 |
} |
| 297 |
|
| 298 |
|
| 299 |
\endinput |
| 300 |
%% |
| 301 |
%% End of file `lwarp-mdframed.sty'. |