summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/thmtools/thmdef-thmbox.dtx
blob: ea22cbae977bff483df4cc89b4bf999064d63b8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% \iffalse meta-comment
%
% Copyright (C) 2010 by Ulrich M. Schwarz
% See file COPYING for more details.
%\fi
%
%\iffalse (hide this from DocInput)
%<*thmbox>
%\fi
% The thmbox package does something else: instead of having a separate
% environment, we have to use a command different from
% \lstinline|\newtheorem| to get the boxed style. Fortunately,
% \thmtools stores the command as \lstinline|\thmt@theoremdefiner|, so we
% can modify it. (One of the perks if extension writer and framework writer
% are the same person.) So, in contrast to the previous example, this time
% we need to do something before the actual \lstinline|\newtheorem| is
% called.
%    \begin{macrocode}
\define@key{thmdef}{thmbox}[L]{%
  \thmt@trytwice{%
  \let\oldproof=\proof
  \let\oldendproof=\endproof
  \let\oldexample=\example
  \let\oldendexample=\endexample
  \RequirePackage[nothm]{thmbox}
  \let\proof=\oldproof
  \let\endproof=\oldendproof
  \let\example=\oldexample
  \let\endexample=\oldendexample
  \def\thmt@theoremdefiner{\newboxtheorem[#1]}%
  }{}%
}%
%    \end{macrocode}
%\iffalse (hide this from DocInput)
%</thmbox>
%\fi