| 1 |
% !TeX root = tcolorbox.tex |
| 2 |
% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) |
| 3 |
\clearpage |
| 4 |
\section{Library \mylib{hooks}}\label{sec:hooks}% |
| 5 |
\tcbset{external/prefix=external/hooks_}% |
| 6 |
The library is loaded by a package option or inside the preamble by: |
| 7 |
\begin{dispListing} |
| 8 |
\tcbuselibrary{hooks} |
| 9 |
\end{dispListing} |
| 10 |
|
| 11 |
For the skin related options, the library \mylib{skins} has to be loaded |
| 12 |
separately. |
| 13 |
|
| 14 |
|
| 15 |
\subsection{Concept of Hooks} |
| 16 |
A hook is a placeholder in some \LaTeX\ code where additional code |
| 17 |
can be added. For example, the \LaTeX\ macro |\AtBeginDocument| adds code to a |
| 18 |
hook which is placed at the beginning of every document. |
| 19 |
|
| 20 |
Several option keys of |tcolorbox| allow providing some code which is |
| 21 |
added to specific places of a colored box. For example, \refKey{/tcb/before upper} |
| 22 |
places code before the content of the upper part. A following usage of this |
| 23 |
key overwrites any prior settings. |
| 24 |
|
| 25 |
The library \mylib{hooks} extends \refKey{/tcb/before upper} and several more |
| 26 |
existing keys to \enquote{hookable} versions, e.\,g.\ |
| 27 |
\refKey{/tcb/before upper app} and \refKey{/tcb/before upper pre}. |
| 28 |
The \enquote{hookable} keys don't overwrite prior settings but either \emph{app}end |
| 29 |
or \emph{pre}pend the newly given code to the existing code. |
| 30 |
|
| 31 |
The general naming convention (with some small exceptions) is: |
| 32 |
\begin{itemize} |
| 33 |
\item \meta{option key} |app|: works like \meta{option key} but |
| 34 |
\emph{app}ends its code to the existing code. |
| 35 |
\item \meta{option key} |pre|: works like \meta{option key} but |
| 36 |
\emph{pre}pends its code to the existing code. |
| 37 |
\end{itemize} |
| 38 |
If the original \meta{option key} is used (again), all code will be overwritten. |
| 39 |
Therefore, the order of the option key usage is crucial. |
| 40 |
|
| 41 |
In particular, if the original \meta{option key} is stackable by default, |
| 42 |
usually there is already an accompanying \enquote{|no| \meta{option key}} option |
| 43 |
to clear the existing code. Thus this library only adds the |
| 44 |
\enquote{\meta{option key} |pre|} variant. |
| 45 |
|
| 46 |
\enlargethispage*{2cm} |
| 47 |
|
| 48 |
\begin{dispExample} |
| 49 |
% \usepackage{array,tabularx} |
| 50 |
\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}% see tabularx |
| 51 |
\tcbset{enhanced,fonttitle=\bfseries\large,fontupper=\normalsize\sffamily, |
| 52 |
colback=yellow!10!white,colframe=red!50!black,colbacktitle=Salmon!30!white, |
| 53 |
coltitle=black,center title, |
| 54 |
tabularx={X||Y|Y|Y|Y||Y},% this sets `before upper' and `after upper' |
| 55 |
before upper app={Group & One & Two & Three & Four & Sum\\\hline\hline} } |
| 56 |
|
| 57 |
\begin{tcolorbox}[title=My table] |
| 58 |
Red & 1000.00 & 2000.00 & 3000.00 & 4000.00 & 10000.00\\\hline |
| 59 |
Green & 2000.00 & 3000.00 & 4000.00 & 5000.00 & 14000.00\\\hline |
| 60 |
Blue & 3000.00 & 4000.00 & 5000.00 & 6000.00 & 18000.00\\\hline\hline |
| 61 |
Sum & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00 |
| 62 |
\end{tcolorbox} |
| 63 |
\end{dispExample} |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
\clearpage |
| 68 |
\subsection{Box Content Additions}\label{subsec:hookscontentadditions} |
| 69 |
The following option keys extend the options given in Subsection \ref{subsec:contentadditions} |
| 70 |
from page \pageref{subsec:contentadditions}. |
| 71 |
|
| 72 |
\begin{docTcbKey}{before title app}{=\meta{code}}{no default} |
| 73 |
Appends the given \meta{code} to \refKey{/tcb/before title} \emph{after} the color and font settings |
| 74 |
and \emph{before} the content of the title. |
| 75 |
\end{docTcbKey} |
| 76 |
|
| 77 |
\begin{docTcbKey}{before title pre}{=\meta{code}}{no default} |
| 78 |
Prepends the given \meta{code} to \refKey{/tcb/before title} \emph{after} the color and font settings |
| 79 |
and \emph{before} the content of the title. |
| 80 |
\end{docTcbKey} |
| 81 |
|
| 82 |
\begin{docTcbKey}{after title app}{=\meta{code}}{no default} |
| 83 |
Appends the given \meta{code} to \refKey{/tcb/after title} \emph{after} the content of the title. |
| 84 |
\end{docTcbKey} |
| 85 |
|
| 86 |
\begin{docTcbKey}{after title pre}{=\meta{code}}{no default} |
| 87 |
Prepends the given \meta{code} to \refKey{/tcb/after title} \emph{after} the content of the title. |
| 88 |
\end{docTcbKey} |
| 89 |
|
| 90 |
\begin{docTcbKey}{before upper app}{=\meta{code}}{no default} |
| 91 |
Appends the given \meta{code} to \refKey{/tcb/before upper} or \refKey{/tcb/before upper*} \emph{after} the color and font settings |
| 92 |
and \emph{before} the content of the upper part. |
| 93 |
\end{docTcbKey} |
| 94 |
|
| 95 |
\begin{docTcbKey}{before upper pre}{=\meta{code}}{no default} |
| 96 |
Prepends the given \meta{code} to \refKey{/tcb/before upper} or \refKey{/tcb/before upper*} \emph{after} the color and font settings |
| 97 |
and \emph{before} the content of the upper part. |
| 98 |
\end{docTcbKey} |
| 99 |
|
| 100 |
\begin{docTcbKey}{after upper app}{=\meta{code}}{no default} |
| 101 |
Appends the given \meta{code} to \refKey{/tcb/after upper} or \refKey{/tcb/after upper*} \emph{after} the content of the upper part. |
| 102 |
\end{docTcbKey} |
| 103 |
|
| 104 |
\begin{docTcbKey}{after upper pre}{=\meta{code}}{no default} |
| 105 |
Prepends the given \meta{code} to \refKey{/tcb/after upper} or \refKey{/tcb/after upper*} \emph{after} the content of the upper part. |
| 106 |
\begin{dispExample} |
| 107 |
% \tcbuselibrary{theorems} |
| 108 |
|
| 109 |
\begin{tcolorbox}[ |
| 110 |
ams align,% this sets `before upper*' and `after upper*' |
| 111 |
colback=yellow!10!white,colframe=red!50!black, |
| 112 |
before upper app={\frac{2}{\sqrt{2}}&=\sqrt{2}.\\}, |
| 113 |
after upper pre={\\\sin\left(\frac{\pi}{2}\right)&=1.}, |
| 114 |
] |
| 115 |
\sum\limits_{n=1}^{\infty} \frac{1}{n} &= \infty.\\ |
| 116 |
\int x^2 ~\text{d}x &= \frac13 x^3 + c. |
| 117 |
\end{tcolorbox} |
| 118 |
\end{dispExample} |
| 119 |
\end{docTcbKey} |
| 120 |
|
| 121 |
\clearpage |
| 122 |
\begin{docTcbKey}{before lower app}{=\meta{code}}{no default} |
| 123 |
Appends the given \meta{code} to \refKey{/tcb/before lower} or \refKey{/tcb/before lower*} \emph{after} the color and font settings |
| 124 |
and \emph{before} the content of the lower part. |
| 125 |
\end{docTcbKey} |
| 126 |
|
| 127 |
\begin{docTcbKey}{before lower pre}{=\meta{code}}{no default} |
| 128 |
Prepends the given \meta{code} to \refKey{/tcb/before lower} or \refKey{/tcb/before lower*} \emph{after} the color and font settings |
| 129 |
and \emph{before} the content of the lower part. |
| 130 |
\end{docTcbKey} |
| 131 |
|
| 132 |
\begin{docTcbKey}{after lower app}{=\meta{code}}{no default} |
| 133 |
Appends the given \meta{code} to \refKey{/tcb/after lower} or \refKey{/tcb/after lower*} \emph{after} the content of the lower part. |
| 134 |
\end{docTcbKey} |
| 135 |
|
| 136 |
\begin{docTcbKey}{after lower pre}{=\meta{code}}{no default} |
| 137 |
Prepends the given \meta{code} to \refKey{/tcb/after lower} or \refKey{/tcb/after lower*} \emph{after} the content of the lower part. |
| 138 |
\end{docTcbKey} |
| 139 |
|
| 140 |
\clearpage |
| 141 |
|
| 142 |
\begin{docTcbKeys}[ |
| 143 |
doc new = 2023-11-13, |
| 144 |
doc description = style, |
| 145 |
] |
| 146 |
{ |
| 147 |
{ doc name = environment title app, doc parameter={=\meta{name}} }, |
| 148 |
{ doc name = environment title args app, doc parameter={=\marg{name}\marg{code}} } |
| 149 |
} |
| 150 |
This shortcut style sets \refKey{/tcb/before title app} |
| 151 |
to |\begin|\marg{name} and \refKey{/tcb/after title pre} |
| 152 |
to |\end|\marg{name}, i.\,e., the title text is enclosed by the environment \meta{name}. |
| 153 |
The second variant also places \meta{code} after |\begin|\marg{name}. |
| 154 |
Note that you may need \emph{additional} brackets around \meta{code}, if |
| 155 |
\meta{code} contains some para\-meter(s) for the environment \meta{name}. |
| 156 |
\end{docTcbKeys} |
| 157 |
|
| 158 |
\begin{docTcbKeys}[ |
| 159 |
doc new = 2023-11-13, |
| 160 |
doc description = style, |
| 161 |
] |
| 162 |
{ |
| 163 |
{ doc name = environment title pre, doc parameter={=\meta{name}} }, |
| 164 |
{ doc name = environment title args pre, doc parameter={=\marg{name}\marg{code}} } |
| 165 |
} |
| 166 |
This shortcut style sets \refKey{/tcb/before title pre} |
| 167 |
to |\begin|\marg{name} and \refKey{/tcb/after title app} |
| 168 |
to |\end|\marg{name}, i.\,e., the title text is enclosed by the environment \meta{name}. |
| 169 |
The second variant also places \meta{code} after |\begin|\marg{name}. |
| 170 |
Note that you may need \emph{additional} brackets around \meta{code}, if |
| 171 |
\meta{code} contains some para\-meter(s) for the environment \meta{name}. |
| 172 |
\end{docTcbKeys} |
| 173 |
|
| 174 |
\begin{docTcbKeys}[ |
| 175 |
doc new = 2023-11-13, |
| 176 |
doc description = style, |
| 177 |
] |
| 178 |
{ |
| 179 |
{ doc name = environment upper app, doc parameter={=\meta{name}} }, |
| 180 |
{ doc name = environment upper args app, doc parameter={=\marg{name}\marg{code}} } |
| 181 |
} |
| 182 |
This shortcut style sets \refKey{/tcb/before upper app} |
| 183 |
to |\begin|\marg{name} and \refKey{/tcb/after upper pre} |
| 184 |
to |\end|\marg{name}, i.\,e., the upper part is enclosed by the environment \meta{name}. |
| 185 |
The second variant also places \meta{code} after |\begin|\marg{name}. |
| 186 |
Note that you may need \emph{additional} brackets around \meta{code}, if |
| 187 |
\meta{code} contains some para\-meter(s) for the environment \meta{name}. |
| 188 |
\end{docTcbKeys} |
| 189 |
|
| 190 |
\begin{docTcbKeys}[ |
| 191 |
doc new = 2023-11-13, |
| 192 |
doc description = style, |
| 193 |
] |
| 194 |
{ |
| 195 |
{ doc name = environment upper pre, doc parameter={=\meta{name}} }, |
| 196 |
{ doc name = environment upper args pre, doc parameter={=\marg{name}\marg{code}} } |
| 197 |
} |
| 198 |
This shortcut style sets \refKey{/tcb/before upper pre} |
| 199 |
to |\begin|\marg{name} and \refKey{/tcb/after upper app} |
| 200 |
to |\end|\marg{name}, i.\,e., the upper part is enclosed by the environment \meta{name}. |
| 201 |
The second variant also places \meta{code} after |\begin|\marg{name}. |
| 202 |
Note that you may need \emph{additional} brackets around \meta{code}, if |
| 203 |
\meta{code} contains some para\-meter(s) for the environment \meta{name}. |
| 204 |
\end{docTcbKeys} |
| 205 |
|
| 206 |
\begin{docTcbKeys}[ |
| 207 |
doc new = 2023-11-13, |
| 208 |
doc description = style, |
| 209 |
] |
| 210 |
{ |
| 211 |
{ doc name = environment lower app, doc parameter={=\meta{name}} }, |
| 212 |
{ doc name = environment lower args app, doc parameter={=\marg{name}\marg{code}} } |
| 213 |
} |
| 214 |
This shortcut style sets \refKey{/tcb/before lower app} |
| 215 |
to |\begin|\marg{name} and \refKey{/tcb/after lower pre} |
| 216 |
to |\end|\marg{name}, i.\,e., the lower part is enclosed by the environment \meta{name}. |
| 217 |
The second variant also places \meta{code} after |\begin|\marg{name}. |
| 218 |
Note that you may need \emph{additional} brackets around \meta{code}, if |
| 219 |
\meta{code} contains some para\-meter(s) for the environment \meta{name}. |
| 220 |
\end{docTcbKeys} |
| 221 |
|
| 222 |
\begin{docTcbKeys}[ |
| 223 |
doc new = 2023-11-13, |
| 224 |
doc description = style, |
| 225 |
] |
| 226 |
{ |
| 227 |
{ doc name = environment lower pre, doc parameter={=\meta{name}} }, |
| 228 |
{ doc name = environment lower args pre, doc parameter={=\marg{name}\marg{code}} } |
| 229 |
} |
| 230 |
This shortcut style sets \refKey{/tcb/before lower pre} |
| 231 |
to |\begin|\marg{name} and \refKey{/tcb/after lower app} |
| 232 |
to |\end|\marg{name}, i.\,e., the lower part is enclosed by the environment \meta{name}. |
| 233 |
The second variant also places \meta{code} after |\begin|\marg{name}. |
| 234 |
Note that you may need \emph{additional} brackets around \meta{code}, if |
| 235 |
\meta{code} contains some para\-meter(s) for the environment \meta{name}. |
| 236 |
\end{docTcbKeys} |
| 237 |
|
| 238 |
|
| 239 |
\clearpage |
| 240 |
\subsection{Embedding into the Surroundings} |
| 241 |
The following option keys extend the options given in Subsection \ref{subsec:surroundings} |
| 242 |
from page \pageref{subsec:surroundings}. |
| 243 |
|
| 244 |
\begin{marker} |
| 245 |
The \enquote{hookable} versions are usable inside the document. |
| 246 |
In the preamble, they can only be used after explicit setting of |
| 247 |
\refKey{/tcb/before} and \refKey{/tcb/after} or by e.\,g.\ \refKey{/tcb/parskip}. |
| 248 |
\end{marker} |
| 249 |
|
| 250 |
\begin{docTcbKey}{before app}{=\meta{code}}{no default} |
| 251 |
Appends the given \meta{code} to \refKey{/tcb/before} before the colored box. |
| 252 |
\end{docTcbKey} |
| 253 |
|
| 254 |
\begin{docTcbKey}{before pre}{=\meta{code}}{no default} |
| 255 |
Prepends the given \meta{code} to \refKey{/tcb/before} before the colored box. |
| 256 |
\end{docTcbKey} |
| 257 |
|
| 258 |
\begin{docTcbKey}{after app}{=\meta{code}}{no default} |
| 259 |
Appends the given \meta{code} to \refKey{/tcb/after} after the colored box. |
| 260 |
\end{docTcbKey} |
| 261 |
|
| 262 |
\begin{docTcbKey}{after pre}{=\meta{code}}{no default} |
| 263 |
Prepends the given \meta{code} to \refKey{/tcb/after} after the colored box. |
| 264 |
\end{docTcbKey} |
| 265 |
|
| 266 |
\begin{dispExample} |
| 267 |
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} |
| 268 |
|
| 269 |
\begin{tcolorbox}[title=My title,before app={The box follows:\\[4pt]}, |
| 270 |
after app={This is the end.}] |
| 271 |
This is a \textbf{tcolorbox}. |
| 272 |
\end{tcolorbox} |
| 273 |
\end{dispExample} |
| 274 |
|
| 275 |
\medskip |
| 276 |
|
| 277 |
\begin{docTcbKey}{before float app}{=\meta{code}}{no default} |
| 278 |
Appends the given \meta{code} to \refKey{/tcb/before float} before the colored box. |
| 279 |
\end{docTcbKey} |
| 280 |
|
| 281 |
\begin{docTcbKey}{before float pre}{=\meta{code}}{no default} |
| 282 |
Prepends the given \meta{code} to \refKey{/tcb/before float} before the colored box. |
| 283 |
\end{docTcbKey} |
| 284 |
|
| 285 |
\begin{docTcbKey}{after float app}{=\meta{code}}{no default} |
| 286 |
Appends the given \meta{code} to \refKey{/tcb/after float} after the colored box. |
| 287 |
\end{docTcbKey} |
| 288 |
|
| 289 |
\begin{docTcbKey}{after float pre}{=\meta{code}}{no default} |
| 290 |
Prepends the given \meta{code} to \refKey{/tcb/after float} after the colored box. |
| 291 |
\end{docTcbKey} |
| 292 |
|
| 293 |
|
| 294 |
\clearpage |
| 295 |
\subsection{Overlays} |
| 296 |
The following option keys extend the options given in Subsection \ref{subsec:overlays} |
| 297 |
from page \pageref{subsec:overlays}. |
| 298 |
|
| 299 |
\begin{docTcbKey}{overlay app}{=\meta{graphical code}}{no default} |
| 300 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay}. |
| 301 |
|
| 302 |
|
| 303 |
\begin{dispExample} |
| 304 |
% \usetikzlibrary{patterns} % preamble |
| 305 |
% \tcbuselibrary{skins} % preamble |
| 306 |
\tcbset{frogbox/.style={enhanced,colback=green!10,colframe=green!65!black, |
| 307 |
enlarge top by=5.5mm, |
| 308 |
overlay={\foreach \x in {2cm,3.5cm} { |
| 309 |
\begin{scope}[shift={([xshift=\x]frame.north west)}] |
| 310 |
\path[draw=green!65!black,fill=green!10,line width=1mm] (0,0) arc (0:180:5mm); |
| 311 |
\path[fill=black] (-0.2,0) arc (0:180:1mm); |
| 312 |
\end{scope}}}}} |
| 313 |
\tcbset{ribbon/.style={overlay app={% |
| 314 |
\path[fill=blue!75!white,draw=blue,double=white!85!blue, |
| 315 |
preaction={opacity=0.6,fill=blue!75!white}, |
| 316 |
line width=0.1mm,double distance=0.2mm, |
| 317 |
pattern=fivepointed stars,pattern color=white!75!blue] |
| 318 |
([xshift=-0.2mm,yshift=-1.02cm]frame.north east) |
| 319 |
-- ++(-1,1) -- ++(-0.5,0) -- ++(1.5,-1.5) -- cycle;}}} |
| 320 |
|
| 321 |
\begin{tcolorbox}[frogbox,title=My title] |
| 322 |
This is a \textbf{tcolorbox}. |
| 323 |
\end{tcolorbox} |
| 324 |
|
| 325 |
\begin{tcolorbox}[frogbox,ribbon,title=My title] |
| 326 |
This is a \textbf{tcolorbox}.\par |
| 327 |
Here, we apply a second overlay. |
| 328 |
\end{tcolorbox} |
| 329 |
\end{dispExample} |
| 330 |
\end{docTcbKey} |
| 331 |
|
| 332 |
\begin{docTcbKey}{overlay pre}{=\meta{graphical code}}{no default} |
| 333 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay}. |
| 334 |
\end{docTcbKey} |
| 335 |
|
| 336 |
\begin{docTcbKey}{overlay unbroken app}{=\meta{graphical code}}{no default} |
| 337 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken}. |
| 338 |
\end{docTcbKey} |
| 339 |
|
| 340 |
\begin{docTcbKey}{overlay unbroken pre}{=\meta{graphical code}}{no default} |
| 341 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken}. |
| 342 |
\end{docTcbKey} |
| 343 |
|
| 344 |
\begin{docTcbKey}{overlay first app}{=\meta{graphical code}}{no default} |
| 345 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay first}. |
| 346 |
\end{docTcbKey} |
| 347 |
|
| 348 |
\begin{docTcbKey}{overlay first pre}{=\meta{graphical code}}{no default} |
| 349 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay first}. |
| 350 |
\end{docTcbKey} |
| 351 |
|
| 352 |
\clearpage |
| 353 |
\begin{docTcbKey}{overlay middle app}{=\meta{graphical code}}{no default} |
| 354 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay middle}. |
| 355 |
\end{docTcbKey} |
| 356 |
|
| 357 |
\begin{docTcbKey}{overlay middle pre}{=\meta{graphical code}}{no default} |
| 358 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay middle}. |
| 359 |
\end{docTcbKey} |
| 360 |
|
| 361 |
\begin{docTcbKey}{overlay last app}{=\meta{graphical code}}{no default} |
| 362 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay last}. |
| 363 |
\end{docTcbKey} |
| 364 |
|
| 365 |
\begin{docTcbKey}{overlay last pre}{=\meta{graphical code}}{no default} |
| 366 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay last}. |
| 367 |
\end{docTcbKey} |
| 368 |
|
| 369 |
\begin{docTcbKey}{overlay broken app}{=\meta{graphical code}}{no default} |
| 370 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay broken}. |
| 371 |
\end{docTcbKey} |
| 372 |
|
| 373 |
\begin{docTcbKey}{overlay broken pre}{=\meta{graphical code}}{no default} |
| 374 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay broken}. |
| 375 |
\end{docTcbKey} |
| 376 |
|
| 377 |
\begin{docTcbKey}{overlay unbroken and first app}{=\meta{graphical code}}{no default} |
| 378 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken and first}. |
| 379 |
\end{docTcbKey} |
| 380 |
|
| 381 |
\begin{docTcbKey}{overlay unbroken and first pre}{=\meta{graphical code}}{no default} |
| 382 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken and first}. |
| 383 |
\end{docTcbKey} |
| 384 |
|
| 385 |
\begin{docTcbKey}{overlay middle and last app}{=\meta{graphical code}}{no default} |
| 386 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay middle and last}. |
| 387 |
\end{docTcbKey} |
| 388 |
|
| 389 |
\begin{docTcbKey}{overlay middle and last pre}{=\meta{graphical code}}{no default} |
| 390 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay middle and last}. |
| 391 |
\end{docTcbKey} |
| 392 |
|
| 393 |
\begin{docTcbKey}{overlay unbroken and last app}{=\meta{graphical code}}{no default} |
| 394 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken and last}. |
| 395 |
\end{docTcbKey} |
| 396 |
|
| 397 |
\begin{docTcbKey}{overlay unbroken and last pre}{=\meta{graphical code}}{no default} |
| 398 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken and last}. |
| 399 |
\end{docTcbKey} |
| 400 |
|
| 401 |
\begin{docTcbKey}[][doc new=2014-09-19]{overlay first and middle app}{=\meta{graphical code}}{no default} |
| 402 |
Appends the given \meta{graphical code} to \refKey{/tcb/overlay first and middle}. |
| 403 |
\end{docTcbKey} |
| 404 |
|
| 405 |
\begin{docTcbKey}[][doc new=2014-09-19]{overlay first and middle pre}{=\meta{graphical code}}{no default} |
| 406 |
Prepends the given \meta{graphical code} to \refKey{/tcb/overlay first and middle}. |
| 407 |
\end{docTcbKey} |
| 408 |
|
| 409 |
|
| 410 |
\clearpage |
| 411 |
\subsection{Watermarks} |
| 412 |
The following option keys extend the options given in Subsection \ref{subsec:watermarks} |
| 413 |
from page \pageref{subsec:watermarks}. |
| 414 |
|
| 415 |
\begin{marker} |
| 416 |
Watermarks are special overlays. The \mylib{hooks} library allows the combination |
| 417 |
of several watermarks and overlays. |
| 418 |
\end{marker} |
| 419 |
|
| 420 |
\begin{docTcbKey}{watermark text app}{=\meta{text}}{no default} |
| 421 |
Appends a \refKey{/tcb/watermark text} to the colored box. |
| 422 |
\begin{dispExample} |
| 423 |
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} |
| 424 |
|
| 425 |
\begin{tcolorbox}[enhanced,title=My title,watermark graphics=Basilica_5.png, |
| 426 |
watermark opacity=0.25, |
| 427 |
watermark text app=Basilica,watermark color=Navy |
| 428 |
] |
| 429 |
\lipsum[1-2] |
| 430 |
\tcblower |
| 431 |
This example uses a public domain picture from\\ |
| 432 |
\url{http://commons.wikimedia.org/wiki/File:Basilica_5.png} |
| 433 |
\end{tcolorbox} |
| 434 |
\end{dispExample} |
| 435 |
\end{docTcbKey} |
| 436 |
|
| 437 |
\begin{docTcbKey}{watermark text pre}{=\meta{text}}{no default} |
| 438 |
Prepends a \refKey{/tcb/watermark text} to the colored box. |
| 439 |
\end{docTcbKey} |
| 440 |
|
| 441 |
\begin{docTcbKey}{watermark text app on}{=\meta{part} is \meta{text}}{no default} |
| 442 |
Appends a \refKey{/tcb/watermark text on} the named \meta{part} of a break sequence. |
| 443 |
\end{docTcbKey} |
| 444 |
|
| 445 |
\begin{docTcbKey}{watermark text pre on}{=\meta{part} is \meta{text}}{no default} |
| 446 |
Prepends a \refKey{/tcb/watermark text on} the named \meta{part} of a break sequence. |
| 447 |
\end{docTcbKey} |
| 448 |
|
| 449 |
\clearpage |
| 450 |
\begin{docTcbKey}{watermark graphics app}{=\meta{file name}}{no default} |
| 451 |
Appends a \refKey{/tcb/watermark graphics} referenced by \meta{file name} to the colored box. |
| 452 |
\end{docTcbKey} |
| 453 |
|
| 454 |
\begin{docTcbKey}{watermark graphics pre}{=\meta{file name}}{no default} |
| 455 |
Prepends a \refKey{/tcb/watermark graphics} referenced by \meta{file name} to the colored box. |
| 456 |
\end{docTcbKey} |
| 457 |
|
| 458 |
\begin{docTcbKey}{watermark graphics app on}{=\meta{part} is \meta{file name}}{no default} |
| 459 |
Appends a \refKey{/tcb/watermark graphics on} the named \meta{part} of a break sequence. |
| 460 |
The picture is referenced by \meta{file name}. |
| 461 |
\end{docTcbKey} |
| 462 |
|
| 463 |
|
| 464 |
\begin{docTcbKey}{watermark graphics pre on}{=\meta{part} is \meta{file name}}{no default} |
| 465 |
Prepends a \refKey{/tcb/watermark graphics on} the named \meta{part} of a break sequence. |
| 466 |
The picture is referenced by \meta{file name}. |
| 467 |
\end{docTcbKey} |
| 468 |
|
| 469 |
|
| 470 |
\begin{docTcbKey}{watermark tikz app}{=\meta{graphical code}}{no default} |
| 471 |
Appends a \refKey{/tcb/watermark tikz} with the given \tikzname\ \meta{graphical code} to the colored box. |
| 472 |
\end{docTcbKey} |
| 473 |
|
| 474 |
\begin{docTcbKey}{watermark tikz pre}{=\meta{graphical code}}{no default} |
| 475 |
Prepends a \refKey{/tcb/watermark tikz} with the given \tikzname\ \meta{graphical code} to the colored box. |
| 476 |
|
| 477 |
\begin{dispExample} |
| 478 |
% \tcbuselibrary{skins} |
| 479 |
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, |
| 480 |
watermark color=Navy,watermark opacity=0.25, |
| 481 |
smiley/.style={watermark tikz pre={% |
| 482 |
\path[fill=yellow,draw=yellow!75!red] (0,0) circle (1cm); |
| 483 |
\fill[red] (45:5mm) circle (1mm); |
| 484 |
\fill[red] (135:5mm) circle (1mm); |
| 485 |
\draw[line width=1mm,red] (215:5mm) arc (215:325:5mm);}}} |
| 486 |
|
| 487 |
\begin{tcolorbox}[enhanced,title=My title, watermark text=Watermark, |
| 488 |
smiley] |
| 489 |
\lipsum[1-2] |
| 490 |
\end{tcolorbox} |
| 491 |
\end{dispExample} |
| 492 |
\end{docTcbKey} |
| 493 |
|
| 494 |
\enlargethispage*{1cm} |
| 495 |
|
| 496 |
\begin{docTcbKey}{watermark tikz app on}{=\meta{part} is \meta{graphical code}}{no default} |
| 497 |
Appends a \refKey{/tcb/watermark tikz on} the named \meta{part} of a break sequence. |
| 498 |
\end{docTcbKey} |
| 499 |
|
| 500 |
\begin{docTcbKey}{watermark tikz pre on}{=\meta{part} is \meta{graphical code}}{no default} |
| 501 |
Prepends a \refKey{/tcb/watermark tikz on} the named \meta{part} of a break sequence. |
| 502 |
\end{docTcbKey} |
| 503 |
|
| 504 |
|
| 505 |
\clearpage |
| 506 |
\subsection{Underlays} |
| 507 |
The following option keys extend the options given in \zvref{subsec:skinunderlay}. |
| 508 |
There are no |app| type keys since underlays are stackable by default. |
| 509 |
|
| 510 |
\begin{docTcbKey}{underlay pre}{=\meta{graphical code}}{no default} |
| 511 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay}. |
| 512 |
\end{docTcbKey} |
| 513 |
|
| 514 |
\begin{docTcbKey}{underlay unbroken pre}{=\meta{graphical code}}{no default} |
| 515 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay unbroken}. |
| 516 |
\end{docTcbKey} |
| 517 |
|
| 518 |
\begin{docTcbKey}{underlay first pre}{=\meta{graphical code}}{no default} |
| 519 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay first}. |
| 520 |
\end{docTcbKey} |
| 521 |
|
| 522 |
\begin{docTcbKey}{underlay middle pre}{=\meta{graphical code}}{no default} |
| 523 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay middle}. |
| 524 |
\end{docTcbKey} |
| 525 |
|
| 526 |
\begin{docTcbKey}{underlay last pre}{=\meta{graphical code}}{no default} |
| 527 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay last}. |
| 528 |
\end{docTcbKey} |
| 529 |
|
| 530 |
\begin{docTcbKey}{underlay boxed title pre}{=\meta{graphical code}}{no default} |
| 531 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay boxed title}. |
| 532 |
\end{docTcbKey} |
| 533 |
|
| 534 |
\begin{docTcbKey}{underlay broken pre}{=\meta{graphical code}}{no default} |
| 535 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay broken}. |
| 536 |
\end{docTcbKey} |
| 537 |
|
| 538 |
\begin{docTcbKey}{underlay unbroken and first pre}{=\meta{graphical code}}{no default} |
| 539 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay unbroken and first}. |
| 540 |
\end{docTcbKey} |
| 541 |
|
| 542 |
\begin{docTcbKey}{underlay middle and last pre}{=\meta{graphical code}}{no default} |
| 543 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay middle and last}. |
| 544 |
\end{docTcbKey} |
| 545 |
|
| 546 |
\begin{docTcbKey}{underlay unbroken and last pre}{=\meta{graphical code}}{no default} |
| 547 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay unbroken and last}. |
| 548 |
\end{docTcbKey} |
| 549 |
|
| 550 |
\begin{docTcbKey}[][doc new=2014-09-19]{underlay first and middle pre}{=\meta{graphical code}}{no default} |
| 551 |
Prepends the given \meta{graphical code} to \refKey{/tcb/underlay first and middle}. |
| 552 |
\end{docTcbKey} |
| 553 |
|
| 554 |
|
| 555 |
\clearpage |
| 556 |
\subsection{Finishes} |
| 557 |
The following option keys extend the options given in \zvref{subsec:skinfinish}. |
| 558 |
There are no |app| type keys since finishes are stackable by default. |
| 559 |
|
| 560 |
\begin{docTcbKey}{finish pre}{=\meta{graphical code}}{no default} |
| 561 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish}. |
| 562 |
\end{docTcbKey} |
| 563 |
|
| 564 |
\begin{docTcbKey}{finish unbroken pre}{=\meta{graphical code}}{no default} |
| 565 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish unbroken}. |
| 566 |
\end{docTcbKey} |
| 567 |
|
| 568 |
\begin{docTcbKey}{finish first pre}{=\meta{graphical code}}{no default} |
| 569 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish first}. |
| 570 |
\end{docTcbKey} |
| 571 |
|
| 572 |
\begin{docTcbKey}{finish middle pre}{=\meta{graphical code}}{no default} |
| 573 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish middle}. |
| 574 |
\end{docTcbKey} |
| 575 |
|
| 576 |
\begin{docTcbKey}{finish last pre}{=\meta{graphical code}}{no default} |
| 577 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish last}. |
| 578 |
\end{docTcbKey} |
| 579 |
|
| 580 |
\begin{docTcbKey}{finish broken pre}{=\meta{graphical code}}{no default} |
| 581 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish broken}. |
| 582 |
\end{docTcbKey} |
| 583 |
|
| 584 |
\begin{docTcbKey}{finish unbroken and first pre}{=\meta{graphical code}}{no default} |
| 585 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish unbroken and first}. |
| 586 |
\end{docTcbKey} |
| 587 |
|
| 588 |
\begin{docTcbKey}{finish middle and last pre}{=\meta{graphical code}}{no default} |
| 589 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish middle and last}. |
| 590 |
\end{docTcbKey} |
| 591 |
|
| 592 |
\begin{docTcbKey}{finish unbroken and last pre}{=\meta{graphical code}}{no default} |
| 593 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish unbroken and last}. |
| 594 |
\end{docTcbKey} |
| 595 |
|
| 596 |
\begin{docTcbKey}[][doc new=2014-09-19]{finish first and middle pre}{=\meta{graphical code}}{no default} |
| 597 |
Prepends the given \meta{graphical code} to \refKey{/tcb/finish first and middle}. |
| 598 |
\end{docTcbKey} |
| 599 |
|
| 600 |
|
| 601 |
\subsection{Skin Code} |
| 602 |
The following option keys extend the options given in Subsection~\ref{subsec:addcodeoptions} |
| 603 |
from page~\pageref{subsec:addcodeoptions}. |
| 604 |
|
| 605 |
\begin{docTcbKey}{frame code app}{=\meta{graphical code}}{no default} |
| 606 |
Appends the given \meta{graphical code} to \refKey{/tcb/frame code}. |
| 607 |
\end{docTcbKey} |
| 608 |
|
| 609 |
\begin{docTcbKey}{frame code pre}{=\meta{graphical code}}{no default} |
| 610 |
Prepends the given \meta{graphical code} to \refKey{/tcb/frame code}. |
| 611 |
\end{docTcbKey} |
| 612 |
|
| 613 |
\begin{docTcbKey}{interior titled code app}{=\meta{graphical code}}{no default} |
| 614 |
Appends the given \meta{graphical code} to \refKey{/tcb/interior titled code}. |
| 615 |
\begin{dispExample} |
| 616 |
\begin{tcolorbox}[title=My title,enhanced,colframe=Navy, |
| 617 |
frame code app={\draw[yellow,line width=1cm] ( |
| 618 |
frame.south west)--(frame.north east);}, |
| 619 |
interior titled code app={\draw[red,line width=1cm] |
| 620 |
(frame.north west)--(frame.south east);}, |
| 621 |
] |
| 622 |
\lipsum[1] |
| 623 |
\end{tcolorbox} |
| 624 |
\end{dispExample} |
| 625 |
\end{docTcbKey} |
| 626 |
|
| 627 |
\begin{docTcbKey}{interior titled code pre}{=\meta{graphical code}}{no default} |
| 628 |
Prepends the given \meta{graphical code} to \refKey{/tcb/interior titled code}. |
| 629 |
\end{docTcbKey} |
| 630 |
|
| 631 |
\begin{docTcbKey}{interior code app}{=\meta{graphical code}}{no default} |
| 632 |
Appends the given \meta{graphical code} to \refKey{/tcb/interior code}. |
| 633 |
\end{docTcbKey} |
| 634 |
|
| 635 |
\begin{docTcbKey}{interior code pre}{=\meta{graphical code}}{no default} |
| 636 |
Prepends the given \meta{graphical code} to \refKey{/tcb/interior code}. |
| 637 |
\end{docTcbKey} |
| 638 |
|
| 639 |
\begin{docTcbKey}{segmentation code app}{=\meta{graphical code}}{no default} |
| 640 |
Appends the given \meta{graphical code} to \refKey{/tcb/segmentation code}. |
| 641 |
\end{docTcbKey} |
| 642 |
|
| 643 |
\begin{docTcbKey}{segmentation code pre}{=\meta{graphical code}}{no default} |
| 644 |
Prepends the given \meta{graphical code} to \refKey{/tcb/segmentation code}. |
| 645 |
\end{docTcbKey} |
| 646 |
|
| 647 |
|
| 648 |
\begin{docTcbKey}{title code app}{=\meta{graphical code}}{no default} |
| 649 |
Appends the given \meta{graphical code} to \refKey{/tcb/title code}. |
| 650 |
\end{docTcbKey} |
| 651 |
|
| 652 |
\begin{docTcbKey}{title code pre}{=\meta{graphical code}}{no default} |
| 653 |
Prepends the given \meta{graphical code} to \refKey{/tcb/title code}. |
| 654 |
\end{docTcbKey} |
| 655 |
|
| 656 |
|
| 657 |
\clearpage |
| 658 |
\subsection{Extras} |
| 659 |
The following option keys extend the options given in \zvref{subsec:extras}. |
| 660 |
There are no |app| type keys since extras are stackable by default. |
| 661 |
|
| 662 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras pre}{=\marg{options}}{no default} |
| 663 |
Prepends the given \meta{options} to \refKey{/tcb/extras}. |
| 664 |
\end{docTcbKey} |
| 665 |
|
| 666 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras unbroken pre}{=\marg{options}}{no default} |
| 667 |
Prepends the given \meta{options} to \refKey{/tcb/extras unbroken}. |
| 668 |
\end{docTcbKey} |
| 669 |
|
| 670 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras first pre}{=\marg{options}}{no default} |
| 671 |
Prepends the given \meta{options} to \refKey{/tcb/extras first}. |
| 672 |
\end{docTcbKey} |
| 673 |
|
| 674 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras middle pre}{=\marg{options}}{no default} |
| 675 |
Prepends the given \meta{options} to \refKey{/tcb/extras middle}. |
| 676 |
\end{docTcbKey} |
| 677 |
|
| 678 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras last pre}{=\marg{options}}{no default} |
| 679 |
Prepends the given \meta{options} to \refKey{/tcb/extras last}. |
| 680 |
\end{docTcbKey} |
| 681 |
|
| 682 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras broken pre}{=\marg{options}}{no default} |
| 683 |
Prepends the given \meta{options} to \refKey{/tcb/extras broken}. |
| 684 |
\end{docTcbKey} |
| 685 |
|
| 686 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras unbroken and first pre}{=\marg{options}}{no default} |
| 687 |
Prepends the given \meta{options} to \refKey{/tcb/extras unbroken and first}. |
| 688 |
\end{docTcbKey} |
| 689 |
|
| 690 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras middle and last pre}{=\marg{options}}{no default} |
| 691 |
Prepends the given \meta{options} to \refKey{/tcb/extras middle and last}. |
| 692 |
\end{docTcbKey} |
| 693 |
|
| 694 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras unbroken and last pre}{=\marg{options}}{no default} |
| 695 |
Prepends the given \meta{options} to \refKey{/tcb/extras unbroken and last}. |
| 696 |
\end{docTcbKey} |
| 697 |
|
| 698 |
\begin{docTcbKey}[][doc new=2015-07-16]{extras first and middle pre}{=\marg{options}}{no default} |
| 699 |
Prepends the given \meta{options} to \refKey{/tcb/extras first and middle}. |
| 700 |
\end{docTcbKey} |
| 701 |
|
| 702 |
|
| 703 |
\subsection{Listings} |
| 704 |
The following option keys extend the options given in |
| 705 |
Section~\ref{sec:listings} |
| 706 |
from page~\pageref{sec:listings}. |
| 707 |
|
| 708 |
|
| 709 |
\begin{docTcbKey}[][doc new=2019-07-11]{listing options app}{=\marg{options}}{no default} |
| 710 |
Appends the given \meta{options} to \refKey{/tcb/listing options}. |
| 711 |
\end{docTcbKey} |
| 712 |
|
| 713 |
\begin{docTcbKey}[][doc new=2019-07-11]{listing options pre}{=\marg{options}}{no default} |
| 714 |
Prepends the given \meta{options} to \refKey{/tcb/listing options}. |
| 715 |
\end{docTcbKey} |
| 716 |
|
| 717 |
\begin{docTcbKey}[][doc new=2019-07-11]{minted options app}{=\marg{options}}{no default} |
| 718 |
Appends the given \meta{options} to \refKey{/tcb/minted options}. |
| 719 |
\end{docTcbKey} |
| 720 |
|
| 721 |
\begin{docTcbKey}[][doc new=2019-07-11]{minted options pre}{=\marg{options}}{no default} |
| 722 |
Prepends the given \meta{options} to \refKey{/tcb/minted options}. |
| 723 |
\end{docTcbKey} |
| 724 |
|
| 725 |
|