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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
%% The LaTeX package tcolorbox - version 3.95 (2016/10/21)
%% tcbskinsjigsaw.code.tex: Code for colorboxes with different skins
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2006-2016 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
%%
\tcb@set@library@version{3.95}
\newcounter{tcbrastercolumn}
\newcounter{tcbrasterrow}
\newcounter{tcbraster}
\newrobustcmd{\thetcbrasternum}{\the\numexpr(\c@tcbrasterrow-1)*\kvtcb@raster@columns+\c@tcbrastercolumn\relax}
\def\tcb@raster@ehg@all{%
\tcbset{equal height group={\kvtcb@raster@ehgid}}%
}
\def\tcb@raster@ehg@row{%
\tcbset{equal height group={\kvtcb@raster@ehgid @\number\c@tcbrasterrow}}%
}
\tcbset{%
raster columns/.store in=\kvtcb@raster@columns,
raster rows/.store in=\kvtcb@raster@rows,
raster width/.store in=\kvtcb@raster@width,
raster height/.store in=\kvtcb@raster@height,
%
raster before skip/.store in=\kvtcb@raster@skip@before,
raster after skip/.store in=\kvtcb@raster@skip@after,
raster left skip/.store in=\kvtcb@raster@skip@left,
raster right skip/.store in=\kvtcb@raster@skip@right,
%
raster column skip/.store in=\kvtcb@raster@xskip,
raster row skip/.store in=\kvtcb@raster@yskip,
%
raster equal skip/.style={raster before skip=#1,raster after skip=#1,
raster column skip=#1,raster row skip=#1},
%
raster@halign/.store in=\kvtcb@raster@halign,
raster halign/.is choice,
raster halign/center/.style={raster@halign=\centering},
raster halign/left/.style={raster@halign=\raggedright},
raster halign/right/.style={raster@halign=\raggedleft},
%
raster valign/.store in=\kvtcb@raster@valign,
%
raster equal height group/.store in=\kvtcb@raster@ehgid,%
raster equal height/.is choice,
raster equal height/.default=all,
raster equal height/none/.code={\let\tcb@raster@ehg@start\@empty%
\let\tcb@raster@ehg@continue\@empty},%
raster equal height/rows/.code={\let\tcb@raster@ehg@start\tcb@raster@ehg@row%
\let\tcb@raster@ehg@continue\tcb@raster@ehg@row},%
raster equal height/all/.code={\let\tcb@raster@ehg@start\tcb@raster@ehg@all%
\let\tcb@raster@ehg@continue\@empty},%
%
raster force size/.is choice,%
raster force size/.default=true,%
raster force size/true/.code={\let\tcb@raster@set@size\tcbset@late@options},%
raster force size/false/.code={\let\tcb@raster@set@size\tcbset},%
raster multicolumn/.code={%
\ifnum\numexpr\c@tcbrastercolumn+#1>\numexpr\kvtcb@raster@columns+1\relax
\tcb@warning{'raster multicolumn' combined too much columns}%
\else%
\tcbset@late@options{%
code={\preto\kvtcb@afterbox{\addtocounter{tcbrastercolumn}{\numexpr#1-1}}},
width=(\tcb@raster@box@width+\kvtcb@raster@xskip)*#1-\kvtcb@raster@xskip}%
\fi%
},
raster multirow/.code={%
\ifdefined\tcb@raster@box@height%
\tcbset@late@options{%
height=(\tcb@raster@box@height+\kvtcb@raster@yskip)*#1-\kvtcb@raster@yskip}%
\else%
\tcb@warning{'raster multirow' needs a fixed 'raster height'}%
\fi%
},
}
\tcbset{
raster reset/.style={
raster width=\linewidth,raster height=0pt,
raster equal skip=2mm,
raster columns=2,raster rows=2,
raster left skip=0pt,raster right skip=0pt,
raster halign=left,raster valign=center,
raster equal height=none,
raster equal height group={REG@\tcb@raster@number},
raster force size,},
raster reset
}
\setcounter{tcbraster}{0}
\let\tcb@raster@change@minipage\@empty
\let\tcb@raster@change@fitbox\@empty
\def\tcb@raster@change@hbox{\tcbset{capture=minipage}}
\def\tcb@height@fill@unbroken@raster#1{%
\ifnum\c@tcblayer<2\relax%
\kvtcb@beforebox%
\def\kvtcb@beforebox{}%
\tcb@breakat@init%
\tcbset{compress page=#1}%
\tcb@comp@h@page%
\ifdim\tcb@h@page<0pt\relax\unkern\pagebreak\tcb@comp@h@page\kern\kvtcb@raster@skip@left\fi%
\tcbset{height=\tcb@h@page-\kvtcb@bbtop@stand-\kvtcb@bbbottom@stand}%
\fi%
}
\newenvironment{tcbraster}[1][]{%
\tcb@layer@pushup%
\stepcounter{tcbraster}%
\edef\tcb@raster@number{\number\c@tcbraster}%
\edef\tcb@raster@save@column{\number\c@tcbrastercolumn}%
\edef\tcb@raster@save@row{\number\c@tcbrasterrow}%
\let\tcb@raster@change@fitbox\@empty%
\setcounter{tcbrastercolumn}{1}%
\setcounter{tcbrasterrow}{1}%
\let\tcb@height@fill@unbroken\tcb@height@fill@unbroken@raster%
\tcbset{every box on layer \the\numexpr\number\c@tcblayer+1\relax/.code={%
\tcbset{raster every box/.try}%
\ifodd\c@tcbrastercolumn\relax%
\tcbset{raster odd column/.try}%
\else%
\tcbset{raster even column/.try}%
\fi%
\tcbset{raster column \number\c@tcbrastercolumn/.try}%
\ifodd\c@tcbrasterrow\relax%
\tcbset{raster odd row/.try}%
\else%
\tcbset{raster even row/.try}%
\fi%
\tcbset{raster row \number\c@tcbrasterrow/.try}%
\ifodd\thetcbrasternum\relax%
\tcbset{raster odd number/.try}%
\else%
\tcbset{raster even number/.try}%
\fi%
\tcbset{raster row \number\c@tcbrasterrow\space column \number\c@tcbrastercolumn/.try}%
\tcbset{raster number \thetcbrasternum/.try}%
}}%
\tcbset{#1}%
\tcbset@late@options{%
before={\ifhmode\unskip\fi\ifnum\c@tcbrastercolumn>1 \kern\kvtcb@raster@xskip\else%
\ifnum\c@tcbrasterrow>1 \parindent\z@\parskip\z@\par\nointerlineskip\addvspace{\the\dimexpr\kvtcb@raster@yskip\relax}\noindent\fi%
\kern\kvtcb@raster@skip@left\fi},
after={%
\ifnum\c@tcbrastercolumn=\kvtcb@raster@columns\relax%
\kern\kvtcb@raster@skip@right%
\setcounter{tcbrastercolumn}{1}\addtocounter{tcbrasterrow}{1}%
\aftergroup\tcb@raster@ehg@continue%
\else%
\stepcounter{tcbrastercolumn}%
\fi},%
box align=\kvtcb@raster@valign,%
}%
\tcbdimto\tcb@raster@box@width{(\kvtcb@raster@width+\kvtcb@raster@xskip-\kvtcb@raster@skip@left-\kvtcb@raster@skip@right)/\kvtcb@raster@columns-\kvtcb@raster@xskip}%
\tcb@raster@set@size{%
code={\csuse{tcb@raster@change@\kvtcb@capture}},
width=\tcb@raster@box@width,
}%
\ifdim\dimexpr\kvtcb@raster@height>0pt\relax%
\tcbdimto\tcb@raster@box@height{(\kvtcb@raster@height+\kvtcb@raster@yskip-0.001pt)/\kvtcb@raster@rows-\kvtcb@raster@yskip}%
\tcb@raster@set@size{height=\tcb@raster@box@height}%
\fi%
\tcb@raster@ehg@start%
\let\tcb@end@raster\@empty%
\ifinner\ifhmode%
\color@vbox%
\hsize=\kvtcb@raster@width%
\let\tcb@end@raster\color@endbox%
\fi\fi%&
\if@nobreak%
\iftcb@ignorenobreak%
{\par\nointerlineskip%
\addvspace{\glueexpr\kvtcb@raster@skip@before-\parskip}}%
\fi%
\else%
{\par\nointerlineskip%
\addvspace{\glueexpr\kvtcb@raster@skip@before-\parskip}}%
\fi%
\kvtcb@raster@halign\noindent%
}{%
\ifhmode\unskip\fi%
\ifnum\c@tcbrastercolumn>1 %
\kern\kvtcb@raster@skip@right%
\fi%
\begingroup%
\par\nointerlineskip%
\addvspace{\glueexpr\kvtcb@raster@skip@after-\parskip}%
\endgroup%
\tcb@end@raster%
\setcounter{tcbrastercolumn}{\tcb@raster@save@column}%
\setcounter{tcbrasterrow}{\tcb@raster@save@row}%
}
\newcommand{\tcbitem@following}[1][]{%
\end{tcolorbox}\begin{tcolorbox}[#1]%
}
\newcommand{\tcbitem@first}[1][]{%
\let\tcbitem=\tcbitem@following%
\begin{tcolorbox}[#1]%
}
\newenvironment{tcbitemize}[1][]{%
\begin{tcbraster}[#1]%
\let\tcb@raster@change@fitbox=\tcb@raster@change@hbox%
\let\tcbitem=\tcbitem@first%
}{\end{tcolorbox}\end{tcbraster}}
\newenvironment{tcboxedraster}[2][]{%
\tcolorbox[#2]\tcbraster[#1]}%
{\endtcbraster\endtcolorbox}
\newenvironment{tcboxeditemize}[2][]{%
\tcolorbox[#2]\tcbitemize[#1]}%
{\endtcbitemize\endtcolorbox}
|