| 1 |
%% |
| 2 |
%% This is file `lwarp-amsthm.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% lwarp.dtx (with options: `amsthm') |
| 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 |
\IfPackageLoadedTF{mdframed}{ |
| 21 |
\PackageError{lwarp} |
| 22 |
{% |
| 23 |
Package mdframed must be loaded after package amsthm.\MessageBreak |
| 24 |
Enter 'H' for solutions% |
| 25 |
} |
| 26 |
{% |
| 27 |
Move ``\protect\usepackage{amsthm}'' before |
| 28 |
``\protect\usepackage{mdframed}''.\MessageBreak |
| 29 |
Package amsthm may be loaded by something else,\MessageBreak |
| 30 |
which must also be moved before mdframed.% |
| 31 |
} |
| 32 |
} |
| 33 |
{\relax} |
| 34 |
\RequirePackage{amsmath} |
| 35 |
\LWR@ProvidesPackagePass{amsthm}[2017/10/31] |
| 36 |
\newcommand{\LWR@newtheoremstyle}{plain} |
| 37 |
|
| 38 |
\renewcommand{\theoremstyle}[1]{% |
| 39 |
\@ifundefined{th@#1}{% |
| 40 |
\PackageWarning{amsthm}{Unknown theoremstyle `#1'}% |
| 41 |
\thm@style{plain}% |
| 42 |
\renewcommand{\LWR@newtheoremstyle}{plain}% lwarp |
| 43 |
}{% |
| 44 |
\thm@style{#1}% |
| 45 |
\renewcommand{\LWR@newtheoremstyle}{#1}% lwarp |
| 46 |
}% |
| 47 |
} |
| 48 |
|
| 49 |
\VerifyCommand[lwarp][amsthm]{\@xnthm}{21F7FB3FB6FB0C1A0F2EECD66EE87A60} |
| 50 |
|
| 51 |
\def\@xnthm#1#2{% |
| 52 |
\csedef{LWR@thmstyle#2}{\LWR@newtheoremstyle}% lwarp |
| 53 |
\let\@tempa\relax |
| 54 |
\@xp\@ifdefinable\csname #2\endcsname{% |
| 55 |
\global\@xp\let\csname end#2\endcsname\@endtheorem |
| 56 |
\ifx *#1% unnumbered, need to get one more mandatory arg |
| 57 |
\edef\@tempa##1{% |
| 58 |
\gdef\@xp\@nx\csname#2\endcsname{% |
| 59 |
\@nx\@thm{\@xp\@nx\csname th@\the\thm@style\endcsname}% |
| 60 |
{}{##1}}}% |
| 61 |
\else % numbered theorem, need to check for optional arg |
| 62 |
\def\@tempa{\@oparg{\@ynthm{#2}}[]}% |
| 63 |
\fi |
| 64 |
\AtBeginEnvironment{#2}{% lwarp |
| 65 |
\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#2}}% lwarp |
| 66 |
}% lwarp |
| 67 |
}% |
| 68 |
\@tempa% |
| 69 |
} |
| 70 |
|
| 71 |
\newcommand{\LWR@haveamsthmname}{ |
| 72 |
\renewcommand{\thmname}[1]{% |
| 73 |
\InlineClass{amsthmname\LWR@thisthmstyle}{##1}% |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
\newcommand{\LWR@haveamsthmnumber}{ |
| 78 |
\renewcommand{\thmnumber}[1]{% |
| 79 |
\InlineClass{amsthmnumber\LWR@thisthmstyle}{##1}% |
| 80 |
} |
| 81 |
} |
| 82 |
|
| 83 |
\newcommand{\LWR@haveamsthmnote}{ |
| 84 |
\renewcommand{\thmnote}[1]{% |
| 85 |
\InlineClass{amsthmnote\LWR@thisthmstyle}{##1}% |
| 86 |
} |
| 87 |
} |
| 88 |
|
| 89 |
\LWR@haveamsthmname |
| 90 |
\LWR@haveamsthmnumber |
| 91 |
\LWR@haveamsthmnote |
| 92 |
\def\@begintheorem#1#2[#3]{% |
| 93 |
\GetTitleString{#3}% lwarp |
| 94 |
\let\@currentlabelname\GetTitleStringResult% lwarp |
| 95 |
\item[% |
| 96 |
\LWR@newautopagelabel{page}\LWR@orignewline% |
| 97 |
\@ifempty{#1}{\let\thmname\@gobble}{\LWR@haveamsthmname}% lwarp |
| 98 |
\@ifempty{#2}{\let\thmnumber\@gobble}{\LWR@haveamsthmnumber}% lwarp |
| 99 |
\@ifempty{#3}{\let\thmnote\@gobble}{\LWR@haveamsthmnote}% lwarp |
| 100 |
\thm@swap\swappedhead\thmhead{#1}{#2}{#3}% |
| 101 |
\the\thm@headpunct % space |
| 102 |
\thmheadnl % possibly a newline. |
| 103 |
\hskip\thm@headsep |
| 104 |
]% |
| 105 |
\ignorespaces} |
| 106 |
\TestVerifyCommands |
| 107 |
|
| 108 |
\IfVerifyCommand[lwarp][amsthm]{\@thm} |
| 109 |
{2624BDB5B96C45756978B3D393430088}% amsthm definition |
| 110 |
{}{} |
| 111 |
|
| 112 |
\IfVerifyCommand[lwarp][amsthm]{\@thm} |
| 113 |
{92CB17837FB4FDD879B327DA0E9D8059}% amsthm definition modified by lwarp |
| 114 |
{}{} |
| 115 |
|
| 116 |
\IfVerifyCommandPassed |
| 117 |
{} |
| 118 |
{\VERCMDWarning{lwarp}{amsthm}{\@thm}} |
| 119 |
|
| 120 |
\def\@thm#1#2#3{% |
| 121 |
\ifhmode\unskip\unskip\par\fi |
| 122 |
\normalfont |
| 123 |
\LWR@forcenewpage% lwarp |
| 124 |
\LWR@printpendingfootnotes% lwarp |
| 125 |
\BlockClass{amsthmbody\LWR@thisthmstyle}% lwarp |
| 126 |
\trivlist |
| 127 |
\let\thmheadnl\relax |
| 128 |
\let\thm@swap\@gobble |
| 129 |
\thm@notefont{\fontseries\mddefault\upshape}% |
| 130 |
\thm@headpunct{.}% add period after heading |
| 131 |
\thm@headsep 5\p@ plus\p@ minus\p@\relax |
| 132 |
\thm@space@setup |
| 133 |
#1% style overrides |
| 134 |
\@topsep \thm@preskip % used by thm head |
| 135 |
\@topsepadd \thm@postskip % used by \@endparenv |
| 136 |
\def\@tempa{#2}\ifx\@empty\@tempa |
| 137 |
\def\@tempa{\@oparg{\@begintheorem{#3}{}}[]}% |
| 138 |
\else |
| 139 |
\refstepcounter{#2}% |
| 140 |
\def\@tempa{\@oparg{\@begintheorem{#3}{\csname the#2\endcsname}}[]}% |
| 141 |
\fi |
| 142 |
\@tempa% |
| 143 |
} |
| 144 |
\AtBeginDocument{% |
| 145 |
\VerifyCommand[lwarp][amsthm]{\cref@thmoptarg}{64B912D4D903D245FD05837C5838C9EC} |
| 146 |
\def\cref@thmoptarg[#1]#2#3#4{% |
| 147 |
\ifhmode\unskip\unskip\par\fi% |
| 148 |
\normalfont% |
| 149 |
\LWR@forcenewpage% lwarp |
| 150 |
\LWR@printpendingfootnotes% lwarp |
| 151 |
\BlockClass{amsthmbody\LWR@thisthmstyle}% lwarp |
| 152 |
\trivlist% |
| 153 |
\let\thmheadnl\relax% |
| 154 |
\let\thm@swap\@gobble% |
| 155 |
\thm@notefont{\fontseries\mddefault\upshape}% |
| 156 |
\thm@headpunct{.}% add period after heading |
| 157 |
\thm@headsep 5\p@ plus\p@ minus\p@\relax% |
| 158 |
\thm@space@setup% |
| 159 |
#2% style overrides |
| 160 |
\@topsep \thm@preskip % used by thm head |
| 161 |
\@topsepadd \thm@postskip % used by \@endparenv |
| 162 |
\def\@tempa{#3}\ifx\@empty\@tempa% |
| 163 |
\def\@tempa{\@oparg{\@begintheorem{#4}{}}[]}% |
| 164 |
\else% |
| 165 |
\refstepcounter[#1]{#3}% <<< cleveref modification |
| 166 |
\def\@tempa{\@oparg{\@begintheorem{#4}{\csname the#3\endcsname}}[]}% |
| 167 |
\fi% |
| 168 |
\@tempa |
| 169 |
}% |
| 170 |
}% AtBeginDocument |
| 171 |
|
| 172 |
\def\@endtheorem{% |
| 173 |
\endtrivlist% |
| 174 |
\LWR@printpendingfootnotes% lwarp |
| 175 |
\endBlockClass% |
| 176 |
\@endpefalse% |
| 177 |
} |
| 178 |
\AtBeginDocument{ |
| 179 |
\@ifundefined{LWR@orig@openbox}{ |
| 180 |
\LetLtxMacro\LWR@orig@openbox\openbox |
| 181 |
\LetLtxMacro\LWR@orig@blacksquare\blacksquare |
| 182 |
\LetLtxMacro\LWR@orig@Box\Box |
| 183 |
|
| 184 |
\def\openbox{\text{\HTMLunicode{25A1}}}% UTF-8 white box |
| 185 |
\def\blacksquare{\text{\HTMLunicode{220E}}}% UTF-8 end-of-proof |
| 186 |
\def\Box{\text{\HTMLunicode{25A1}}}% UTF-8 white box |
| 187 |
|
| 188 |
\appto\LWR@restoreorigformatting{% |
| 189 |
\LetLtxMacro\openbox\LWR@orig@openbox% |
| 190 |
\LetLtxMacro\blacksquare\LWR@orig@blacksquare% |
| 191 |
\LetLtxMacro\Box\LWR@orig@Box% |
| 192 |
}% appto |
| 193 |
}{}% @ifundefined |
| 194 |
}% AtBeginDocument |
| 195 |
\DeclareRobustCommand{\qed}{% |
| 196 |
\ifmmode \mathqed |
| 197 |
\else |
| 198 |
\InlineClass{theoremendmark}{\qedsymbol}% lwarp |
| 199 |
\fi |
| 200 |
} |
| 201 |
\renewenvironment{proof}[1][\proofname]{\par |
| 202 |
\LWR@forcenewpage% lwarp |
| 203 |
\LWR@printpendingfootnotes% lwarp |
| 204 |
\BlockClass{amsthmproof}% lwarp |
| 205 |
\LWR@newautopagelabel{page}% |
| 206 |
\pushQED{\qed}% |
| 207 |
\normalfont \topsep6\p@\@plus6\p@\relax |
| 208 |
\trivlist |
| 209 |
\item[ |
| 210 |
\InlineClass{amsthmproofname}{#1\@addpunct{.}}]\ignorespaces% changes |
| 211 |
}{% |
| 212 |
\popQED\endtrivlist% |
| 213 |
\LWR@printpendingfootnotes% lwarp |
| 214 |
\endBlockClass% lwarp |
| 215 |
\@endpefalse |
| 216 |
} |
| 217 |
|
| 218 |
|
| 219 |
\endinput |
| 220 |
%% |
| 221 |
%% End of file `lwarp-amsthm.sty'. |