-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtcbtheorems.code.tex
70 lines (63 loc) · 3.65 KB
/
tcbtheorems.code.tex
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
%% The LaTeX package tcolorbox - version 2.21 (2013/04/23)
%% tcbtheorems.code.tex: Code for theorems in colorboxes
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2006-2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `author-maintained'.
%%
%% This work consists of all files listed in README
%%
\makeatletter
\def\tcblibrary@theorems@loaded{}
\RequirePackage{amsmath}
\def\tcb@hack@amsmath{\tcb@hack@currenvir\vskip-\abovedisplayskip}
\tcbset{
theorem/.code args={#1#2#3#4}{%
\refstepcounter{#2}\label{#4}%
\pgfkeysalso{title={\setbox\z@=\hbox{#1~\csname the#2\endcsname:\ }\hangindent\wd\z@\hangafter=1 \mbox{#1~\csname the#2\endcsname:\ }#3}}},%
math upper/.style={before upper=$\displaystyle,after upper=$},%
math lower/.style={before lower=$\displaystyle,after lower=$},%
math/.style={math upper,math lower},%
ams equation upper/.style={before upper=\tcb@hack@currenvir\equation,after upper=\endequation},%
ams equation lower/.style={before lower=\tcb@hack@currenvir\equation,after lower=\endequation},%
ams equation/.style={ams equation upper,ams equation lower},%
ams equation* upper/.style={before upper=\tcb@hack@currenvir\csname equation*\endcsname,after upper=\endequation},%
ams equation* lower/.style={before lower=\tcb@hack@currenvir\csname equation*\endcsname,after lower=\endequation},%
ams equation*/.style={ams equation* upper,ams equation* lower},%
ams align upper/.style={before upper=\tcb@hack@amsmath\align,after upper=\endalign},%
ams align lower/.style={before lower=\tcb@hack@amsmath\align,after lower=\endalign},%
ams align/.style={ams align upper,ams align lower},%
ams align* upper/.style={before upper=\tcb@hack@amsmath\csname align*\endcsname,after upper=\endalign},%
ams align* lower/.style={before lower=\tcb@hack@amsmath\csname align*\endcsname,after lower=\endalign},%
ams align*/.style={ams align* upper,ams align* lower},%
ams gather upper/.style={before upper=\tcb@hack@amsmath\gather,after upper=\endgather},%
ams gather lower/.style={before lower=\tcb@hack@amsmath\gather,after lower=\endgather},%
ams gather/.style={ams gather upper,ams gather lower},%
ams gather* upper/.style={before upper=\tcb@hack@amsmath\csname gather*\endcsname,after upper=\endgather},%
ams gather* lower/.style={before lower=\tcb@hack@amsmath\csname gather*\endcsname,after lower=\endgather},%
ams gather*/.style={ams gather* upper,ams gather* lower},%
ams nodisplayskip upper/.style={before upper=\vskip-\abovedisplayskip},%
ams nodisplayskip lower/.style={before upper=\vskip-\abovedisplayskip},%
ams nodisplayskip/.style={ams nodisplayskip upper,ams nodisplayskip lower},%
highlight math style/.style={highlight math/.style={#1}},%
highlight math style={colframe=red,colback=yellow!25!white,notitle},%
}
\newcommand{\tcbmaketheorem}[5]{%
\newenvironment{#1}[3][]{%
\tcolorbox[#3,savedelimiter=#1,
theorem={#2}{#4}{##2}{#5:##3},
##1]}%
{\endtcolorbox}%
}
\newcommand{\tcboxmath}[1][]{\tcbox[nobeforeafter,math upper,tcbox raise base,#1]}
\newcommand{\tcbhighmath}[1][]{\tcboxmath[highlight math,#1]}