-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboxes.sty
More file actions
141 lines (126 loc) · 3.52 KB
/
Copy pathboxes.sty
File metadata and controls
141 lines (126 loc) · 3.52 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
\ProvidesPackage{prettytex/boxes}
\RequirePackage{prettytex/base}
\usepackage{framed}
\usepackage[most]{tcolorbox}
\usepackage{varwidth}
\usepackage{footnote}
\usepackage{etoolbox}
\usepackage{amsthm}
\usepackage{thmtools}
\newif\ifcref
\creffalse
\DeclareOption{cref}{\creftrue}
\ProcessOptions\relax
% allow tikz-externalization
\tcbsetforeverylayer{shield externalize}
\tcbuselibrary{skins}
% Leftbar box
\renewenvironment{leftbar}[1][\hsize]{
\def\FrameCommand{
{\color{themecolor}\vrule width 3pt}%
\hspace{0pt}
\fboxsep=.8cm\colorbox{lightgreybg}%
}
\MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}
}{\endMakeFramed}
% magic for setting tcolor-box theorem-counters
% use with \settcbcounter{<thm-name>}{<num>}
\newcommand{\providetcbcountername}[1]{%
\@ifundefined{c@tcb@cnt@#1}{%
--undefined--%
}{%
tcb@cnt@#1%
}
}
\newcommand{\settcbcounter}[2]{%
\@ifundefined{c@tcb@cnt@#1}{%
\GenericError{Error}{counter name #1 is no tcb counter }{}{}%
}{%
\setcounter{tcb@cnt@#1}{#2}%
}%
}%
\newcommand{\displaytcbcounter}[1]{% Wrapper for \the...
\@ifundefined{thetcb@cnt@#1}{%
\GenericError{Error}{counter name #1 is no tcb counter }{}{}%
}{%
\csname thetcb@cnt@#1\endcsname%
}%
}
\newcommand{\wrapthm}[2]{%
\tcolorboxenvironment{#1}{enhanced jigsaw,
enhanced jigsaw, colframe=#2!50,%
,fonttitle=\bfseries\itshape,colbacktitle=#2!20,%
borderline={0.5mm}{0mm}{#2!50},%
colback=#2!5
}
}
\newcommand{\miniwrap}[2]{%
\tcolorboxenvironment{#1}{enhanced jigsaw,
colframe=#2!50,%
,fonttitle=\bfseries\itshape,colbacktitle=#2!20,%
borderline={0.5mm}{0mm}{#2!50},%
colback=white
}
}
% Theorem box
% default style:
\newcommand{\thmbox}[5]{%
\BeforeBeginEnvironment{#1}{\savenotes}%
\AfterEndEnvironment{#1}{\spewnotes}%
\newtcbtheorem[number within=#5, list inside={#4}, list type={thmlist}]{#1}{#2}{%
enhanced jigsaw, frame empty, interior empty, colframe=#3!50,%
coltitle=#3,fonttitle=\bfseries\itshape,colbacktitle=#3!20,%
borderline={0.5mm}{0mm}{#3!50},%
colback=white,top=5mm,%
attach boxed title to top center={yshift=-3mm},%
%varwidth boxed title,
}{#4}%
% \makeatletter%
% \crefname{tcb@cnt@#1}{#1}{#1}%
% \Crefname{tcb@cnt@#1}{#2}{#2}%
% \makeatother%
}
\DeclareOption{sharp}{
\renewcommand{\thmbox}[6]{%
\BeforeBeginEnvironment{#1}{\savenotes}%
\AfterEndEnvironment{#1}{\spewnotes}%
% sharp style:
\newtcbtheorem[number within=#5, list inside={#4}, list type={thmlist}]{#1}{#2}{%
theorem style=#6,
% breakable,
enhanced,
title=#3,
colframe=#3,
colback=white,
coltitle=black,
colbacktitle=#3!30,
boxrule=0pt,
leftrule=2pt,
fonttitle=\bfseries,
sharp corners,
enlarge top initially by=3mm,
enlarge bottom finally by=3mm,
before skip=2mm,
after skip=2mm,
separator sign colon,
description delimiters={}{}
}{#4}%
}%
}
\ProcessOptions\relax
\newcommand*\l@thmlist{\@dottedtocline{1}{1.5em}{3.3em}}
\ifcref
\newcommand{\declareEnvList}[4]{%
\newlist{#1list}{enumerate}{1}
\setlist[#1list]{label=(\roman{#1listi}), ref=#2.(\roman{#1listi}), noitemsep}
\Crefname{list#1}{#3}{#3}
\crefname{list#1}{#4}{#4}
\addtotheorempostheadhook[#1]{\crefalias{#1listi}{list#1}}
}
\else
\newcommand{\declareEnvList}[2]{%
\newlist{#1list}{enumerate}{1}
\setlist[#1list]{label=(\roman{#1listi}), ref=#2.(\roman{#1listi}), noitemsep}
\addtotheorempostheadhook[#1]{\crefalias{#1listi}{list#1}}
}
\fi