| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2010-2014 by Ulrich M. Schwarz |
| 4 |
% Copyright (C) 2019 by Frank Mittelbach |
| 5 |
% Copyright (C) 2020- by Yukai Chou |
| 6 |
% |
| 7 |
% This file may be distributed and/or modified under the conditions of |
| 8 |
% the LaTeX Project Public License, version 1.3c. |
| 9 |
% The license can be obtained from |
| 10 |
% http://www.latex-project.org/lppl/lppl-1-3c.txt |
| 11 |
% |
| 12 |
%\fi |
| 13 |
% |
| 14 |
%\iffalse (hide this from DocInput) |
| 15 |
%<*llncs> |
| 16 |
%\fi |
| 17 |
% \begin{macrocode} |
| 18 |
\@ifclasslater{llncs}{2010/04/15}{}{% |
| 19 |
\PackageWarningNoLine{thmtools}{% |
| 20 |
LLNCS.cls too old, not supported by thmtools |
| 21 |
}% |
| 22 |
\endinput} |
| 23 |
% Thank you very much, Springer, for having yet another bloody |
| 24 |
% system. Annoyingly, it makes \xdefs all over the place, so |
| 25 |
% they break \MakeUppercase and hence name=. |
| 26 |
\ifx\thmt@modifycase\@empty\else |
| 27 |
\PackageWarningNoLine{thmtools}{% |
| 28 |
LLNCS support disables automatic casing of theorem names |
| 29 |
}% |
| 30 |
\let\thmt@modifycase\@empty |
| 31 |
\fi |
| 32 |
%% |
| 33 |
% Usage: |
| 34 |
% |
| 35 |
% \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font} |
| 36 |
% or \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font} |
| 37 |
% or \spnewtheorem*{env_nam}{caption}{cap_font}{body_font} |
| 38 |
\providecommand\thmt@style@headfont{\normalfont\bfseries} |
| 39 |
\providecommand\thmt@style@bodyfont{\normalfont\itshape} |
| 40 |
|
| 41 |
\let\thmt@original@spnewtheorem\spnewtheorem |
| 42 |
\let\thmt@theoremdefiner\thmt@original@spnewtheorem |
| 43 |
|
| 44 |
% cf thm-patch.dtx |
| 45 |
\def\spnewtheorem{% |
| 46 |
\thmt@isstarredfalse |
| 47 |
\thmt@hassiblingfalse |
| 48 |
\thmt@hasparentfalse |
| 49 |
\parse{% |
| 50 |
{\parseFlag*{\thmt@isstarredtrue}{}}% |
| 51 |
{\parseMand{\def\thmt@envname{##1}}}% |
| 52 |
{\parseOpt[]{\thmt@hassiblingtrue\def\thmt@sibling{##1}}{}}% |
| 53 |
{\parseMand{% |
| 54 |
\def\thmt@thmname{##1}% |
| 55 |
}}% |
| 56 |
{\parseOpt[]{\thmt@hasparenttrue\def\thmt@parent{##1}}{}}% |
| 57 |
{\parseMand{\def\thmt@style@headfont{##1}}}% |
| 58 |
{\parseMand{\def\thmt@style@bodyfont{##1}}}% |
| 59 |
{\let\@parsecmd\thmt@spnewtheoremiv}% |
| 60 |
}% |
| 61 |
} |
| 62 |
|
| 63 |
\newcommand\thmt@spnewtheoremiv{% |
| 64 |
\thmt@newtheorem@predefinition |
| 65 |
% whee, now reassemble the whole shebang. |
| 66 |
\protected@edef\thmt@args{% |
| 67 |
\@nx\thmt@theoremdefiner% |
| 68 |
\ifthmt@isstarred *\fi |
| 69 |
{\thmt@envname}% |
| 70 |
\ifthmt@hassibling [\thmt@sibling]\fi |
| 71 |
{\thmt@thmname}% |
| 72 |
\ifthmt@hasparent [\thmt@parent]\fi |
| 73 |
{\thmt@style@headfont}{\thmt@style@bodyfont}% |
| 74 |
}% |
| 75 |
\thmt@args |
| 76 |
\thmt@newtheorem@postdefinition |
| 77 |
} |
| 78 |
|
| 79 |
% for the keyval interface: |
| 80 |
\define@key{thmdef}{headfont}{% |
| 81 |
\def\thmt@style@headfont{#1}% |
| 82 |
} |
| 83 |
\define@key{thmdef}{bodyfont}{% |
| 84 |
\def\thmt@style@bodyfont{#1}% |
| 85 |
} |
| 86 |
|
| 87 |
\def\thmt@almost@spnewtheorem#1\relax{% |
| 88 |
\def\thm@tmpa{\spnewtheorem#1}% |
| 89 |
\@xa\@xa\@xa\thm@tmpa |
| 90 |
\@xa\@xa\@xa{\@xa\thmt@style@headfont\@xa}% |
| 91 |
\@xa{\thmt@style@bodyfont}% |
| 92 |
} |
| 93 |
\let\thmt@newtheorem\thmt@almost@spnewtheorem |
| 94 |
% \end{macrocode} |
| 95 |
%\iffalse (hide this from DocInput) |
| 96 |
%</llncs> |
| 97 |
%\fi |