| 1 |
% !TeX root = tcolorbox.tex |
| 2 |
% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) |
| 3 |
\clearpage |
| 4 |
\section{Library \mylib{skins}}\label{sec:skins}% |
| 5 |
\tcbset{external/prefix=external/skins_}% |
| 6 |
The library is loaded by a package option or inside the preamble by: |
| 7 |
\begin{dispListing} |
| 8 |
\tcbuselibrary{skins} |
| 9 |
\end{dispListing} |
| 10 |
This also loads the package \refPkg[tikzfill]{tikzfill.image}. |
| 11 |
|
| 12 |
In the following, general settings and options of the library are |
| 13 |
documented. |
| 14 |
The actual catalog of skins is found in \zvref{sec:skincatalog}. |
| 15 |
|
| 16 |
\subsection{Style Option Keys}\label{subsec:addstyleoptions} |
| 17 |
The following style options are applicable for all skins which |
| 18 |
use engines of type |path|, |pathfirst|, |pathmiddle|, or |pathlast|. |
| 19 |
Especially, the skin \refSkin{enhanced} supports \emph{all} of them |
| 20 |
and \refSkin{standard} \emph{none}. |
| 21 |
|
| 22 |
\begin{docTcbKey}{frame style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} |
| 23 |
The \meta{\texttt{\upshape tikz} keys} are used inside the \tikzname\ path command |
| 24 |
for drawing the \emph{frame} of the box.\\ |
| 25 |
This option is available if the \refKey{/tcb/frame engine} is set to |
| 26 |
|path|, |pathfirst|, |pathmiddle|, or |pathlast|. |
| 27 |
It is \emph{not} available for |standard|. |
| 28 |
\begin{exdispExample*}{frame_style}{sbs,lefthand ratio=0.66} |
| 29 |
\tcbset{colback=red!5!white,fonttitle=\bfseries} |
| 30 |
|
| 31 |
\begin{tcolorbox}[enhanced,title=My title, |
| 32 |
frame style={left color=red!75!black, |
| 33 |
right color=blue!75!black}] |
| 34 |
This is a \textbf{tcolorbox}. |
| 35 |
\tcblower |
| 36 |
This is the lower part. |
| 37 |
\end{tcolorbox} |
| 38 |
\end{exdispExample*} |
| 39 |
\end{docTcbKey} |
| 40 |
|
| 41 |
|
| 42 |
\begin{docTcbKey}{frame style image}{=\meta{file name}}{no default, initially unset} |
| 43 |
Fills the frame with an external image referenced by \meta{file name}. |
| 44 |
\begin{exdispExample*}{frame_style_image}{sbs,lefthand ratio=0.66} |
| 45 |
\tcbset{colback=red!5!white,fonttitle=\bfseries} |
| 46 |
|
| 47 |
\begin{tcolorbox}[enhanced,title=My title, |
| 48 |
frame style image=blueshade.png] |
| 49 |
This is a \textbf{tcolorbox}. |
| 50 |
\tcblower |
| 51 |
This is the lower part. |
| 52 |
\end{tcolorbox} |
| 53 |
\end{exdispExample*} |
| 54 |
\end{docTcbKey} |
| 55 |
|
| 56 |
\clearpage |
| 57 |
\begin{docTcbKey}{frame style tile}{=\marg{graphics options}\marg{file name}}{no default, initially unset} |
| 58 |
Fills the frame with a tile pattern based on an external image referenced by \meta{file name}. |
| 59 |
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. |
| 60 |
\begin{exdispExample*}{frame_style_tile}{sbs,lefthand ratio=0.66} |
| 61 |
\tcbset{colback=red!5!white,coltitle=red!30!black, |
| 62 |
opacityback=0.75,fonttitle=\bfseries} |
| 63 |
|
| 64 |
\begin{tcolorbox}[enhanced,title=My title, |
| 65 |
frame style tile={width=1cm}{pink_marble.png}] |
| 66 |
This is a \textbf{tcolorbox}. |
| 67 |
\tcblower |
| 68 |
This is the lower part. |
| 69 |
\end{tcolorbox} |
| 70 |
\end{exdispExample*} |
| 71 |
\end{docTcbKey} |
| 72 |
|
| 73 |
|
| 74 |
\begin{docTcbKey}{frame hidden}{}{style, no value} |
| 75 |
This is a shortcut for |frame style={draw=none,fill=none}|. |
| 76 |
Depending on the skin, this option switches off the drawing of the |
| 77 |
frame. |
| 78 |
Alternatively, use \refKey{/tcb/frame empty}. |
| 79 |
\begin{exdispExample*}{frame_hidden}{sbs,lefthand ratio=0.66} |
| 80 |
\tcbset{colback=red!5!white,colframe=red!75!black, |
| 81 |
fonttitle=\bfseries,coltitle=black} |
| 82 |
|
| 83 |
\begin{tcolorbox}[enhanced,title=My title, |
| 84 |
frame hidden] |
| 85 |
This is a \textbf{tcolorbox}. |
| 86 |
\tcblower |
| 87 |
This is the lower part. |
| 88 |
\end{tcolorbox} |
| 89 |
\end{exdispExample*} |
| 90 |
\end{docTcbKey} |
| 91 |
|
| 92 |
|
| 93 |
\begin{docTcbKey}{interior style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} |
| 94 |
The \meta{\texttt{\upshape tikz} keys} are used inside the \tikzname\ path command |
| 95 |
for drawing the \emph{interior} of the box. They are used for the titled |
| 96 |
and for the untitled version as well.\\ |
| 97 |
This option is available if the \refKey{/tcb/interior titled engine} |
| 98 |
or \refKey{/tcb/interior engine} is set to |
| 99 |
|path|, |pathfirst|, |pathmiddle|, or |pathlast|. |
| 100 |
It is \emph{not} available for |standard|. |
| 101 |
\begin{exdispExample*}{interior_style}{sbs,lefthand ratio=0.66} |
| 102 |
\tcbset{colframe=red!75!black,fonttitle=\bfseries} |
| 103 |
|
| 104 |
\begin{tcolorbox}[enhanced,title=My title, |
| 105 |
interior style={left color=red!20!white, |
| 106 |
right color=yellow!50!white}] |
| 107 |
This is a \textbf{tcolorbox}. |
| 108 |
\tcblower |
| 109 |
This is the lower part. |
| 110 |
\end{tcolorbox} |
| 111 |
\end{exdispExample*} |
| 112 |
\end{docTcbKey} |
| 113 |
|
| 114 |
\clearpage |
| 115 |
\begin{docTcbKey}{interior style image}{=\meta{file name}}{no default, initially unset} |
| 116 |
Fills the interior with an external image referenced by \meta{file name}. |
| 117 |
\begin{exdispExample*}{interior_style_image}{sbs,lefthand ratio=0.66} |
| 118 |
\tcbset{colframe=red!75!black,fonttitle=\bfseries} |
| 119 |
|
| 120 |
\begin{tcolorbox}[enhanced,title=My title, |
| 121 |
interior style image=goldshade.png] |
| 122 |
This is a \textbf{tcolorbox}. |
| 123 |
\tcblower |
| 124 |
This is the lower part. |
| 125 |
\end{tcolorbox} |
| 126 |
\end{exdispExample*} |
| 127 |
\end{docTcbKey} |
| 128 |
|
| 129 |
|
| 130 |
\begin{docTcbKey}{interior style tile}{=\marg{graphics options}\marg{file name}}{no default, initially unset} |
| 131 |
Fills the interior with a tile pattern based on an external image referenced by \meta{file name}. |
| 132 |
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. |
| 133 |
\begin{exdispExample*}{interior_style_tile}{sbs,lefthand ratio=0.66} |
| 134 |
\tcbset{colframe=red!75!black,fonttitle=\bfseries} |
| 135 |
|
| 136 |
\begin{tcolorbox}[enhanced,title=My title, |
| 137 |
interior style tile={width=2cm}{crinklepaper.png}] |
| 138 |
This is a \textbf{tcolorbox}. |
| 139 |
\tcblower |
| 140 |
This is the lower part. |
| 141 |
\end{tcolorbox} |
| 142 |
\end{exdispExample*} |
| 143 |
\end{docTcbKey} |
| 144 |
|
| 145 |
|
| 146 |
\begin{docTcbKey}{interior hidden}{}{style, no value} |
| 147 |
This is a shortcut for |interior style={draw=none,fill=none}|. |
| 148 |
Depending on the skin, this option switches off the drawing of the |
| 149 |
interior. |
| 150 |
Alternatively, use \refKey{/tcb/interior empty} and/or \refKey{/tcb/interior titled empty}. |
| 151 |
\begin{exdispExample*}{interior_hidden}{sbs,lefthand ratio=0.66} |
| 152 |
\tcbset{frame style={top color=red!20!white, |
| 153 |
bottom color=red!20!white!75!black}, |
| 154 |
fonttitle=\bfseries,coltitle=black} |
| 155 |
|
| 156 |
\begin{tcolorbox}[enhanced,title=My title, |
| 157 |
interior hidden] |
| 158 |
This is a \textbf{tcolorbox}. |
| 159 |
\tcblower |
| 160 |
This is the lower part. |
| 161 |
\end{tcolorbox} |
| 162 |
\end{exdispExample*} |
| 163 |
\end{docTcbKey} |
| 164 |
|
| 165 |
\clearpage |
| 166 |
\begin{docTcbKey}{segmentation style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} |
| 167 |
The \meta{\texttt{\upshape tikz} keys} are used inside the \tikzname\ path command |
| 168 |
for drawing the \emph{segmentation} line of the box.\\ |
| 169 |
This option is available if the \refKey{/tcb/segmentation engine} |
| 170 |
is set to |path|. |
| 171 |
It is \emph{not} available for |standard|. |
| 172 |
\begin{exdispExample*}{segmentation_style}{sbs,lefthand ratio=0.66} |
| 173 |
\tcbset{colback=red!5!white,colframe=red!75!black, |
| 174 |
fonttitle=\bfseries} |
| 175 |
|
| 176 |
\begin{tcolorbox}[enhanced,title=My title, |
| 177 |
segmentation style={double=white,draw=blue, |
| 178 |
double distance=1pt,solid}] |
| 179 |
This is a \textbf{tcolorbox}. |
| 180 |
\tcblower |
| 181 |
This is the lower part. |
| 182 |
\end{tcolorbox} |
| 183 |
\end{exdispExample*} |
| 184 |
\end{docTcbKey} |
| 185 |
|
| 186 |
|
| 187 |
\begin{docTcbKey}{segmentation hidden}{}{style, no value} |
| 188 |
This is a shortcut for |segmentation style={draw=none,fill=none}|. |
| 189 |
Depending on the skin, this option switches off the drawing of the |
| 190 |
segmentation line. See also \refKey{/tcb/lower separated} which |
| 191 |
has the same effect for most skins. |
| 192 |
Alternatively, use \refKey{/tcb/segmentation empty}. |
| 193 |
\begin{exdispExample*}{segmentation_hidden}{sbs,lefthand ratio=0.66} |
| 194 |
\tcbset{colback=red!5!white,colframe=red!75!black, |
| 195 |
fonttitle=\bfseries} |
| 196 |
|
| 197 |
\begin{tcolorbox}[title=My title, |
| 198 |
enhanced,segmentation hidden] |
| 199 |
This is a \textbf{tcolorbox}. |
| 200 |
\tcblower |
| 201 |
This is the lower part. |
| 202 |
\end{tcolorbox} |
| 203 |
\end{exdispExample*} |
| 204 |
\end{docTcbKey} |
| 205 |
|
| 206 |
|
| 207 |
\begin{docTcbKey}{title style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} |
| 208 |
The \meta{\texttt{\upshape tikz} keys} are used inside the \tikzname\ path command |
| 209 |
for drawing the \emph{title area} of the box.\\ |
| 210 |
This option is available if the \refKey{/tcb/title engine} is set to |
| 211 |
|path|, |pathfirst|, |pathmiddle|, or |pathlast|. |
| 212 |
It is \emph{not} available for |standard|. |
| 213 |
\begin{exdispExample*}{title_style}{sbs,lefthand ratio=0.66} |
| 214 |
\tcbset{colback=red!5!white,colframe=red!75!black, |
| 215 |
coltitle=blue!50!black,fonttitle=\bfseries} |
| 216 |
|
| 217 |
\begin{tcolorbox}[enhanced,title=My title, |
| 218 |
title style={left color=blue!15!yellow, |
| 219 |
right color=red!85!black}] |
| 220 |
This is a \textbf{tcolorbox}. |
| 221 |
\tcblower |
| 222 |
This is the lower part. |
| 223 |
\end{tcolorbox} |
| 224 |
\end{exdispExample*} |
| 225 |
\end{docTcbKey} |
| 226 |
|
| 227 |
\clearpage |
| 228 |
\begin{docTcbKey}{title style image}{=\meta{file name}}{no default, initially unset} |
| 229 |
Fills the title area with an external image referenced by \meta{file name}. |
| 230 |
\begin{exdispExample*}{title_style_image}{sbs,lefthand ratio=0.66} |
| 231 |
\tcbset{colback=blue!5!white,colframe=blue!75!black, |
| 232 |
fonttitle=\bfseries} |
| 233 |
|
| 234 |
\begin{tcolorbox}[enhanced,title=My title, |
| 235 |
title style image=blueshade.png] |
| 236 |
This is a \textbf{tcolorbox}. |
| 237 |
\tcblower |
| 238 |
This is the lower part. |
| 239 |
\end{tcolorbox} |
| 240 |
\end{exdispExample*} |
| 241 |
\end{docTcbKey} |
| 242 |
|
| 243 |
|
| 244 |
\begin{docTcbKey}{title style tile}{=\marg{graphics options}\marg{file name}}{no default, initially unset} |
| 245 |
Fills the title area with a tile pattern based on an external image referenced by \meta{file name}. |
| 246 |
The \meta{graphics options} are given to the underlying \docAuxCommand*{includegraphics} command. |
| 247 |
\begin{exdispExample*}{title_style_tile}{sbs,lefthand ratio=0.66} |
| 248 |
\tcbset{colback=red!5!white,colframe=red!75!black, |
| 249 |
coltitle=blue!50!black,fonttitle=\bfseries} |
| 250 |
|
| 251 |
\begin{tcolorbox}[enhanced,title=My title, |
| 252 |
title style tile={width=1cm}{pink_marble.png}] |
| 253 |
This is a \textbf{tcolorbox}. |
| 254 |
\tcblower |
| 255 |
This is the lower part. |
| 256 |
\end{tcolorbox} |
| 257 |
\end{exdispExample*} |
| 258 |
\end{docTcbKey} |
| 259 |
|
| 260 |
|
| 261 |
\begin{docTcbKey}{title hidden}{}{style, no value} |
| 262 |
This is a shortcut for |title style={draw=none,fill=none}|. |
| 263 |
Depending on the skin, this option switches off the drawing of the |
| 264 |
title background. See also \refKey{/tcb/title filled} for a similar effect. |
| 265 |
Alternatively, use \refKey{/tcb/title empty}. |
| 266 |
\begin{exdispExample*}{title_hidden}{sbs,lefthand ratio=0.66} |
| 267 |
\tcbset{colback=red!5!white,colframe=red!75!black, |
| 268 |
fonttitle=\bfseries} |
| 269 |
|
| 270 |
\begin{tcolorbox}[title=My title, |
| 271 |
enhanced,title hidden] |
| 272 |
This is a \textbf{tcolorbox}. |
| 273 |
\tcblower |
| 274 |
This is the lower part. |
| 275 |
\end{tcolorbox} |
| 276 |
\end{exdispExample*} |
| 277 |
\end{docTcbKey} |
| 278 |
|
| 279 |
|
| 280 |
\clearpage |
| 281 |
|
| 282 |
|
| 283 |
\begin{docTcbKey}[][doc new=2015-01-14]{titlerule style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} |
| 284 |
The \meta{\texttt{\upshape tikz} keys} are used to draw a title rule, |
| 285 |
i.\,e., a rule below the optional title. The width of the rule is controlled |
| 286 |
by \refKey{/tcb/titlerule}. It may be set directly to a smaller width |
| 287 |
to create mixed effects with the standard rule. |
| 288 |
This option is implemented as an \refKey{/tcb/underlay}. Thus, it is not |
| 289 |
available for \refSkin{standard} and \refSkin{standard jigsaw}, but for |
| 290 |
all other skins, e.\,g.\ \refSkin{enhanced}. |
| 291 |
As an underlay, this option can be used multiple times and is removed |
| 292 |
by \refKey{/tcb/no underlay}. |
| 293 |
\begin{exdispExample*}{titlerule_style_1}{sbs,lefthand ratio=0.66} |
| 294 |
\begin{tcolorbox}[enhanced, |
| 295 |
colback=red!5!white,colframe=red!75!black, |
| 296 |
colbacktitle=red!50!yellow,fonttitle=\bfseries, |
| 297 |
title=My title, |
| 298 |
titlerule=1mm, |
| 299 |
titlerule style=yellow ] |
| 300 |
This is a \textbf{tcolorbox}. |
| 301 |
\end{tcolorbox} |
| 302 |
\end{exdispExample*} |
| 303 |
|
| 304 |
\begin{exdispExample*}{titlerule_style_2}{sbs,lefthand ratio=0.66} |
| 305 |
\begin{tcolorbox}[enhanced, |
| 306 |
colback=red!5!white,colframe=red!75!black, |
| 307 |
colbacktitle=red!50!yellow,fonttitle=\bfseries, |
| 308 |
title=My title, |
| 309 |
titlerule=1mm, |
| 310 |
titlerule style={yellow,line width=0.5mm} ] |
| 311 |
This is a \textbf{tcolorbox}. |
| 312 |
\end{tcolorbox} |
| 313 |
\end{exdispExample*} |
| 314 |
|
| 315 |
\begin{exdispExample*}{titlerule_style_3}{sbs,lefthand ratio=0.66} |
| 316 |
\begin{tcolorbox}[enhanced, |
| 317 |
colback=red!10!white,colframe=red!75!black, |
| 318 |
colbacktitle=red!50!yellow,fonttitle=\bfseries, |
| 319 |
frame hidden, |
| 320 |
title=My title, |
| 321 |
boxrule=0pt,titlerule=1mm, |
| 322 |
titlerule style=red!50!black ] |
| 323 |
This is a \textbf{tcolorbox}. |
| 324 |
\end{tcolorbox} |
| 325 |
\end{exdispExample*} |
| 326 |
|
| 327 |
\begin{exdispExample*}{titlerule_style_4}{sbs,lefthand ratio=0.66} |
| 328 |
%\usetikzlibrary{arrows.meta} |
| 329 |
\begin{tcolorbox}[empty, |
| 330 |
coltitle=red!75!black,fonttitle=\bfseries, |
| 331 |
borderline horizontal={0.5mm}{0pt}{red!50!white}, |
| 332 |
title=My title, |
| 333 |
titlerule style={red, |
| 334 |
arrows = {Hooks[arc=270]-Hooks[arc=270]}} ] |
| 335 |
This is a \textbf{tcolorbox}. |
| 336 |
\end{tcolorbox} |
| 337 |
\end{exdispExample*} |
| 338 |
\end{docTcbKey} |
| 339 |
|
| 340 |
\clearpage |
| 341 |
|
| 342 |
The combined \tikzname\ style applied to frame, interior, and title |
| 343 |
background can used by authors in customizing code. |
| 344 |
|
| 345 |
\begin{docTikzKey}{tcb fill frame}{}{style, no value} |
| 346 |
This is a \tikzname\ style which is finally applied to the \emph{frame} |
| 347 |
of the box. |
| 348 |
|
| 349 |
\begin{exdispExample*}{tcb_fill_frame}{sbs,lefthand ratio=0.66} |
| 350 |
% \tcbuselibrary{hooks} |
| 351 |
\tcbset{enhanced,colback=red!5!white, |
| 352 |
colframe=red!75!black,fonttitle=\bfseries, |
| 353 |
frame code app={\path[tcb fill frame] |
| 354 |
([yshift=-2mm]frame.north) |
| 355 |
circle (8mm); } } |
| 356 |
|
| 357 |
\begin{tcolorbox}[title=My title] |
| 358 |
This is a \textbf{tcolorbox}. |
| 359 |
\tcblower |
| 360 |
This is the lower part. |
| 361 |
\end{tcolorbox} |
| 362 |
\end{exdispExample*} |
| 363 |
\end{docTikzKey} |
| 364 |
|
| 365 |
|
| 366 |
\begin{docTikzKey}{tcb fill interior}{}{style, no value} |
| 367 |
This is a \tikzname\ style which is finally applied to the \emph{interior} |
| 368 |
of the box. |
| 369 |
|
| 370 |
\begin{exdispExample*}{tcb_fill_interior}{sbs,lefthand ratio=0.66} |
| 371 |
% \tcbuselibrary{hooks} |
| 372 |
\tcbset{enhanced,colback=red!5!white, |
| 373 |
colframe=red!75!black,fonttitle=\bfseries, |
| 374 |
interior titled code app={\path[tcb fill interior] |
| 375 |
([yshift=-0.1pt]interior.north east) |
| 376 |
--([yshift=3pt]interior.north) |
| 377 |
--([yshift=-0.1pt]interior.north west) |
| 378 |
--cycle;} } |
| 379 |
|
| 380 |
\begin{tcolorbox}[title=My title] |
| 381 |
This is a \textbf{tcolorbox}. |
| 382 |
\tcblower |
| 383 |
This is the lower part. |
| 384 |
\end{tcolorbox} |
| 385 |
\end{exdispExample*} |
| 386 |
\end{docTikzKey} |
| 387 |
|
| 388 |
|
| 389 |
\begin{docTikzKey}{tcb fill title}{}{style, no value} |
| 390 |
This is a \tikzname\ style which is finally applied to the \emph{title area} |
| 391 |
of the box. |
| 392 |
|
| 393 |
\begin{exdispExample*}{tcb_fill_title}{sbs,lefthand ratio=0.66} |
| 394 |
% \tcbuselibrary{hooks} |
| 395 |
\tcbset{enhanced,colback=red!5!white, |
| 396 |
colframe=red!75!black,fonttitle=\bfseries, |
| 397 |
colbacktitle=blue!75!black, |
| 398 |
title code app={\path[tcb fill title] |
| 399 |
(title) circle (5mm); } } |
| 400 |
|
| 401 |
\begin{tcolorbox}[title=My title] |
| 402 |
This is a \textbf{tcolorbox}. |
| 403 |
\tcblower |
| 404 |
This is the lower part. |
| 405 |
\end{tcolorbox} |
| 406 |
\end{exdispExample*} |
| 407 |
\end{docTikzKey} |
| 408 |
|
| 409 |
\clearpage |
| 410 |
|
| 411 |
\begin{docTikzKey}[][doc new=2025-07-07]{tcb fill lower bicolor}{}{style, no value} |
| 412 |
This is a \tikzname\ style which is finally applied to the |
| 413 |
\emph{interior lower part} of the box, when the \refSkin{bicolor} skin is used. |
| 414 |
|
| 415 |
\begin{exdispExample*}{tcb_fill_lower_bicolor}{sbs,lefthand ratio=0.66} |
| 416 |
% \tcbuselibrary{hooks} |
| 417 |
% \usetikzlibrary{decorations.pathmorphing} |
| 418 |
\tcbset{bicolor,colback=red!5!white, |
| 419 |
colbacklower=blue!15!white, |
| 420 |
colframe=red!75!black,fonttitle=\bfseries, |
| 421 |
segmentation code app={ |
| 422 |
\path[tcb fill lower bicolor, |
| 423 |
decoration={zigzag,amplitude=1mm}] |
| 424 |
decorate { |
| 425 |
([yshift=-0.1pt]segmentation.east) |
| 426 |
--([yshift=-0.1pt]segmentation.west) } |
| 427 |
--cycle;} } |
| 428 |
|
| 429 |
\begin{tcolorbox}[title=My title] |
| 430 |
This is a \textbf{tcolorbox}. |
| 431 |
\tcblower |
| 432 |
This is the lower part. |
| 433 |
\end{tcolorbox} |
| 434 |
\end{exdispExample*} |
| 435 |
\end{docTikzKey} |
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
\clearpage |
| 440 |
\subsection{Boxed Title Option Keys}\label{subsec:skinboxedtitle} |
| 441 |
|
| 442 |
\subsubsection{Boxed Title Placement} |
| 443 |
The following options place the title text into an own \refCom{tcbox}. |
| 444 |
This boxed title can be customized independently from the main box using |
| 445 |
\refKey{/tcb/boxed title style}. |
| 446 |
The placement can be influenced by \meta{boxtitle options}. |
| 447 |
|
| 448 |
\begin{docTcbKey}{attach boxed title to top left}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 449 |
The title is boxed with a \refCom{tcbox} and attached to |
| 450 |
the top left corner of the main box. |
| 451 |
\begin{exdispExample*}{attach_boxed_title_to_top_left}{sbs,lefthand ratio=0.66} |
| 452 |
\begin{tcolorbox}[enhanced,title=My title, |
| 453 |
attach boxed title to top left] |
| 454 |
This is a \textbf{tcolorbox}. |
| 455 |
\end{tcolorbox} |
| 456 |
\end{exdispExample*} |
| 457 |
\end{docTcbKey} |
| 458 |
|
| 459 |
\begin{docTcbKey}[][doc new=2021-07-30]{attach boxed title to top text left}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 460 |
The title is boxed with a \refCom{tcbox} and attached to |
| 461 |
the top left corner of the main box |
| 462 |
and shifted to match title text and box text. |
| 463 |
\begin{exdispExample*}{attach_boxed_title_to_top_text_left}{sbs,lefthand ratio=0.66} |
| 464 |
\begin{tcolorbox}[enhanced,title=My title, |
| 465 |
attach boxed title to top text left] |
| 466 |
This is a \textbf{tcolorbox}. |
| 467 |
\end{tcolorbox} |
| 468 |
\end{exdispExample*} |
| 469 |
\end{docTcbKey} |
| 470 |
|
| 471 |
\begin{docTcbKey}{attach boxed title to top center}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 472 |
The title is boxed with a \refCom{tcbox} and attached to |
| 473 |
the top of the main box. |
| 474 |
\begin{exdispExample*}{attach_boxed_title_to_top_center}{sbs,lefthand ratio=0.66} |
| 475 |
\begin{tcolorbox}[enhanced,title=My title, |
| 476 |
attach boxed title to top center] |
| 477 |
This is a \textbf{tcolorbox}. |
| 478 |
\end{tcolorbox} |
| 479 |
\end{exdispExample*} |
| 480 |
\end{docTcbKey} |
| 481 |
|
| 482 |
\begin{docTcbKey}[][doc new=2021-07-30]{attach boxed title to top text right}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 483 |
The title is boxed with a \refCom{tcbox} and attached to |
| 484 |
the top right corner of the main box |
| 485 |
and shifted to match title text and box text. |
| 486 |
\begin{exdispExample*}{attach_boxed_title_to_top_text_right}{sbs,lefthand ratio=0.66} |
| 487 |
\begin{tcolorbox}[enhanced,title=My title, |
| 488 |
halign=right, |
| 489 |
attach boxed title to top text right] |
| 490 |
This is a \textbf{tcolorbox}. |
| 491 |
\end{tcolorbox} |
| 492 |
\end{exdispExample*} |
| 493 |
\end{docTcbKey} |
| 494 |
|
| 495 |
|
| 496 |
\begin{docTcbKey}{attach boxed title to top right}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 497 |
The title is boxed with a \refCom{tcbox} and attached to |
| 498 |
the top right corner of the main box. |
| 499 |
\begin{exdispExample*}{attach_boxed_title_to_top_right}{sbs,lefthand ratio=0.66} |
| 500 |
\begin{tcolorbox}[enhanced,title=My title, |
| 501 |
attach boxed title to top right] |
| 502 |
This is a \textbf{tcolorbox}. |
| 503 |
\end{tcolorbox} |
| 504 |
\end{exdispExample*} |
| 505 |
\end{docTcbKey} |
| 506 |
|
| 507 |
\clearpage |
| 508 |
|
| 509 |
\begin{docTcbKey}{attach boxed title to bottom left}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 510 |
The title is boxed with a \refCom{tcbox} and attached to |
| 511 |
the bottom left corner of the main box. |
| 512 |
\begin{exdispExample*}{attach_boxed_title_to_bottom_left}{sbs,lefthand ratio=0.66} |
| 513 |
\begin{tcolorbox}[enhanced,title=My title, |
| 514 |
attach boxed title to bottom left] |
| 515 |
This is a \textbf{tcolorbox}. |
| 516 |
\end{tcolorbox} |
| 517 |
\end{exdispExample*} |
| 518 |
\end{docTcbKey} |
| 519 |
|
| 520 |
|
| 521 |
\begin{docTcbKey}[][doc new=2021-07-30]{attach boxed title to bottom text left}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 522 |
The title is boxed with a \refCom{tcbox} and attached to |
| 523 |
the bottom left corner of the main box |
| 524 |
and shifted to match title text and box text. |
| 525 |
Note that this matches the \emph{upper} part, even, if there is a \emph{lower} part. |
| 526 |
\begin{exdispExample*}{attach_boxed_title_to_bottom_text_left}{sbs,lefthand ratio=0.66} |
| 527 |
\begin{tcolorbox}[enhanced,title=My title, |
| 528 |
attach boxed title to bottom text left] |
| 529 |
This is a \textbf{tcolorbox}. |
| 530 |
\end{tcolorbox} |
| 531 |
\end{exdispExample*} |
| 532 |
\end{docTcbKey} |
| 533 |
|
| 534 |
|
| 535 |
\begin{docTcbKey}{attach boxed title to bottom center}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 536 |
The title is boxed with a \refCom{tcbox} and attached to |
| 537 |
the bottom of the main box. |
| 538 |
\begin{exdispExample*}{attach_boxed_title_to_bottom_center}{sbs,lefthand ratio=0.66} |
| 539 |
\begin{tcolorbox}[enhanced,title=My title, |
| 540 |
attach boxed title to bottom center] |
| 541 |
This is a \textbf{tcolorbox}. |
| 542 |
\end{tcolorbox} |
| 543 |
\end{exdispExample*} |
| 544 |
\end{docTcbKey} |
| 545 |
|
| 546 |
|
| 547 |
\begin{docTcbKey}[][doc new=2021-07-30]{attach boxed title to bottom text right}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 548 |
The title is boxed with a \refCom{tcbox} and attached to |
| 549 |
the bottom right corner of the main box |
| 550 |
and shifted to match title text and box text. |
| 551 |
Note that this matches the \emph{upper} part, even, if there is a \emph{lower} part. |
| 552 |
\begin{exdispExample*}{attach_boxed_title_to_bottom_text_right}{sbs,lefthand ratio=0.66} |
| 553 |
\begin{tcolorbox}[enhanced,title=My title, |
| 554 |
halign=right, |
| 555 |
attach boxed title to bottom text right] |
| 556 |
This is a \textbf{tcolorbox}. |
| 557 |
\end{tcolorbox} |
| 558 |
\end{exdispExample*} |
| 559 |
\end{docTcbKey} |
| 560 |
|
| 561 |
|
| 562 |
\begin{docTcbKey}{attach boxed title to bottom right}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 563 |
The title is boxed with a \refCom{tcbox} and attached to |
| 564 |
the bottom right corner of the main box. |
| 565 |
\begin{exdispExample*}{attach_boxed_title_to_bottom_right}{sbs,lefthand ratio=0.66} |
| 566 |
\begin{tcolorbox}[enhanced,title=My title, |
| 567 |
attach boxed title to bottom right] |
| 568 |
This is a \textbf{tcolorbox}. |
| 569 |
\end{tcolorbox} |
| 570 |
\end{exdispExample*} |
| 571 |
\end{docTcbKey} |
| 572 |
|
| 573 |
|
| 574 |
\clearpage |
| 575 |
\begin{docTcbKey}[][doc new=2016-02-26]{attach boxed title to top}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 576 |
This is a convenient style to mimic a standard title. |
| 577 |
It uses \refKey{/tcb/attach boxed title to top center}, |
| 578 |
\refKey{/tcb/minipage boxed title}, and sizes the boxed title to match |
| 579 |
the base box. |
| 580 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 581 |
\begin{tcolorbox}[enhanced,title=My title, |
| 582 |
attach boxed title to top, |
| 583 |
boxed title style={colframe=red}] |
| 584 |
This is a \textbf{tcolorbox}. |
| 585 |
\end{tcolorbox} |
| 586 |
\end{dispExample*} |
| 587 |
\end{docTcbKey} |
| 588 |
|
| 589 |
\begin{docTcbKey}[][doc new=2016-02-26]{attach boxed title to top*}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 590 |
In contrast to \refKey{/tcb/attach boxed title to top}, this style |
| 591 |
uses smaller left and right rules to avoid previewer glitches. |
| 592 |
Typically, one would not use different colors for the frame as in the |
| 593 |
example below. |
| 594 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 595 |
\begin{tcolorbox}[enhanced,title=My title, |
| 596 |
attach boxed title to top*, |
| 597 |
boxed title style={colframe=red}] |
| 598 |
This is a \textbf{tcolorbox}. |
| 599 |
\end{tcolorbox} |
| 600 |
\end{dispExample*} |
| 601 |
\end{docTcbKey} |
| 602 |
|
| 603 |
\begin{docTcbKey}[][doc new=2016-02-26]{attach boxed title to bottom}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 604 |
This is a convenient style to produce a standard-like title at the bottom |
| 605 |
of the box. |
| 606 |
It uses \refKey{/tcb/attach boxed title to bottom center}, |
| 607 |
\refKey{/tcb/minipage boxed title}, and sizes the boxed title to match |
| 608 |
the base box. |
| 609 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 610 |
\begin{tcolorbox}[enhanced,title=My title, |
| 611 |
attach boxed title to bottom, |
| 612 |
boxed title style={colframe=red}] |
| 613 |
This is a \textbf{tcolorbox}. |
| 614 |
\end{tcolorbox} |
| 615 |
\end{dispExample*} |
| 616 |
\end{docTcbKey} |
| 617 |
|
| 618 |
\begin{docTcbKey}[][doc new=2016-02-26]{attach boxed title to bottom*}{\colOpt{=\marg{boxtitle options}}}{style, default empty} |
| 619 |
In contrast to \refKey{/tcb/attach boxed title to top}, this style |
| 620 |
uses smaller left and right rules to avoid previewer glitches. |
| 621 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 622 |
\begin{tcolorbox}[enhanced,title=My title, |
| 623 |
attach boxed title to bottom*] |
| 624 |
This is a \textbf{tcolorbox}. |
| 625 |
\end{tcolorbox} |
| 626 |
\end{dispExample*} |
| 627 |
\end{docTcbKey} |
| 628 |
|
| 629 |
\begin{docTcbKey}[][doc new=2016-02-26]{flip title}{\colOpt{=\marg{options}}}{style, default empty} |
| 630 |
This style combines \refKey{/tcb/attach boxed title to bottom*} |
| 631 |
with \refKey{/tcb/boxed title style}. The \meta{options} are given to |
| 632 |
\refKey{/tcb/boxed title style}. |
| 633 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 634 |
\begin{tcolorbox}[tile,flip title={sharp corners}, |
| 635 |
title=My title,colback=red!10, |
| 636 |
colbacktitle=red!75!black] |
| 637 |
This is a \textbf{tcolorbox}. |
| 638 |
\end{tcolorbox} |
| 639 |
\end{dispExample*} |
| 640 |
\end{docTcbKey} |
| 641 |
|
| 642 |
\clearpage |
| 643 |
|
| 644 |
\subsubsection{Options for the Boxed Title Placement} |
| 645 |
The \meta{boxtitle options} of the keys described above are shift values. |
| 646 |
The dimensions of the boxed title are stored into two macros |
| 647 |
\docAuxCommand{tcboxedtitleheight} and |
| 648 |
\docAuxCommand{tcboxedtitlewidth}. These macros can be used inside the |
| 649 |
following \meta{boxtitle options}: |
| 650 |
|
| 651 |
\begin{boxTcbKey}{xshift}{=\meta{length}}{no default, initially |0pt|} |
| 652 |
The boxed title is shifted by \meta{length} in the horizontal direction. |
| 653 |
\begin{exdispExample*}{xshift}{sbs,lefthand ratio=0.66} |
| 654 |
\begin{tcolorbox}[enhanced,title=My title, |
| 655 |
attach boxed title to top left={xshift=-2mm}, |
| 656 |
boxed title style={size=small,colback=blue}] |
| 657 |
This is a \textbf{tcolorbox}. |
| 658 |
\end{tcolorbox} |
| 659 |
\end{exdispExample*} |
| 660 |
\end{boxTcbKey} |
| 661 |
|
| 662 |
\begin{boxTcbKey}{yshift}{=\meta{length}}{no default, initially |0pt|} |
| 663 |
The boxed title is shifted by \meta{length} in the vertical direction. |
| 664 |
\begin{exdispExample*}{yshift}{sbs,lefthand ratio=0.66} |
| 665 |
\begin{tcolorbox}[enhanced,title=My title, |
| 666 |
attach boxed title to top center= |
| 667 |
{yshift=-\tcboxedtitleheight/2}, |
| 668 |
boxed title style={size=small,colback=blue}] |
| 669 |
This is a \textbf{tcolorbox}. |
| 670 |
\end{tcolorbox} |
| 671 |
\end{exdispExample*} |
| 672 |
\end{boxTcbKey} |
| 673 |
|
| 674 |
\begin{boxTcbKey}{yshifttext}{=\meta{length}}{no default, initially |0pt|} |
| 675 |
The text inside the main box is shifted by \meta{length} to give room for e.\,g.\ a sunken title. |
| 676 |
\begin{exdispExample*}{yshifttext}{sbs,lefthand ratio=0.66} |
| 677 |
\begin{tcolorbox}[enhanced,title=My title, |
| 678 |
attach boxed title to top center= |
| 679 |
{yshift=-3mm,yshifttext=-1mm}, |
| 680 |
boxed title style={size=small,colback=blue}] |
| 681 |
This is a \textbf{tcolorbox}. |
| 682 |
\end{tcolorbox} |
| 683 |
\end{exdispExample*} |
| 684 |
\end{boxTcbKey} |
| 685 |
|
| 686 |
\begin{boxTcbKey}{yshift*}{=\meta{length}}{no default, initially |0pt|} |
| 687 |
Sets \refKey{/tcb/boxtitle/yshift} and \refKey{/tcb/boxtitle/yshifttext} |
| 688 |
the same time.\\ |
| 689 |
\refKey{/tcb/boxtitle/yshifttext} is only set if necessary. |
| 690 |
\begin{exdispExample*}{yshiftstar}{sbs,lefthand ratio=0.66} |
| 691 |
\begin{tcolorbox}[enhanced,title=My title, |
| 692 |
attach boxed title to top center={yshift*=-3mm}, |
| 693 |
boxed title style={size=small,colback=blue}] |
| 694 |
This is a \textbf{tcolorbox}. |
| 695 |
\end{tcolorbox} |
| 696 |
\end{exdispExample*} |
| 697 |
\end{boxTcbKey} |
| 698 |
|
| 699 |
\begin{marker} |
| 700 |
The bounding box of the resulting total |tcolorbox| is adapted automatically to the |
| 701 |
\emph{vertical} dimensions of the boxed title. Possible horizontal enlargements |
| 702 |
are \emph{not} automatically computed. |
| 703 |
\end{marker} |
| 704 |
|
| 705 |
|
| 706 |
\begin{exdispExample*}{boxed_title_example_1}{sbs,lefthand ratio=0.66} |
| 707 |
\begin{tcolorbox}[enhanced,title=My title, |
| 708 |
attach boxed title to top left= |
| 709 |
{xshift=-2mm,yshift=-2mm}, |
| 710 |
boxed title style={size=small,colback=blue}, |
| 711 |
show bounding box] |
| 712 |
This is a \textbf{tcolorbox}. |
| 713 |
\end{tcolorbox} |
| 714 |
\end{exdispExample*} |
| 715 |
|
| 716 |
|
| 717 |
\clearpage |
| 718 |
\subsubsection{Options for the Boxed Title Box} |
| 719 |
\begin{marker} |
| 720 |
The boxed title options are implemented as an underlay, see \zvref{subsec:skinunderlay}. |
| 721 |
Therefore, a boxed title is not drawn, if a skin does not support underlays |
| 722 |
like \refSkin{standard}. Still, the room for the boxed |
| 723 |
titles gets reserved in these cases. |
| 724 |
\end{marker} |
| 725 |
|
| 726 |
\begin{marker} |
| 727 |
A \tikzname\ node |title| is produced by a boxed title which can be used |
| 728 |
inside \refKey{/tcb/frame code}, \refKey{/tcb/interior code}, |
| 729 |
underlays, overlays, and finishes. |
| 730 |
\end{marker} |
| 731 |
|
| 732 |
\begin{marker} |
| 733 |
A boxed title is almost always the first underlay. The only exceptions are |
| 734 |
underlays defined by \refKey{/tcb/underlay boxed title} which are drawn |
| 735 |
before. Additionally, underlays defined by \refKey{/tcb/underlay boxed title} |
| 736 |
are only drawn, if a boxed title is actually set. They are ignored, if |
| 737 |
there is no boxed title. |
| 738 |
\end{marker} |
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
\begin{docTcbKey}[][doc new=2016-02-26]{boxed title size}{=\meta{size}}{no default, initially |title|} |
| 743 |
This setting defines the basic size for the title box. Further settings |
| 744 |
can be applied using \refKey{/tcb/boxed title style}. |
| 745 |
Feasible values for \meta{size} are: |
| 746 |
\begin{itemize} |
| 747 |
\item\docValue{title}: Sets the size according to \refKey{/tcb/size}|=|\docValue{title}. |
| 748 |
\item\docValue{standard}: No size setting. Typically, this is identical to |
| 749 |
\refKey{/tcb/size}|=|\docValue{normal}. |
| 750 |
\item\docValue{copy}: The size values for a title of the base box are copied |
| 751 |
for the title box. |
| 752 |
\end{itemize} |
| 753 |
|
| 754 |
\begin{dispExample} |
| 755 |
% \tcbuselibrary{raster} |
| 756 |
\begin{tcbraster}[raster columns=3,enhanced,boxrule=0.4pt, |
| 757 |
title=My title,attach boxed title to top center] |
| 758 |
\begin{tcolorbox}[boxed title size=title] |
| 759 |
This is a \textbf{tcolorbox}. |
| 760 |
\end{tcolorbox} |
| 761 |
\begin{tcolorbox}[boxed title size=standard] |
| 762 |
This is a \textbf{tcolorbox}. |
| 763 |
\end{tcolorbox} |
| 764 |
\begin{tcolorbox}[boxed title size=copy] |
| 765 |
This is a \textbf{tcolorbox}. |
| 766 |
\end{tcolorbox} |
| 767 |
\end{tcbraster} |
| 768 |
\end{dispExample} |
| 769 |
|
| 770 |
\end{docTcbKey} |
| 771 |
|
| 772 |
|
| 773 |
\clearpage |
| 774 |
\begin{docTcbKey}[][doc updated=2016-02-26]{boxed title style}{=\meta{options}}{style, initially empty} |
| 775 |
By default, a boxed title is dimensioned with \refKey{/tcb/size}|=|\docValue*{title} |
| 776 |
and inherits the \refKey{/tcb/skin} and \refKey{/tcb/colframe} of the main box. |
| 777 |
Also, the \refKey{/tcb/colback} is inherited from the main \refKey{/tcb/colbacktitle}. |
| 778 |
Font and color of the title text are set as usual. |
| 779 |
All other \meta{options} are set by the \refKey{/tcb/boxed title style} key. |
| 780 |
Since a boxed title is set by \refCom{tcbox}, all |tcolorbox| options are |
| 781 |
applicable here. If \refKey{/tcb/boxed title style} is used several times, |
| 782 |
the \meta{options} are appended. |
| 783 |
|
| 784 |
\begin{exdispExample*}{boxed_title_style_1}{sbs,lefthand ratio=0.66} |
| 785 |
\begin{tcolorbox}[enhanced,title=My title, |
| 786 |
fonttitle=\bfseries,coltitle=green!25!black, |
| 787 |
attach boxed title to top center= |
| 788 |
{yshift=-2mm,yshifttext=-1mm}, |
| 789 |
boxed title style={colframe=green!75!black, |
| 790 |
colback=yellow!50!green}] |
| 791 |
This is a \textbf{tcolorbox}. |
| 792 |
\end{tcolorbox} |
| 793 |
\end{exdispExample*} |
| 794 |
|
| 795 |
|
| 796 |
\begin{exdispExample*}{boxed_title_style_2}{sbs,lefthand ratio=0.66} |
| 797 |
\begin{tcolorbox}[enhanced,title=My title, |
| 798 |
colframe=red!50!black,colback=red!10!white, |
| 799 |
arc=1mm,colbacktitle=red!10!white, |
| 800 |
fonttitle=\bfseries,coltitle=red!50!black, |
| 801 |
attach boxed title to top text left= |
| 802 |
{yshift=-0.50mm}, |
| 803 |
boxed title style={skin=enhancedfirst jigsaw, |
| 804 |
size=small,arc=1mm,bottom=-1mm, |
| 805 |
interior style={fill=none, |
| 806 |
top color=red!30!white, |
| 807 |
bottom color=red!20!white}}] |
| 808 |
This is a \textbf{tcolorbox}. |
| 809 |
\end{tcolorbox} |
| 810 |
\end{exdispExample*} |
| 811 |
|
| 812 |
\begin{exdispExample}{boxed_title_style_3} |
| 813 |
\begin{tcolorbox}[enhanced,title=My title, |
| 814 |
colframe=blue!50!black,colback=blue!10!white,colbacktitle=blue!5!yellow!10!white, |
| 815 |
fonttitle=\bfseries,coltitle=black,attach boxed title to top center= |
| 816 |
{yshift=-0.25mm-\tcboxedtitleheight/2,yshifttext=2mm-\tcboxedtitleheight/2}, |
| 817 |
boxed title style={boxrule=0.5mm, |
| 818 |
frame code={ \path[tcb fill frame] ([xshift=-4mm]frame.west) |
| 819 |
-- (frame.north west) -- (frame.north east) -- ([xshift=4mm]frame.east) |
| 820 |
-- (frame.south east) -- (frame.south west) -- cycle; }, |
| 821 |
interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west) |
| 822 |
-- (interior.north west) -- (interior.north east) |
| 823 |
-- ([xshift=2mm]interior.east) -- (interior.south east) -- (interior.south west) |
| 824 |
-- cycle;} }] |
| 825 |
\lipsum[2] |
| 826 |
\end{tcolorbox} |
| 827 |
\end{exdispExample} |
| 828 |
|
| 829 |
|
| 830 |
\begin{exdispExample}{boxed_title_style_4} |
| 831 |
% \usepackage{varwidth} |
| 832 |
\newtcolorbox{mybox}[2][]{enhanced,skin=enhancedlast jigsaw, |
| 833 |
attach boxed title to top left={xshift=-4mm,yshift=-0.5mm}, |
| 834 |
fonttitle=\bfseries\sffamily,varwidth boxed title=0.7\linewidth, |
| 835 |
colbacktitle=blue!45!white,colframe=red!50!black, |
| 836 |
interior style={top color=blue!10!white,bottom color=red!10!white}, |
| 837 |
boxed title style={empty,arc=0pt,outer arc=0pt,boxrule=0pt}, |
| 838 |
underlay boxed title={ |
| 839 |
\fill[blue!45!white] (title.north west) -- (title.north east) |
| 840 |
-- +(\tcboxedtitleheight-1mm,-\tcboxedtitleheight+1mm) |
| 841 |
-- ([xshift=4mm,yshift=0.5mm]frame.north east) -- +(0mm,-1mm) |
| 842 |
-- (title.south west) -- cycle; |
| 843 |
\fill[blue!45!white!50!black] ([yshift=-0.5mm]frame.north west) |
| 844 |
-- +(-0.4,0) -- +(0,-0.3) -- cycle; |
| 845 |
\fill[blue!45!white!50!black] ([yshift=-0.5mm]frame.north east) |
| 846 |
-- +(0,-0.3) -- +(0.4,0) -- cycle; }, |
| 847 |
title={#2},#1} |
| 848 |
|
| 849 |
\begin{mybox}{My title} |
| 850 |
\lipsum[2] |
| 851 |
\end{mybox} |
| 852 |
\end{exdispExample} |
| 853 |
|
| 854 |
|
| 855 |
\begin{exdispExample}{boxed_title_style_5} |
| 856 |
% \usepackage{varwidth} |
| 857 |
\newtcolorbox{mybox}[2][]{enhanced, |
| 858 |
attach boxed title to top left={xshift=1cm,yshift=-2mm}, |
| 859 |
fonttitle=\bfseries,varwidth boxed title=0.7\linewidth, |
| 860 |
colbacktitle=green!45!white,coltitle=green!10!black,colframe=green!50!black, |
| 861 |
interior style={top color=yellow!10!white,bottom color=green!10!white}, |
| 862 |
boxed title style={boxrule=0.75mm,colframe=white, |
| 863 |
borderline={0.1mm}{0mm}{green!50!black}, |
| 864 |
borderline={0.1mm}{0.75mm}{green!50!black}, |
| 865 |
interior style={top color=green!10!white,bottom color=green!10!white, |
| 866 |
middle color=green!50!white}, |
| 867 |
drop fuzzy shadow}, |
| 868 |
title={#2},#1} |
| 869 |
|
| 870 |
\begin{mybox}{My title} |
| 871 |
\lipsum[2] |
| 872 |
\end{mybox} |
| 873 |
\end{exdispExample} |
| 874 |
|
| 875 |
|
| 876 |
\begin{exdispExample}{boxed_title_style_6} |
| 877 |
\newtcolorbox{flipbox}[2][]{ |
| 878 |
enhanced,colframe=blue!50!black,colback=yellow!5,fonttitle=\bfseries, |
| 879 |
flip title={interior hidden},title={#2},#1} |
| 880 |
|
| 881 |
\begin{flipbox}{My title} |
| 882 |
\lipsum[2] |
| 883 |
\end{flipbox} |
| 884 |
\end{exdispExample} |
| 885 |
|
| 886 |
|
| 887 |
\begin{exdispExample}{boxed_title_style_7} |
| 888 |
% \usepackage{varwidth} |
| 889 |
\newtcolorbox{mybox}[2][]{skin=enhancedlast jigsaw,interior hidden, |
| 890 |
boxsep=0pt,top=0pt,colframe=red,coltitle=red!50!black, |
| 891 |
fonttitle=\bfseries\sffamily, |
| 892 |
attach boxed title to bottom center, |
| 893 |
boxed title style={empty,boxrule=0.5mm}, |
| 894 |
varwidth boxed title=0.5\linewidth, |
| 895 |
underlay boxed title={ |
| 896 |
\draw[white,line width=0.5mm] |
| 897 |
([xshift=0.3mm-\tcboxedtitleheight*2,yshift=0.3mm]title.north west) |
| 898 |
--([xshift=-0.3mm+\tcboxedtitleheight*2,yshift=0.3mm]title.north east); |
| 899 |
\path[draw=red,top color=white,bottom color=red!50!white,line width=0.5mm] |
| 900 |
([xshift=0.25mm-\tcboxedtitleheight*2,yshift=0.25mm]title.north west) |
| 901 |
cos +(\tcboxedtitleheight,-\tcboxedtitleheight/2) |
| 902 |
sin +(\tcboxedtitleheight,-\tcboxedtitleheight/2) |
| 903 |
-- ([xshift=0.25mm,yshift=0.25mm]title.south west) |
| 904 |
-- ([yshift=0.25mm]title.south east) |
| 905 |
cos +(\tcboxedtitleheight,\tcboxedtitleheight/2) |
| 906 |
sin +(\tcboxedtitleheight,\tcboxedtitleheight/2); }, |
| 907 |
title={#2},#1} |
| 908 |
|
| 909 |
\begin{mybox}{My title} |
| 910 |
\lipsum[2] |
| 911 |
\end{mybox} |
| 912 |
\end{exdispExample} |
| 913 |
|
| 914 |
|
| 915 |
\begin{exdispExample}{boxed_title_style_8} |
| 916 |
% \usepackage{varwidth} |
| 917 |
\newtcolorbox{mybox}[2][]{enhanced, |
| 918 |
before skip=2mm,after skip=2mm, |
| 919 |
colback=black!5,colframe=black!50,boxrule=0.2mm, |
| 920 |
attach boxed title to top left={xshift=1cm,yshift*=1mm-\tcboxedtitleheight}, |
| 921 |
varwidth boxed title*=-3cm, |
| 922 |
boxed title style={frame code={ |
| 923 |
\path[fill=tcbcolback!30!black] |
| 924 |
([yshift=-1mm,xshift=-1mm]frame.north west) |
| 925 |
arc[start angle=0,end angle=180,radius=1mm] |
| 926 |
([yshift=-1mm,xshift=1mm]frame.north east) |
| 927 |
arc[start angle=180,end angle=0,radius=1mm]; |
| 928 |
\path[left color=tcbcolback!60!black,right color=tcbcolback!60!black, |
| 929 |
middle color=tcbcolback!80!black] |
| 930 |
([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east) |
| 931 |
[rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east) |
| 932 |
-- (frame.south east) -- (frame.south west) |
| 933 |
-- ([xshift=-1mm,yshift=-1mm]frame.north west) |
| 934 |
[sharp corners]-- cycle; |
| 935 |
},interior engine=empty, |
| 936 |
}, |
| 937 |
fonttitle=\bfseries, |
| 938 |
title={#2},#1} |
| 939 |
|
| 940 |
\begin{mybox}[colbacktitle=green]{My title} |
| 941 |
\lipsum[2] |
| 942 |
\end{mybox} |
| 943 |
\begin{mybox}[colbacktitle=red]{My title} |
| 944 |
\lipsum[3] |
| 945 |
\end{mybox} |
| 946 |
\end{exdispExample} |
| 947 |
\end{docTcbKey} |
| 948 |
|
| 949 |
|
| 950 |
|
| 951 |
\begin{docTcbKey}[][doc new=2016-02-26]{no boxed title style}{}{style, initially set} |
| 952 |
Removes all options which were set by \refKey{/tcb/boxed title style}. |
| 953 |
\end{docTcbKey} |
| 954 |
|
| 955 |
|
| 956 |
\clearpage |
| 957 |
\begin{docTcbKey}{hbox boxed title}{}{no value, initially set} |
| 958 |
The title text content is captured with a horizontal box. |
| 959 |
Especially, there are no linebreak possible. |
| 960 |
\begin{exdispExample*}{hbox_boxed_title}{sbs,lefthand ratio=0.66} |
| 961 |
\newtcolorbox{mybox}[1]{hbox boxed title, |
| 962 |
enhanced,attach boxed title to top center= |
| 963 |
{yshift=-3mm,yshifttext=-1mm}, |
| 964 |
boxed title style={size=small,colback=red}, |
| 965 |
title={#1}} |
| 966 |
|
| 967 |
\begin{mybox}{Short title} |
| 968 |
This is a \textbf{tcolorbox}. |
| 969 |
\end{mybox}\bigskip |
| 970 |
|
| 971 |
\begin{mybox}{This title is not really very short} |
| 972 |
This is a \textbf{tcolorbox}. |
| 973 |
\end{mybox} |
| 974 |
\end{exdispExample*} |
| 975 |
\end{docTcbKey} |
| 976 |
|
| 977 |
|
| 978 |
\begin{docTcbKey}{minipage boxed title}{\colOpt{=\meta{length}}}{initially unset} |
| 979 |
The title text content is captured with a minipage with a width of \meta{length}. |
| 980 |
By default, the resulting boxed title is somewhat smaller than the main box. |
| 981 |
\begin{exdispExample*}{minipage_boxed_title}{sbs,lefthand ratio=0.66} |
| 982 |
\newtcolorbox{mybox}[1]{minipage boxed title, |
| 983 |
enhanced,attach boxed title to top center= |
| 984 |
{yshift=-3mm,yshifttext=-1mm}, |
| 985 |
boxed title style={size=small,colback=red}, |
| 986 |
center title,title={#1}} |
| 987 |
|
| 988 |
\begin{mybox}{Short title} |
| 989 |
This is a \textbf{tcolorbox}. |
| 990 |
\end{mybox}\bigskip |
| 991 |
|
| 992 |
\begin{mybox}{This title is not really very short} |
| 993 |
This is a \textbf{tcolorbox}. |
| 994 |
\end{mybox} |
| 995 |
\end{exdispExample*} |
| 996 |
\end{docTcbKey} |
| 997 |
|
| 998 |
|
| 999 |
\begin{docTcbKey}{minipage boxed title*}{\colOpt{=\meta{length}}}{initially unset} |
| 1000 |
The title text content is captured with a minipage with a width of main box width plus \meta{length}. |
| 1001 |
By default, the resulting boxed title is somewhat smaller than the main box. |
| 1002 |
\begin{exdispExample*}{minipage_boxed_title_star}{sbs,lefthand ratio=0.66} |
| 1003 |
\newtcolorbox{mybox}[1]{minipage boxed title*=-2cm, |
| 1004 |
enhanced,attach boxed title to top center= |
| 1005 |
{yshift=-3mm,yshifttext=-1mm}, |
| 1006 |
boxed title style={size=small,colback=red}, |
| 1007 |
center title,title={#1}} |
| 1008 |
|
| 1009 |
\begin{mybox}{Short title} |
| 1010 |
This is a \textbf{tcolorbox}. |
| 1011 |
\end{mybox}\bigskip |
| 1012 |
|
| 1013 |
\begin{mybox}{This title is not really very short} |
| 1014 |
This is a \textbf{tcolorbox}. |
| 1015 |
\end{mybox} |
| 1016 |
\end{exdispExample*} |
| 1017 |
\end{docTcbKey} |
| 1018 |
|
| 1019 |
|
| 1020 |
\clearpage |
| 1021 |
\begin{docTcbKey}{tikznode boxed title}{=\meta{options}}{initially unset} |
| 1022 |
The title text content is captured with a \tikzname\ node with given \tikzname\ \meta{options}. |
| 1023 |
The text is centered by default |
| 1024 |
\begin{exdispExample*}{tikznode_boxed_title}{sbs,lefthand ratio=0.66} |
| 1025 |
\newtcolorbox{mybox}[1]{tikznode boxed title, |
| 1026 |
enhanced,attach boxed title to top center= |
| 1027 |
{yshift=-3mm,yshifttext=-1mm}, |
| 1028 |
boxed title style={size=small,colback=red}, |
| 1029 |
title={#1}} |
| 1030 |
|
| 1031 |
\begin{mybox}{Short title} |
| 1032 |
This is a \textbf{tcolorbox}. |
| 1033 |
\end{mybox}\bigskip |
| 1034 |
|
| 1035 |
\begin{mybox}{This title\\is not really\\very short} |
| 1036 |
This is a \textbf{tcolorbox}. |
| 1037 |
\end{mybox} |
| 1038 |
\end{exdispExample*} |
| 1039 |
\end{docTcbKey} |
| 1040 |
|
| 1041 |
|
| 1042 |
\begin{docTcbKey}{varwidth boxed title}{\colOpt{=\meta{length}}}{initially unset} |
| 1043 |
The title text content is captured with a |varwidth| environment with a width of \meta{length}. |
| 1044 |
This style needs the \refPkg{varwidth} package \cite{arseneau:2011a} to be loaded manually. |
| 1045 |
By default, the resulting boxed title is somewhat smaller than the main box. |
| 1046 |
\begin{exdispExample*}{varwidth_boxed_title}{sbs,lefthand ratio=0.66} |
| 1047 |
% \usepackage{varwidth} |
| 1048 |
\newtcolorbox{mybox}[1]{varwidth boxed title, |
| 1049 |
enhanced,attach boxed title to top center= |
| 1050 |
{yshift=-3mm,yshifttext=-1mm}, |
| 1051 |
boxed title style={size=small,colback=red}, |
| 1052 |
center title,title={#1}} |
| 1053 |
|
| 1054 |
\begin{mybox}{Short title} |
| 1055 |
This is a \textbf{tcolorbox}. |
| 1056 |
\end{mybox}\bigskip |
| 1057 |
|
| 1058 |
\begin{mybox}{This title is not really very short} |
| 1059 |
This is a \textbf{tcolorbox}. |
| 1060 |
\end{mybox} |
| 1061 |
\end{exdispExample*} |
| 1062 |
\end{docTcbKey} |
| 1063 |
|
| 1064 |
|
| 1065 |
\begin{docTcbKey}{varwidth boxed title*}{\colOpt{=\meta{length}}}{initially unset} |
| 1066 |
The title text content is captured with a |varwidth| environment with a width of main box width plus \meta{length}. |
| 1067 |
This style needs the \refPkg{varwidth} package \cite{arseneau:2011a} to be loaded manually. |
| 1068 |
By default, the resulting boxed title is somewhat smaller than the main box. |
| 1069 |
\begin{exdispExample*}{varwidth_boxed_title_star}{sbs,lefthand ratio=0.66} |
| 1070 |
% \usepackage{varwidth} |
| 1071 |
\newtcolorbox{mybox}[1]{varwidth boxed title*=-2cm, |
| 1072 |
enhanced,attach boxed title to top center= |
| 1073 |
{yshift=-3mm,yshifttext=-1mm}, |
| 1074 |
boxed title style={size=small,colback=red}, |
| 1075 |
center title,title={#1}} |
| 1076 |
|
| 1077 |
\begin{mybox}{Short title} |
| 1078 |
This is a \textbf{tcolorbox}. |
| 1079 |
\end{mybox}\bigskip |
| 1080 |
|
| 1081 |
\begin{mybox}{This title is not really very short} |
| 1082 |
This is a \textbf{tcolorbox}. |
| 1083 |
\end{mybox} |
| 1084 |
\end{exdispExample*} |
| 1085 |
\end{docTcbKey} |
| 1086 |
|
| 1087 |
|
| 1088 |
\clearpage |
| 1089 |
\subsection{Watermark Option Keys}\label{subsec:watermarks} |
| 1090 |
The skin \refSkin{standard} does not support these watermarks, |
| 1091 |
but all other skins, e.\,g.\ \refSkin{enhanced}. |
| 1092 |
|
| 1093 |
\begin{marker} |
| 1094 |
The watermark options rely on the more general overlay options described in |
| 1095 |
Section \ref{subsec:overlays} from page \pageref{subsec:overlays}. |
| 1096 |
Therefore, \emph{watermarks} and \emph{overlays} cannot be used mixed. |
| 1097 |
But a mixture is possible with the \mylib{hooks} library, see Section \ref{sec:hooks}. |
| 1098 |
\end{marker} |
| 1099 |
|
| 1100 |
|
| 1101 |
\begin{docTcbKey}{watermark text}{=\meta{text}}{no default, initially unset} |
| 1102 |
Writes some \meta{text} in the center of the interior region of a |tcolorbox|. |
| 1103 |
This \meta{text} is written \emph{after} the |
| 1104 |
frame and interior are drawn and \emph{before} the text content is drawn. |
| 1105 |
It is zoomed or stretched according the values of |
| 1106 |
\refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. |
| 1107 |
\begin{dispExample} |
| 1108 |
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} |
| 1109 |
|
| 1110 |
\begin{tcolorbox}[enhanced,title=My title,watermark text=My Watermark] |
| 1111 |
\lipsum[1] |
| 1112 |
\tcblower |
| 1113 |
\lipsum[2] |
| 1114 |
\end{tcolorbox} |
| 1115 |
\end{dispExample} |
| 1116 |
\end{docTcbKey} |
| 1117 |
|
| 1118 |
\enlargethispage*{1cm} |
| 1119 |
|
| 1120 |
\begin{docTcbKey}{watermark text on}{=\meta{part} is \meta{text}}{no default, initially unset} |
| 1121 |
This option writes some \meta{text} in the center of the interior region of a |tcolorbox| |
| 1122 |
as described for \refKey{/tcb/watermark text}. |
| 1123 |
But this is done only for boxes named \meta{part} of a break sequence, see |
| 1124 |
\refKey{/tcb/breakable}.\\ |
| 1125 |
Feasible values for \meta{part} are: |
| 1126 |
\begin{itemize} |
| 1127 |
\item\docValue{broken}: all broken box parts, |
| 1128 |
\item\docValue{unbroken}: unbroken boxes only, |
| 1129 |
\item\docValue{first}: first parts of a break sequence, |
| 1130 |
\item\docValue{middle}: middle parts of a break sequence, |
| 1131 |
\item\docValue{last}: last parts of a break sequence, |
| 1132 |
\item\docValue{unbroken and first}: unbroken boxes and first parts of a break sequence, |
| 1133 |
\item\docValue{middle and last}: middle and last parts of a break sequence. |
| 1134 |
\item\docValue{first and middle}: first and middle parts of a break sequence. |
| 1135 |
\end{itemize} |
| 1136 |
\end{docTcbKey} |
| 1137 |
|
| 1138 |
|
| 1139 |
\clearpage |
| 1140 |
|
| 1141 |
|
| 1142 |
\begin{docTcbKey}{watermark graphics}{=\meta{file name}}{no default, initially unset} |
| 1143 |
Draws an external picture referenced by \meta{file name} |
| 1144 |
in the center of the interior region of a |tcolorbox|. |
| 1145 |
The picture is drawn \emph{after} the |
| 1146 |
frame and interior are drawn and \emph{before} the text content is drawn. |
| 1147 |
It is zoomed or stretched according the values of |
| 1148 |
\refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. |
| 1149 |
\begin{dispExample} |
| 1150 |
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} |
| 1151 |
|
| 1152 |
\begin{tcolorbox}[enhanced,title=My title,watermark graphics=Basilica_5.png, |
| 1153 |
watermark opacity=0.15] |
| 1154 |
\lipsum[1-2] |
| 1155 |
\tcblower |
| 1156 |
This example uses a public domain picture from\\ |
| 1157 |
\url{http://commons.wikimedia.org/wiki/File:Basilica_5.png} |
| 1158 |
\end{tcolorbox} |
| 1159 |
\end{dispExample} |
| 1160 |
\end{docTcbKey} |
| 1161 |
|
| 1162 |
|
| 1163 |
\begin{docTcbKey}{watermark graphics on}{=\meta{part} is \meta{file name}}{no default, initially unset} |
| 1164 |
This option draws a picture referenced by \meta{file name} in the center of the interior region of a |tcolorbox| |
| 1165 |
as described for \refKey{/tcb/watermark graphics}. |
| 1166 |
But this is done only for boxes named \meta{part} of a break sequence, see |
| 1167 |
\refKey{/tcb/breakable}.\\ |
| 1168 |
Feasible values for \meta{part} are: |
| 1169 |
\begin{itemize} |
| 1170 |
\item\docValue{broken}: all broken box parts, |
| 1171 |
\item\docValue{unbroken}: unbroken boxes only, |
| 1172 |
\item\docValue{first}: first parts of a break sequence, |
| 1173 |
\item\docValue{middle}: middle parts of a break sequence, |
| 1174 |
\item\docValue{last}: last parts of a break sequence, |
| 1175 |
\item\docValue{unbroken and first}: unbroken boxes and first parts of a break sequence, |
| 1176 |
\item\docValue{middle and last}: middle and last parts of a break sequence. |
| 1177 |
\end{itemize} |
| 1178 |
\end{docTcbKey} |
| 1179 |
|
| 1180 |
|
| 1181 |
|
| 1182 |
\clearpage |
| 1183 |
\begin{docTcbKey}{watermark tikz}{=\meta{graphical code}}{no default, initially unset} |
| 1184 |
Draws the given \tikzname\ \meta{graphical code} |
| 1185 |
in the center of the interior region of a |tcolorbox|. |
| 1186 |
The code is executed \emph{after} the |
| 1187 |
frame and interior are drawn and \emph{before} the text content is drawn. |
| 1188 |
The result is zoomed or stretched according the values of |
| 1189 |
\refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. |
| 1190 |
\begin{dispExample} |
| 1191 |
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} |
| 1192 |
|
| 1193 |
\begin{tcolorbox}[enhanced,title=My title, |
| 1194 |
watermark tikz={\draw[line width=2mm] circle (1cm) |
| 1195 |
node{\fontfamily{ptm}\fontseries{b}\fontsize{20mm}{20mm}\selectfont ?};}] |
| 1196 |
\lipsum[1] |
| 1197 |
\tcblower |
| 1198 |
\lipsum[2] |
| 1199 |
\end{tcolorbox} |
| 1200 |
\end{dispExample} |
| 1201 |
\end{docTcbKey} |
| 1202 |
|
| 1203 |
|
| 1204 |
|
| 1205 |
\begin{docTcbKey}{watermark tikz on}{=\meta{part} is \meta{graphical code}}{no default, initially unset} |
| 1206 |
This option draws the given \tikzname\ \meta{graphical code} in the center of the interior region of a |tcolorbox| |
| 1207 |
as described for \refKey{/tcb/watermark tikz}. |
| 1208 |
But this is done only for boxes named \meta{part} of a break sequence, see |
| 1209 |
\refKey{/tcb/breakable}.\\ |
| 1210 |
Feasible values for \meta{part} are: |
| 1211 |
\begin{itemize} |
| 1212 |
\item\docValue{broken}: all broken box parts, |
| 1213 |
\item\docValue{unbroken}: unbroken boxes only, |
| 1214 |
\item\docValue{first}: first parts of a break sequence, |
| 1215 |
\item\docValue{middle}: middle parts of a break sequence, |
| 1216 |
\item\docValue{last}: last parts of a break sequence, |
| 1217 |
\item\docValue{unbroken and first}: unbroken boxes and first parts of a break sequence, |
| 1218 |
\item\docValue{middle and last}: middle and last parts of a break sequence. |
| 1219 |
\end{itemize} |
| 1220 |
\end{docTcbKey} |
| 1221 |
|
| 1222 |
|
| 1223 |
\begin{docTcbKey}{no watermark}{}{style, no default, initially set} |
| 1224 |
Removes the watermark if set before. This is an alias for |
| 1225 |
\refKey{/tcb/no overlay}. |
| 1226 |
\end{docTcbKey} |
| 1227 |
|
| 1228 |
|
| 1229 |
\clearpage |
| 1230 |
\begin{docTcbKey}{watermark opacity}{=\meta{fraction}}{no default, initially |1.00|} |
| 1231 |
Sets the opacity value $\in[0,1]$ for a watermark. |
| 1232 |
\begin{dispExample} |
| 1233 |
\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, |
| 1234 |
watermark text=Watermark,nobeforeafter,width=(\linewidth-2mm)/2} |
| 1235 |
|
| 1236 |
\begin{tcolorbox}[title=Opacity 1.00,watermark opacity=1.00] |
| 1237 |
\lipsum[2] |
| 1238 |
\end{tcolorbox}\hfill% |
| 1239 |
\begin{tcolorbox}[title=Opacity 0.50,watermark opacity=0.50] |
| 1240 |
\lipsum[2] |
| 1241 |
\end{tcolorbox}% |
| 1242 |
\end{dispExample} |
| 1243 |
\end{docTcbKey} |
| 1244 |
|
| 1245 |
\enlargethispage*{1cm} |
| 1246 |
|
| 1247 |
\begin{docTcbKey}[][doc updated=2022-07-21]{watermark zoom}{=\meta{fraction}}{default |1|, initially |0.75|} |
| 1248 |
Sets the zoom value for a watermark. The zoom respects the aspect ratio. |
| 1249 |
The value $1.0$ means to fill the whole box until the watermark touches the frame. |
| 1250 |
\begin{dispExample} |
| 1251 |
\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, |
| 1252 |
watermark text=Watermark,nobeforeafter,width=(\linewidth-2mm)/2} |
| 1253 |
|
| 1254 |
\begin{tcolorbox}[title=Zoom 1.0,watermark zoom=1.0] |
| 1255 |
\lipsum[2] |
| 1256 |
\end{tcolorbox}\hfill% |
| 1257 |
\begin{tcolorbox}[title=Zoom 0.5,watermark zoom=0.5] |
| 1258 |
\lipsum[2] |
| 1259 |
\end{tcolorbox}% |
| 1260 |
\end{dispExample} |
| 1261 |
\end{docTcbKey} |
| 1262 |
|
| 1263 |
\clearpage |
| 1264 |
|
| 1265 |
\begin{docTcbKey}[][doc updated=2022-07-21]{watermark shrink}{=\meta{fraction}}{default |1|, initially unset} |
| 1266 |
Identically to \refKey{/tcb/watermark zoom}, but the watermark |
| 1267 |
never gets enlarged. Thus, the watermark keeps its original size or is shrunk. |
| 1268 |
\end{docTcbKey} |
| 1269 |
|
| 1270 |
|
| 1271 |
\begin{docTcbKey}[][doc updated=2022-07-21]{watermark overzoom}{=\meta{fraction}}{default |1|, initially unset} |
| 1272 |
Sets the overzoom value for a watermark. The overzoom respects the aspect ratio. |
| 1273 |
The value $1.0$ means to fill the whole box until the watermark touches |
| 1274 |
all four sides of the frame. |
| 1275 |
\begin{dispExample} |
| 1276 |
\tcbset{enhanced,colback=white,colframe=blue!50!black,fonttitle=\bfseries, |
| 1277 |
watermark opacity=0.5, |
| 1278 |
watermark graphics=lichtspiel.jpg,nobeforeafter,width=(\linewidth-2mm)/2} |
| 1279 |
|
| 1280 |
\begin{tcolorbox}[title=Zoom 1.0,watermark zoom=1.0] |
| 1281 |
\lipsum[1] |
| 1282 |
\end{tcolorbox}\hfill% |
| 1283 |
\begin{tcolorbox}[title=Overzoom 1.0,watermark overzoom=1.0] |
| 1284 |
\lipsum[1] |
| 1285 |
\end{tcolorbox}% |
| 1286 |
\end{dispExample} |
| 1287 |
\end{docTcbKey} |
| 1288 |
|
| 1289 |
\begin{marker} |
| 1290 |
If a \refKey{/tcb/watermark overzoom} value of |1.0| is used in connection |
| 1291 |
with invisible top and bottom rules which still have a thickness greater than |0pt|, |
| 1292 |
the space of these invisible rules may not be covered by the watermark. |
| 1293 |
For example, this situation may occur during the breaking of \refKey{/tcb/enhanced} boxes. |
| 1294 |
To avoid this optical glitch, just set \refKey{/tcb/pad at break} to any desired value. |
| 1295 |
\end{marker} |
| 1296 |
|
| 1297 |
\clearpage |
| 1298 |
\begin{docTcbKey}[][doc updated=2022-07-21]{watermark stretch}{=\meta{fraction}}{default |1|, initially unset} |
| 1299 |
Sets the stretch value for a watermark. The stretch value is applied to width |
| 1300 |
and height in relation to the box dimensions. It does not respect the aspect ratio. |
| 1301 |
The value $1.0$ means to fill the whole box. |
| 1302 |
\begin{dispExample} |
| 1303 |
\tcbset{enhanced,colback=white,colframe=blue!50!black,fonttitle=\bfseries, |
| 1304 |
watermark graphics=lichtspiel.jpg,watermark opacity=0.5, |
| 1305 |
nobeforeafter,width=(\linewidth-2mm)/2} |
| 1306 |
|
| 1307 |
\begin{tcolorbox}[title=Stretch 1.00,watermark stretch=1.00] |
| 1308 |
\lipsum[2] |
| 1309 |
\end{tcolorbox}\hfill% |
| 1310 |
\begin{tcolorbox}[title=Stretch 0.50,watermark stretch=0.50] |
| 1311 |
\lipsum[2] |
| 1312 |
\end{tcolorbox}% |
| 1313 |
\end{dispExample} |
| 1314 |
\end{docTcbKey} |
| 1315 |
|
| 1316 |
\begin{docTcbKey}{watermark color}{=\meta{color}}{no default, initially mixed background and frame color} |
| 1317 |
Sets the color for the watermark. |
| 1318 |
\begin{dispExample} |
| 1319 |
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} |
| 1320 |
|
| 1321 |
\begin{tcolorbox}[enhanced,title=My title,watermark text=My Watermark, |
| 1322 |
watermark color=yellow!50!red] |
| 1323 |
\lipsum[1] |
| 1324 |
\end{tcolorbox} |
| 1325 |
\end{dispExample} |
| 1326 |
\end{docTcbKey} |
| 1327 |
|
| 1328 |
\clearpage |
| 1329 |
|
| 1330 |
\begin{docTcbKey}{clip watermark}{\colOpt{=true\textbar false}}{default |true|, initially |true|} |
| 1331 |
Sets the watermark to be clipped to the interior area. |
| 1332 |
\begin{dispExample} |
| 1333 |
\tcbset{enhanced,colback=white,colframe=blue!50!white,fonttitle=\bfseries, |
| 1334 |
watermark opacity=0.5,watermark stretch=1.00,arc=3mm, |
| 1335 |
watermark graphics=lichtspiel.jpg} |
| 1336 |
|
| 1337 |
\begin{tcolorbox}[title=Clip (default),clip watermark] |
| 1338 |
\lipsum[1] |
| 1339 |
\end{tcolorbox} |
| 1340 |
|
| 1341 |
\begin{tcolorbox}[title=No clip,clip watermark=false] |
| 1342 |
\lipsum[1] |
| 1343 |
\end{tcolorbox}% |
| 1344 |
\end{dispExample} |
| 1345 |
\end{docTcbKey} |
| 1346 |
|
| 1347 |
\begin{marker} |
| 1348 |
Removing the clipping should be necessary only in very rare situations. Until |
| 1349 |
version 5.1.1 (2022/06/24), theoretically, the watermark could be extended |
| 1350 |
over the boundaries of the box without limit. Newer versions restrict the |
| 1351 |
watermark to a box scaled 4 times the actual |tcolorbox|. |
| 1352 |
If you really need to extend further, you are strongly advised to implement |
| 1353 |
this by using \refKey{/tcb/overlay} or \refKey{/tcb/underlay} directly |
| 1354 |
where no restrictions apply. |
| 1355 |
Note that a watermark is just a special \refKey{/tcb/overlay}. |
| 1356 |
\end{marker} |
| 1357 |
|
| 1358 |
|
| 1359 |
\clearpage |
| 1360 |
\subsection{Clip Environments}\label{subsec:clipping} |
| 1361 |
The following clip environments are applicable for all skins which |
| 1362 |
use engines of type |path|, |pathfirst|, |pathmiddle|, or |pathlast|. |
| 1363 |
Especially, the skin \refSkin{enhanced} supports \emph{all} of them |
| 1364 |
and \refSkin{standard} \emph{none}. The typical area of application |
| 1365 |
is inside overlay code, see Section \ref{subsec:overlays} from |
| 1366 |
page \pageref{subsec:overlays}. |
| 1367 |
|
| 1368 |
|
| 1369 |
\begin{docEnvironment}{tcbclipframe}{} |
| 1370 |
Defines a \tikzname\ scope which clips to the frame area path. |
| 1371 |
\begin{dispExample} |
| 1372 |
\makeatletter |
| 1373 |
\newtcolorbox{picturebox}[2][]{% |
| 1374 |
enhanced,frame hidden,interior hidden,fonttitle=\bfseries, |
| 1375 |
overlay={\begin{tcbclipframe}\node at (frame) |
| 1376 |
{\includegraphics[width=\tcb@width,height=\tcb@height]{#2}};\end{tcbclipframe}% |
| 1377 |
\begin{tcbclipinterior}\fill[white,opacity=0.75] |
| 1378 |
(frame.south west) rectangle (frame.north east);\end{tcbclipinterior}},#1} |
| 1379 |
\makeatother |
| 1380 |
|
| 1381 |
\begin{picturebox}[title=My Picture Box]{lichtspiel.jpg} |
| 1382 |
\lipsum[1] |
| 1383 |
\end{picturebox} |
| 1384 |
\end{dispExample} |
| 1385 |
\end{docEnvironment} |
| 1386 |
|
| 1387 |
\clearpage |
| 1388 |
\begin{docEnvironment}{tcbinvclipframe}{} |
| 1389 |
Defines a \tikzname\ scope which clips to the \emph{outside} of the frame area path. |
| 1390 |
|
| 1391 |
\begin{dispExample*}{segmentation style={preaction={fill=white},pattern=checkerboard,pattern color=gray!40}} |
| 1392 |
\tcbset{enhanced jigsaw,fonttitle=\bfseries,opacityback=0.35,colback=blue!5!white, |
| 1393 |
frame style={left color=red!75!black,right color=red!10!yellow}} |
| 1394 |
|
| 1395 |
\begin{tikzpicture}% draw two balls |
| 1396 |
\path[use as bounding box] (0,0.8) rectangle +(0.1,0.1); |
| 1397 |
\shadedraw [shading=ball] (0,0) circle (1cm); |
| 1398 |
\shadedraw [ball color=red] (3,-2.2) circle (1cm); |
| 1399 |
\end{tikzpicture} |
| 1400 |
|
| 1401 |
\begin{tcolorbox}[title=A translucent box, |
| 1402 |
overlay={\begin{tcbinvclipframe} |
| 1403 |
\draw[red,line width=1cm] ([xshift=-2mm,yshift=2mm]frame.north west) |
| 1404 |
--([xshift=2mm,yshift=-2mm]frame.south east); |
| 1405 |
\draw[red,line width=1cm] ([xshift=-2mm,yshift=-2mm]frame.south west) |
| 1406 |
--([xshift=2mm,yshift=2mm]frame.north east); |
| 1407 |
\end{tcbinvclipframe}}] |
| 1408 |
\lipsum[2] |
| 1409 |
\end{tcolorbox} |
| 1410 |
\end{dispExample*} |
| 1411 |
\end{docEnvironment} |
| 1412 |
|
| 1413 |
\clearpage |
| 1414 |
\begin{docEnvironment}{tcbclipinterior}{} |
| 1415 |
Defines a \tikzname\ scope which clips to the interior area path. |
| 1416 |
\begin{dispExample} |
| 1417 |
\begin{tcolorbox}[enhanced,title=My Title, |
| 1418 |
overlay={\begin{tcbclipinterior} |
| 1419 |
\draw[red,line width=1cm] (interior.north west)--(interior.south east); |
| 1420 |
\draw[red,line width=1cm] (interior.south west)--(interior.north east); |
| 1421 |
\end{tcbclipinterior}}] |
| 1422 |
\lipsum[1] |
| 1423 |
\end{tcolorbox} |
| 1424 |
\end{dispExample} |
| 1425 |
\end{docEnvironment} |
| 1426 |
|
| 1427 |
\begin{docEnvironment}{tcbcliptitle}{} |
| 1428 |
Defines a \tikzname\ scope which clips to the title area path. |
| 1429 |
\begin{dispExample} |
| 1430 |
\begin{tcolorbox}[enhanced,title=My Title,colframe=blue,colback=yellow!10!white, |
| 1431 |
overlay={\begin{tcbcliptitle}\node at (title) |
| 1432 |
{\includegraphics[width=\linewidth]{lichtspiel.jpg}};\end{tcbcliptitle}}] |
| 1433 |
\lipsum[1] |
| 1434 |
\end{tcolorbox} |
| 1435 |
\end{dispExample} |
| 1436 |
\end{docEnvironment} |
| 1437 |
|
| 1438 |
\clearpage |
| 1439 |
\begin{docTcbKey}{clip title}{\colOpt{=true\textbar false}}{default |true|, initially |false|} |
| 1440 |
Sets the title to be clipped to the title area. |
| 1441 |
\begin{dispExample} |
| 1442 |
\tcbset{enhanced,width=5cm,colframe=red!50!white,coltitle=black, |
| 1443 |
colbacktitle=yellow!50!white} |
| 1444 |
|
| 1445 |
\begin{tcolorbox}[title=\mbox{This is a title which is unbreakable and far too long}] |
| 1446 |
This is a tcolorbox. |
| 1447 |
\end{tcolorbox} |
| 1448 |
|
| 1449 |
\begin{tcolorbox}[title=\mbox{This is a title which is unbreakable and far too long}, |
| 1450 |
clip title] |
| 1451 |
This is a tcolorbox. |
| 1452 |
\end{tcolorbox} |
| 1453 |
\end{dispExample} |
| 1454 |
\end{docTcbKey} |
| 1455 |
|
| 1456 |
|
| 1457 |
\begin{docTcbKey}{clip upper}{\colOpt{=true\textbar false}}{default |true|, initially |false|} |
| 1458 |
Sets the upper part to be clipped to the interior area. |
| 1459 |
\begin{dispExample} |
| 1460 |
\newcommand{\mygraphics}[2][]{% |
| 1461 |
\tcbox[enhanced,boxsep=0pt,top=0pt,bottom=0pt,left=0pt, |
| 1462 |
right=0pt,boxrule=0.4pt,drop fuzzy shadow,clip upper, |
| 1463 |
colback=black!75!white,toptitle=2pt,bottomtitle=2pt,nobeforeafter, |
| 1464 |
center title,fonttitle=\small\sffamily,title=\detokenize{#2}] |
| 1465 |
{\includegraphics[width=\the\dimexpr(\linewidth-4mm)/2\relax]{#2}}} |
| 1466 |
|
| 1467 |
\mygraphics{lichtspiel.jpg}\hfill |
| 1468 |
\mygraphics{Basilica_5.png} |
| 1469 |
\end{dispExample} |
| 1470 |
\end{docTcbKey} |
| 1471 |
|
| 1472 |
\clearpage |
| 1473 |
The example for \refKey{/tcb/clip upper} sizes the box according to |
| 1474 |
the dimensions of the picture. To do it the other way around, the watermark |
| 1475 |
options provide an easy solution. |
| 1476 |
\begin{dispExample} |
| 1477 |
\newcommand{\mygraphics}[2][]{% |
| 1478 |
\tcbox[enhanced,capture=minipage,boxsep=0pt,top=0pt,bottom=0pt,left=0pt, |
| 1479 |
right=0pt,boxrule=0.4pt,drop fuzzy shadow,nobeforeafter, |
| 1480 |
colback=black!75!white,toptitle=2pt,bottomtitle=2pt, |
| 1481 |
center title,fonttitle=\small\sffamily,title=\detokenize{#2}, |
| 1482 |
width=(\linewidth-4mm)/2,height=6cm,colbacktitle={black}, |
| 1483 |
watermark zoom=1.0,watermark graphics={#2}]{}} |
| 1484 |
|
| 1485 |
\mygraphics{lichtspiel.jpg}\hfill |
| 1486 |
\mygraphics{Basilica_5.png} |
| 1487 |
\end{dispExample} |
| 1488 |
|
| 1489 |
|
| 1490 |
\begin{docTcbKey}{clip lower}{\colOpt{=true\textbar false}}{default |true|, initially |false|} |
| 1491 |
Sets the lower part to be clipped to the interior area. |
| 1492 |
\begin{dispExample} |
| 1493 |
\tcbset{enhanced,width=5cm,colframe=red!50!black,text and listing} |
| 1494 |
|
| 1495 |
\begin{tcblisting}{} |
| 1496 |
Donau\-dampf\-schiff\-fahrts\-ka\-pi\-t\"ans\-m\"ut\-zen\-fran\-sen |
| 1497 |
\end{tcblisting} |
| 1498 |
|
| 1499 |
\begin{tcblisting}{clip lower} |
| 1500 |
Donau\-dampf\-schiff\-fahrts\-ka\-pi\-t\"ans\-m\"ut\-zen\-fran\-sen |
| 1501 |
\end{tcblisting} |
| 1502 |
\end{dispExample} |
| 1503 |
\end{docTcbKey} |
| 1504 |
|
| 1505 |
|
| 1506 |
\clearpage |
| 1507 |
\subsection{Border Line Option Keys}\label{subsec:borderline} |
| 1508 |
The skin \refSkin{standard} does not support these border lines, |
| 1509 |
but most other skins, e.\,g.\ \refSkin{enhanced}. |
| 1510 |
|
| 1511 |
The borderlines are independent from the normal |tcolorbox| rules. |
| 1512 |
They may be used with or without the \refKey{/tcb/segmentation engine}. |
| 1513 |
|
| 1514 |
The borderlines are stackable, i.\,e., several different border lines can be |
| 1515 |
used on the same |tcolorbox|. They are drawn \emph{after} the box frame and box |
| 1516 |
interior and \emph{before} overlays or watermarks. |
| 1517 |
|
| 1518 |
\begin{marker} |
| 1519 |
Technically, the normal |tcolorbox| rules result from a \tikzname\ \emph{filling} |
| 1520 |
process. The border lines are created by a \tikzname\ \emph{drawing} process. |
| 1521 |
This can be used to apply different effects. |
| 1522 |
\end{marker} |
| 1523 |
|
| 1524 |
|
| 1525 |
\begin{docTcbKey}{borderline}{=\marg{width}\marg{offset}\marg{options}}{no default, initially unset} |
| 1526 |
Adds a new borderline to the stack of border lines. |
| 1527 |
This border line is drawn with the given \meta{width} and gets an |
| 1528 |
\meta{offset} computed from the frame outline. A positive \meta{offset} value |
| 1529 |
moves the borderline inside the |tcolorbox| and a negative \meta{offset} value |
| 1530 |
moves it outside without changing the bounding box.\\ |
| 1531 |
The border line is drawn along a \tikzname\ path with the given \tikzname\ \meta{options}. |
| 1532 |
Note that the \tikzname\ |line width| option should not be used here.\\ |
| 1533 |
The border lines adapt to the rounded corners of the |tcolorbox|. An inside |
| 1534 |
borderline will switch to sharp corners if necessary, an outside borderline will |
| 1535 |
always be rounded except for \refKey{/tcb/sharp corners}. |
| 1536 |
\begin{dispExample} |
| 1537 |
\begin{tcolorbox}[enhanced,title=Rounded corners,fonttitle=\bfseries,boxsep=5pt, |
| 1538 |
arc=8pt, |
| 1539 |
borderline={0.5pt}{0pt}{red}, |
| 1540 |
borderline={0.5pt}{5pt}{blue,dotted}, |
| 1541 |
borderline={0.5pt}{-5pt}{green} ] |
| 1542 |
This is a tcolorbox. |
| 1543 |
\end{tcolorbox} |
| 1544 |
\bigskip |
| 1545 |
\begin{tcolorbox}[enhanced,title=Sharp corners,fonttitle=\bfseries,boxsep=5pt, |
| 1546 |
arc=8pt,sharp corners=downhill, |
| 1547 |
borderline={0.5pt}{0pt}{red}, |
| 1548 |
borderline={0.5pt}{5pt}{blue,dotted}, |
| 1549 |
borderline={0.5pt}{-5pt}{green} ] |
| 1550 |
This is a tcolorbox. |
| 1551 |
\end{tcolorbox} |
| 1552 |
\end{dispExample} |
| 1553 |
|
| 1554 |
\begin{dispExample} |
| 1555 |
% \usepackage{lipsum} |
| 1556 |
\begin{tcolorbox}[enhanced,arc=3mm,boxrule=1.5mm,boxsep=1.5mm, |
| 1557 |
colback=yellow!20!white, |
| 1558 |
colframe=blue, |
| 1559 |
borderline={1mm}{1mm}{white}, |
| 1560 |
borderline={1mm}{2mm}{red} ] |
| 1561 |
\lipsum[1] |
| 1562 |
\end{tcolorbox} |
| 1563 |
\end{dispExample} |
| 1564 |
|
| 1565 |
|
| 1566 |
\begin{dispExample} |
| 1567 |
% \usepackage{lipsum} |
| 1568 |
\begin{tcolorbox}[enhanced,arc=3mm,boxrule=1.5mm, |
| 1569 |
frame hidden,colback=blue!10!white, |
| 1570 |
borderline={1mm}{0mm}{blue,dotted} ] |
| 1571 |
\lipsum[2] |
| 1572 |
\end{tcolorbox} |
| 1573 |
\end{dispExample} |
| 1574 |
|
| 1575 |
|
| 1576 |
\begin{dispExample} |
| 1577 |
% \usepackage{lipsum} |
| 1578 |
\begin{tcolorbox}[enhanced,skin=enhancedmiddle, |
| 1579 |
frame hidden,interior hidden,top=0mm,bottom=0mm,boxsep=0mm, |
| 1580 |
borderline={0.75mm}{0mm}{red}, |
| 1581 |
borderline={0.75mm}{0.75mm}{red!50!yellow}, |
| 1582 |
borderline={0.75mm}{1.5mm}{yellow}, ] |
| 1583 |
\lipsum[3] |
| 1584 |
\end{tcolorbox} |
| 1585 |
\end{dispExample} |
| 1586 |
|
| 1587 |
\begin{dispExample} |
| 1588 |
% \usepackage{lipsum} |
| 1589 |
\newtcolorbox{mygreenbox}[2][]{% |
| 1590 |
enhanced,width=\linewidth-6pt, |
| 1591 |
enlarge top by=3pt,enlarge bottom by=3pt, |
| 1592 |
enlarge left by=3pt,enlarge right by=3pt, |
| 1593 |
title={#2},frame hidden,boxrule=0pt,top=1mm,bottom=1mm, |
| 1594 |
colframe=green!30!black, colbacktitle=green!50!yellow, |
| 1595 |
coltitle=black, colback=green!25!white, |
| 1596 |
borderline={0.5pt}{-0.5pt}{green!75!blue}, |
| 1597 |
borderline={1pt}{-3pt}{green!50!blue},#1} |
| 1598 |
|
| 1599 |
\begin{mygreenbox}{My title} |
| 1600 |
\lipsum[4] |
| 1601 |
\end{mygreenbox} |
| 1602 |
\end{dispExample} |
| 1603 |
\end{docTcbKey} |
| 1604 |
|
| 1605 |
|
| 1606 |
\begin{docTcbKey}{no borderline}{}{no default, initially set} |
| 1607 |
Removes all borderlines if set before. |
| 1608 |
\end{docTcbKey} |
| 1609 |
|
| 1610 |
|
| 1611 |
\begin{docTcbKey}{show bounding box}{\colOpt{=\meta{color}}}{default |red|, initially unset} |
| 1612 |
Displays the bounding box borderline of a |tcolorbox|. |
| 1613 |
Its intended use is debugging and fine tuning. |
| 1614 |
It should not be part of a final document. |
| 1615 |
The optional \meta{color} is the base color for the bounding box |
| 1616 |
borderline. |
| 1617 |
\begin{dispExample} |
| 1618 |
\tcbset{enhanced,nobeforeafter,width=4cm,fonttitle=\bfseries} |
| 1619 |
|
| 1620 |
\begin{tcolorbox}[show bounding box,title=Normal] |
| 1621 |
This is a tcolorbox. |
| 1622 |
\end{tcolorbox}% |
| 1623 |
\begin{tcolorbox}[show bounding box=blue,title=Shadow,drop fuzzy shadow] |
| 1624 |
This is a tcolorbox. |
| 1625 |
\end{tcolorbox}% |
| 1626 |
\begin{tcolorbox}[show bounding box=green,title=Enlarged,drop fuzzy shadow, |
| 1627 |
enlarge by=2mm] |
| 1628 |
This is a tcolorbox. |
| 1629 |
\end{tcolorbox} |
| 1630 |
\end{dispExample} |
| 1631 |
\end{docTcbKey} |
| 1632 |
|
| 1633 |
\clearpage |
| 1634 |
|
| 1635 |
\begin{marker} |
| 1636 |
The following \emph{partial} borderlines act slightly different from the |
| 1637 |
complete borderlines described before. They ignore rounded corner settings, |
| 1638 |
their length is not modified by their \meta{offset}, they ignore skin settings |
| 1639 |
but adapt to breakable boxes. |
| 1640 |
\end{marker} |
| 1641 |
|
| 1642 |
\begin{docTcbKey}[][doc new=2014-10-20]{borderline north}{=\marg{width}\marg{offset}\marg{options}}{no default, initially unset} |
| 1643 |
Adds a new borderline with the given \meta{width} to the |
| 1644 |
north of the |tcolorbox|. |
| 1645 |
A positive \meta{offset} value |
| 1646 |
moves the borderline inside the |tcolorbox| and a negative \meta{offset} value |
| 1647 |
moves it outside without changing the bounding box. |
| 1648 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1649 |
\begin{tcolorbox}[enhanced, |
| 1650 |
borderline north={2pt}{-2pt}{red}] |
| 1651 |
This is a \textbf{tcolorbox}. |
| 1652 |
\end{tcolorbox} |
| 1653 |
\end{dispExample*} |
| 1654 |
\end{docTcbKey} |
| 1655 |
|
| 1656 |
\begin{docTcbKey}[][doc new=2014-10-20]{borderline south}{=\marg{width}\marg{offset}\marg{options}}{no default, initially unset} |
| 1657 |
Adds a new borderline with the given \meta{width} to the |
| 1658 |
south of the |tcolorbox|. |
| 1659 |
A positive \meta{offset} value |
| 1660 |
moves the borderline inside the |tcolorbox| and a negative \meta{offset} value |
| 1661 |
moves it outside without changing the bounding box. |
| 1662 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1663 |
\begin{tcolorbox}[enhanced, |
| 1664 |
borderline south={2pt}{-2pt}{red}] |
| 1665 |
This is a \textbf{tcolorbox}. |
| 1666 |
\end{tcolorbox} |
| 1667 |
\end{dispExample*} |
| 1668 |
\end{docTcbKey} |
| 1669 |
|
| 1670 |
\begin{docTcbKey}[][doc new=2014-10-20]{borderline east}{=\marg{width}\marg{offset}\marg{options}}{no default, initially unset} |
| 1671 |
Adds a new borderline with the given \meta{width} to the |
| 1672 |
east of the |tcolorbox|. |
| 1673 |
A positive \meta{offset} value |
| 1674 |
moves the borderline inside the |tcolorbox| and a negative \meta{offset} value |
| 1675 |
moves it outside without changing the bounding box. |
| 1676 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1677 |
\begin{tcolorbox}[enhanced, |
| 1678 |
borderline east={2pt}{-2pt}{red}] |
| 1679 |
This is a \textbf{tcolorbox}. |
| 1680 |
\end{tcolorbox} |
| 1681 |
\end{dispExample*} |
| 1682 |
\end{docTcbKey} |
| 1683 |
|
| 1684 |
\begin{docTcbKey}[][doc new=2014-10-20]{borderline west}{=\marg{width}\marg{offset}\marg{options}}{no default, initially unset} |
| 1685 |
Adds a new borderline with the given \meta{width} to the |
| 1686 |
west of the |tcolorbox|. |
| 1687 |
A positive \meta{offset} value |
| 1688 |
moves the borderline inside the |tcolorbox| and a negative \meta{offset} value |
| 1689 |
moves it outside without changing the bounding box. |
| 1690 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1691 |
\begin{tcolorbox}[enhanced, |
| 1692 |
borderline west={2pt}{-2pt}{red}] |
| 1693 |
This is a \textbf{tcolorbox}. |
| 1694 |
\end{tcolorbox} |
| 1695 |
\end{dispExample*} |
| 1696 |
\end{docTcbKey} |
| 1697 |
|
| 1698 |
\clearpage |
| 1699 |
\begin{docTcbKey}[][doc new=2014-10-20]{borderline horizontal}{=\marg{width}\marg{offset}\marg{options}}{no default, initially unset} |
| 1700 |
Adds a new borderline with the given \meta{width} to the |
| 1701 |
north and south of the |tcolorbox|. |
| 1702 |
A positive \meta{offset} value |
| 1703 |
moves the borderlines inside the |tcolorbox| and a negative \meta{offset} value |
| 1704 |
moves them outside without changing the bounding box. |
| 1705 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1706 |
\begin{tcolorbox}[blanker,top=3mm,bottom=3mm, |
| 1707 |
borderline horizontal={2pt}{0pt}{red}] |
| 1708 |
This is a \textbf{tcolorbox}. |
| 1709 |
\end{tcolorbox} |
| 1710 |
\end{dispExample*} |
| 1711 |
\end{docTcbKey} |
| 1712 |
|
| 1713 |
|
| 1714 |
\begin{docTcbKey}[][doc new=2014-10-20]{borderline vertical}{=\marg{width}\marg{offset}\marg{options}}{no default, initially unset} |
| 1715 |
Adds a new borderline with the given \meta{width} to the |
| 1716 |
east and west of the |tcolorbox|. |
| 1717 |
A positive \meta{offset} value |
| 1718 |
moves the borderlines inside the |tcolorbox| and a negative \meta{offset} value |
| 1719 |
moves them outside without changing the bounding box. |
| 1720 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1721 |
\begin{tcolorbox}[blanker,left=3mm,right=3mm, |
| 1722 |
borderline vertical={2pt}{0pt}{red}] |
| 1723 |
This is a \textbf{tcolorbox}.\\ |
| 1724 |
My second line. |
| 1725 |
\end{tcolorbox} |
| 1726 |
\end{dispExample*} |
| 1727 |
\end{docTcbKey} |
| 1728 |
|
| 1729 |
\begin{dispExample} |
| 1730 |
\begin{tcolorbox}[enhanced,colback=yellow!10!white,boxrule=0pt,frame hidden, |
| 1731 |
borderline north={1mm}{-2mm}{red}, |
| 1732 |
borderline south={1mm}{-2mm}{blue}, |
| 1733 |
borderline west={1mm}{-2mm}{green}, |
| 1734 |
borderline east={1mm}{-2mm}{yellow}] |
| 1735 |
\lipsum[1] |
| 1736 |
\end{tcolorbox} |
| 1737 |
\end{dispExample} |
| 1738 |
|
| 1739 |
\clearpage |
| 1740 |
\subsection{Shadow Option Keys}\label{subsec:shadows} |
| 1741 |
The skin \refSkin{standard} does not support these shadows, |
| 1742 |
but most other skins, e.\,g.\ \refSkin{enhanced}. |
| 1743 |
|
| 1744 |
The shadows are stackable, i.\,e., several different shadows can be |
| 1745 |
used on the same |tcolorbox|. They are drawn \emph{before} the box frame is drawn. |
| 1746 |
|
| 1747 |
\begin{docTcbKey}{no shadow}{}{no default} |
| 1748 |
Removes all shadows if set before. |
| 1749 |
\end{docTcbKey} |
| 1750 |
|
| 1751 |
\subsubsection{Common Shadows and Halos} |
| 1752 |
|
| 1753 |
\begin{docTcbKey}{drop shadow}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1754 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1755 |
Optionally, the \meta{color} for the shadow can be changed. |
| 1756 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1757 |
\tcbset{enhanced,colback=red!5!white, |
| 1758 |
colframe=red!75!black,fonttitle=\bfseries} |
| 1759 |
|
| 1760 |
\begin{tcolorbox}[drop shadow] |
| 1761 |
This is a tcolorbox. |
| 1762 |
\end{tcolorbox}\par\bigskip |
| 1763 |
\begin{tcolorbox}[title=Another shadow, |
| 1764 |
drop shadow=blue] |
| 1765 |
This is a tcolorbox. |
| 1766 |
\end{tcolorbox} |
| 1767 |
\end{dispExample*} |
| 1768 |
\end{docTcbKey} |
| 1769 |
|
| 1770 |
|
| 1771 |
\begin{docTcbKey}{drop fuzzy shadow}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1772 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 1773 |
Optionally, the \meta{color} for the shadow can be changed. |
| 1774 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1775 |
\tcbset{enhanced,colback=red!5!white, |
| 1776 |
colframe=red!75!black,fonttitle=\bfseries} |
| 1777 |
|
| 1778 |
\begin{tcolorbox}[drop fuzzy shadow] |
| 1779 |
This is a tcolorbox. |
| 1780 |
\end{tcolorbox}\par\bigskip |
| 1781 |
\begin{tcolorbox}[title=Another shadow, |
| 1782 |
drop fuzzy shadow=blue] |
| 1783 |
This is a tcolorbox. |
| 1784 |
\end{tcolorbox} |
| 1785 |
\end{dispExample*} |
| 1786 |
\end{docTcbKey} |
| 1787 |
|
| 1788 |
|
| 1789 |
\begin{docTcbKey}{drop midday shadow}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1790 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1791 |
Optionally, the \meta{color} for the shadow can be changed. |
| 1792 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1793 |
\tcbset{enhanced,colback=red!5!white, |
| 1794 |
colframe=red!75!black,fonttitle=\bfseries} |
| 1795 |
|
| 1796 |
\begin{tcolorbox}[drop midday shadow] |
| 1797 |
This is a tcolorbox. |
| 1798 |
\end{tcolorbox}\par\bigskip |
| 1799 |
\begin{tcolorbox}[title=Another shadow, |
| 1800 |
drop midday shadow=blue] |
| 1801 |
This is a tcolorbox. |
| 1802 |
\end{tcolorbox} |
| 1803 |
\end{dispExample*} |
| 1804 |
\end{docTcbKey} |
| 1805 |
|
| 1806 |
%\enlargethispage*{2cm} |
| 1807 |
\begin{docTcbKey}{drop fuzzy midday shadow}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1808 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 1809 |
Optionally, the \meta{color} for the shadow can be changed. |
| 1810 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1811 |
\tcbset{enhanced,colback=red!5!white, |
| 1812 |
colframe=red!75!black,fonttitle=\bfseries} |
| 1813 |
|
| 1814 |
\begin{tcolorbox}[drop fuzzy midday shadow] |
| 1815 |
This is a tcolorbox. |
| 1816 |
\end{tcolorbox}\par\bigskip |
| 1817 |
\begin{tcolorbox}[title=Another shadow, |
| 1818 |
drop fuzzy midday shadow=blue] |
| 1819 |
This is a tcolorbox. |
| 1820 |
\end{tcolorbox} |
| 1821 |
\end{dispExample*} |
| 1822 |
\end{docTcbKey} |
| 1823 |
|
| 1824 |
|
| 1825 |
\begin{docTcbKey}{halo}{\colOpt{=\meta{size} \texttt{with} \meta{color}}}{style, default |0.9mm with yellow|} |
| 1826 |
Adds a new halo shadow with the given \meta{color} |
| 1827 |
which overlaps the colorbox an all sides by \meta{size}. |
| 1828 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1829 |
\tcbset{enhanced,colback=red!5!white, |
| 1830 |
colframe=red!75!black,fonttitle=\bfseries} |
| 1831 |
|
| 1832 |
\begin{tcolorbox}[title=My own halo,halo] |
| 1833 |
This is a tcolorbox. |
| 1834 |
\end{tcolorbox} |
| 1835 |
\par\bigskip\bigskip |
| 1836 |
\begin{tcolorbox}[title=Another halo, |
| 1837 |
halo=2mm with green] |
| 1838 |
This is a tcolorbox. |
| 1839 |
\end{tcolorbox} |
| 1840 |
\end{dispExample*} |
| 1841 |
\end{docTcbKey} |
| 1842 |
|
| 1843 |
\enlargethispage*{2cm} |
| 1844 |
\begin{docTcbKey}{fuzzy halo}{\colOpt{=\meta{size} \texttt{with} \meta{color}}}{style, default |0.9mm with yellow|} |
| 1845 |
Adds a new fuzzy halo shadow with the given \meta{color} |
| 1846 |
which overlaps the colorbox an all sides by \meta{size} plus |0.48mm|. |
| 1847 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 1848 |
\tcbset{enhanced,colback=red!5!white, |
| 1849 |
colframe=red!75!black,fonttitle=\bfseries} |
| 1850 |
|
| 1851 |
\begin{tcolorbox}[title=My own halo,fuzzy halo] |
| 1852 |
This is a tcolorbox. |
| 1853 |
\end{tcolorbox} |
| 1854 |
\par\bigskip\bigskip |
| 1855 |
\begin{tcolorbox}[title=Another halo, |
| 1856 |
fuzzy halo=2mm with green] |
| 1857 |
This is a tcolorbox. |
| 1858 |
\end{tcolorbox} |
| 1859 |
\end{dispExample*} |
| 1860 |
|
| 1861 |
\begin{dispExample} |
| 1862 |
\begin{tcolorbox}[blank,enhanced jigsaw,boxsep=2pt,arc=2pt, |
| 1863 |
fuzzy halo=2mm with red!50!white, |
| 1864 |
fuzzy halo=1mm with white] |
| 1865 |
\lipsum[1] |
| 1866 |
\end{tcolorbox} |
| 1867 |
\end{dispExample} |
| 1868 |
\end{docTcbKey} |
| 1869 |
|
| 1870 |
|
| 1871 |
\clearpage |
| 1872 |
For all following shadows, the optionally given \meta{color} for the shadow can be changed |
| 1873 |
equivalent to the preceding examples. |
| 1874 |
|
| 1875 |
\begin{docTcbKey}{drop shadow southeast}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1876 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1877 |
This shadow is identical to \refKey{/tcb/drop shadow}. |
| 1878 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1879 |
\begin{tcolorbox}[drop shadow southeast, |
| 1880 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1881 |
This is a tcolorbox. |
| 1882 |
\end{tcolorbox} |
| 1883 |
\end{dispExample*} |
| 1884 |
\end{docTcbKey}% |
| 1885 |
|
| 1886 |
\begin{docTcbKey}{drop shadow south}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1887 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1888 |
This shadow is identical to \refKey{/tcb/drop midday shadow}. |
| 1889 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1890 |
\begin{tcolorbox}[drop shadow south, |
| 1891 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1892 |
This is a tcolorbox. |
| 1893 |
\end{tcolorbox} |
| 1894 |
\end{dispExample*} |
| 1895 |
\end{docTcbKey}% |
| 1896 |
|
| 1897 |
\begin{docTcbKey}{drop shadow southwest}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1898 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1899 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1900 |
\begin{tcolorbox}[drop shadow southwest, |
| 1901 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1902 |
This is a tcolorbox. |
| 1903 |
\end{tcolorbox} |
| 1904 |
\end{dispExample*} |
| 1905 |
\end{docTcbKey}% |
| 1906 |
|
| 1907 |
\begin{docTcbKey}{drop shadow west}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1908 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1909 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1910 |
\begin{tcolorbox}[drop shadow west, |
| 1911 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1912 |
This is a tcolorbox. |
| 1913 |
\end{tcolorbox} |
| 1914 |
\end{dispExample*} |
| 1915 |
\end{docTcbKey}% |
| 1916 |
|
| 1917 |
\begin{docTcbKey}{drop shadow northwest}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1918 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1919 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1920 |
\begin{tcolorbox}[drop shadow northwest, |
| 1921 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1922 |
This is a tcolorbox. |
| 1923 |
\end{tcolorbox} |
| 1924 |
\end{dispExample*} |
| 1925 |
\end{docTcbKey}% |
| 1926 |
|
| 1927 |
\begin{docTcbKey}{drop shadow north}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1928 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1929 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1930 |
\begin{tcolorbox}[drop shadow north, |
| 1931 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1932 |
This is a tcolorbox. |
| 1933 |
\end{tcolorbox} |
| 1934 |
\end{dispExample*} |
| 1935 |
\end{docTcbKey}% |
| 1936 |
|
| 1937 |
\clearpage |
| 1938 |
\begin{docTcbKey}{drop shadow northeast}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1939 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1940 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1941 |
\begin{tcolorbox}[drop shadow northeast, |
| 1942 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1943 |
This is a tcolorbox. |
| 1944 |
\end{tcolorbox} |
| 1945 |
\end{dispExample*} |
| 1946 |
\end{docTcbKey}% |
| 1947 |
|
| 1948 |
\begin{docTcbKey}{drop shadow east}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1949 |
Adds a new shadow with standard dimensions to the stack of shadows. |
| 1950 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1951 |
\begin{tcolorbox}[drop shadow east, |
| 1952 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1953 |
This is a tcolorbox. |
| 1954 |
\end{tcolorbox} |
| 1955 |
\end{dispExample*} |
| 1956 |
\end{docTcbKey}% |
| 1957 |
|
| 1958 |
|
| 1959 |
\begin{docTcbKey}{drop fuzzy shadow southeast}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1960 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 1961 |
This shadow is identical to \refKey{/tcb/drop fuzzy shadow}. |
| 1962 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1963 |
\begin{tcolorbox}[drop fuzzy shadow southeast, |
| 1964 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1965 |
This is a tcolorbox. |
| 1966 |
\end{tcolorbox} |
| 1967 |
\end{dispExample*} |
| 1968 |
\end{docTcbKey}% |
| 1969 |
|
| 1970 |
\begin{docTcbKey}{drop fuzzy shadow south}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1971 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 1972 |
This shadow is identical to \refKey{/tcb/drop fuzzy midday shadow}. |
| 1973 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1974 |
\begin{tcolorbox}[drop fuzzy shadow south, |
| 1975 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1976 |
This is a tcolorbox. |
| 1977 |
\end{tcolorbox} |
| 1978 |
\end{dispExample*} |
| 1979 |
\end{docTcbKey}% |
| 1980 |
|
| 1981 |
\begin{docTcbKey}{drop fuzzy shadow southwest}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1982 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 1983 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1984 |
\begin{tcolorbox}[drop fuzzy shadow southwest, |
| 1985 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1986 |
This is a tcolorbox. |
| 1987 |
\end{tcolorbox} |
| 1988 |
\end{dispExample*} |
| 1989 |
\end{docTcbKey}% |
| 1990 |
|
| 1991 |
\begin{docTcbKey}{drop fuzzy shadow west}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 1992 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 1993 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 1994 |
\begin{tcolorbox}[drop fuzzy shadow west, |
| 1995 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 1996 |
This is a tcolorbox. |
| 1997 |
\end{tcolorbox} |
| 1998 |
\end{dispExample*} |
| 1999 |
\end{docTcbKey}% |
| 2000 |
|
| 2001 |
\clearpage |
| 2002 |
\begin{docTcbKey}{drop fuzzy shadow northwest}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 2003 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 2004 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2005 |
\begin{tcolorbox}[drop fuzzy shadow northwest, |
| 2006 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 2007 |
This is a tcolorbox. |
| 2008 |
\end{tcolorbox} |
| 2009 |
\end{dispExample*} |
| 2010 |
\end{docTcbKey}% |
| 2011 |
|
| 2012 |
\begin{docTcbKey}{drop fuzzy shadow north}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 2013 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 2014 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2015 |
\begin{tcolorbox}[drop fuzzy shadow north, |
| 2016 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 2017 |
This is a tcolorbox. |
| 2018 |
\end{tcolorbox} |
| 2019 |
\end{dispExample*} |
| 2020 |
\end{docTcbKey}% |
| 2021 |
|
| 2022 |
\begin{docTcbKey}{drop fuzzy shadow northeast}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 2023 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 2024 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2025 |
\begin{tcolorbox}[drop fuzzy shadow northeast, |
| 2026 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 2027 |
This is a tcolorbox. |
| 2028 |
\end{tcolorbox} |
| 2029 |
\end{dispExample*} |
| 2030 |
\end{docTcbKey}% |
| 2031 |
|
| 2032 |
\begin{docTcbKey}{drop fuzzy shadow east}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 2033 |
Adds a new fuzzy shadow with standard dimensions to the stack of shadows. |
| 2034 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2035 |
\begin{tcolorbox}[drop fuzzy shadow east, |
| 2036 |
enhanced,colback=red!5!white,colframe=red!75!black] |
| 2037 |
This is a tcolorbox. |
| 2038 |
\end{tcolorbox} |
| 2039 |
\end{dispExample*} |
| 2040 |
\end{docTcbKey}% |
| 2041 |
|
| 2042 |
|
| 2043 |
\clearpage |
| 2044 |
\subsubsection{Lifted Shadows} |
| 2045 |
|
| 2046 |
\begin{docTcbKey}{drop lifted shadow}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 2047 |
Adds a new lifted shadow with standard dimensions to the stack of shadows. |
| 2048 |
Optionally, the \meta{color} for the shadow can be changed. |
| 2049 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 2050 |
\tcbset{enhanced,colback=red!5!white, |
| 2051 |
boxrule=0.4pt,sharp corners, |
| 2052 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2053 |
|
| 2054 |
\begin{tcolorbox}[drop lifted shadow] |
| 2055 |
This is a tcolorbox. |
| 2056 |
\end{tcolorbox}\par\bigskip |
| 2057 |
\begin{tcolorbox}[title=Another shadow, |
| 2058 |
drop lifted shadow=blue] |
| 2059 |
This is a tcolorbox. |
| 2060 |
\end{tcolorbox} |
| 2061 |
\end{dispExample*} |
| 2062 |
\end{docTcbKey} |
| 2063 |
|
| 2064 |
|
| 2065 |
\begin{docTcbKey}{drop small lifted shadow}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 2066 |
Adds a new small lifted shadow with standard dimensions to the stack of shadows. |
| 2067 |
Optionally, the \meta{color} for the shadow can be changed. |
| 2068 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 2069 |
\tcbset{enhanced,colback=red!5!white, |
| 2070 |
boxrule=0.4pt,sharp corners, |
| 2071 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2072 |
|
| 2073 |
\tcbox[drop small lifted shadow,size=fbox] |
| 2074 |
{This is a tcolorbox.} |
| 2075 |
\par\bigskip |
| 2076 |
\begin{tcolorbox}[title=Another shadow, |
| 2077 |
drop small lifted shadow=black] |
| 2078 |
This is a tcolorbox. |
| 2079 |
\end{tcolorbox} |
| 2080 |
\end{dispExample*} |
| 2081 |
\end{docTcbKey} |
| 2082 |
|
| 2083 |
|
| 2084 |
\begin{docTcbKey}{drop large lifted shadow}{\colOpt{=\meta{color}}}{style, default |black!50!white|} |
| 2085 |
Adds a new large lifted shadow with standard dimensions to the stack of shadows. |
| 2086 |
Optionally, the \meta{color} for the shadow can be changed. |
| 2087 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 2088 |
\tcbset{enhanced,colback=red!5!white, |
| 2089 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2090 |
|
| 2091 |
\begin{tcolorbox}[drop large lifted shadow] |
| 2092 |
This is a tcolorbox. |
| 2093 |
\end{tcolorbox}\par\bigskip |
| 2094 |
\begin{tcolorbox}[title=Another shadow, |
| 2095 |
drop large lifted shadow=blue] |
| 2096 |
This is a tcolorbox. |
| 2097 |
\end{tcolorbox} |
| 2098 |
\end{dispExample*} |
| 2099 |
\end{docTcbKey} |
| 2100 |
|
| 2101 |
|
| 2102 |
\clearpage |
| 2103 |
|
| 2104 |
\subsubsection{Generic Shadows} |
| 2105 |
\begin{docTcbKey}{shadow}{=\marg{xshift}\marg{yshift}\marg{offset}\marg{options}}{no default} |
| 2106 |
Adds a new shadow to the stack of shadows. |
| 2107 |
This shadow follows the outline of the |tcolorbox| but is shifted by |
| 2108 |
\meta{xshift} and \meta{yshift}. The \meta{offset} value is a distance value |
| 2109 |
from the frame outline. A positive \meta{offset} value shrinks the shadow |
| 2110 |
and a negative \meta{offset} value enlarges the shadow. |
| 2111 |
The shadow is filled along a \tikzname\ path with the given \tikzname\ \meta{options}.\\ |
| 2112 |
The shadows adapt to the rounded corners of the |tcolorbox|. A shrunken shadow |
| 2113 |
will switch to sharp corners if necessary, an enlarged shadow may become |
| 2114 |
more rounded depending on several factors. But \refKey{/tcb/sharp corners} |
| 2115 |
have sharp shadows. |
| 2116 |
\begin{marker} |
| 2117 |
Shadows are not considered for the bounding box computation by default. |
| 2118 |
Large shadows may be overlapped by the following content. But, the |
| 2119 |
bounding box can be adapted if necessary. |
| 2120 |
\end{marker} |
| 2121 |
|
| 2122 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 2123 |
\tcbset{enhanced,colback=red!5!white, |
| 2124 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2125 |
|
| 2126 |
\begin{tcolorbox}[title=My own shadow, |
| 2127 |
shadow={2mm}{-1mm}{0mm}{black!50!white}] |
| 2128 |
This is a tcolorbox. |
| 2129 |
\end{tcolorbox} |
| 2130 |
\par\bigskip |
| 2131 |
\begin{tcolorbox}[title=Another shadow, |
| 2132 |
shadow={-1mm}{-2mm}{0mm}{fill=blue, |
| 2133 |
opacity=0.5}] |
| 2134 |
This is a tcolorbox. |
| 2135 |
\end{tcolorbox} |
| 2136 |
\par\bigskip |
| 2137 |
\begin{tcolorbox}[title=Double shadow, |
| 2138 |
shadow={-1.5mm}{-1.5mm}{0mm}{fill=blue, |
| 2139 |
opacity=0.25}, |
| 2140 |
shadow={1.5mm}{-1.5mm}{0mm}{fill=red, |
| 2141 |
opacity=0.25}] |
| 2142 |
This is a tcolorbox. |
| 2143 |
\end{tcolorbox} |
| 2144 |
\par\bigskip |
| 2145 |
\begin{tcolorbox}[title=Far shadow, |
| 2146 |
shadow={5.5mm}{-3.5mm}{2mm}{fill=black, |
| 2147 |
opacity=0.25}] |
| 2148 |
This is a tcolorbox. |
| 2149 |
\end{tcolorbox} |
| 2150 |
\par\bigskip\bigskip |
| 2151 |
\begin{tcolorbox}[title=Halo shadow, |
| 2152 |
shadow={0mm}{0mm}{-1.5mm}% |
| 2153 |
{fill=yellow!75!red,opacity=0.5}] |
| 2154 |
This is a tcolorbox. |
| 2155 |
\end{tcolorbox} |
| 2156 |
\end{dispExample*} |
| 2157 |
\end{docTcbKey} |
| 2158 |
|
| 2159 |
\clearpage |
| 2160 |
\begin{docTcbKey}{fuzzy shadow}{=\marg{xshift}\marg{yshift}\marg{offset}\marg{step}\marg{options}}{no default} |
| 2161 |
Adds a new fuzzy shadow to the stack of shadows. Actually, this option |
| 2162 |
adds several shadows which appear like a shadow with a fuzzy border. |
| 2163 |
This fuzzy shadow follows the outline of the |tcolorbox| but is shifted by |
| 2164 |
\meta{xshift} and \meta{yshift}. The \meta{offset} value is a distance value |
| 2165 |
from the frame outline. A positive \meta{offset} value shrinks the shadow |
| 2166 |
and a negative \meta{offset} value enlarges the shadow. |
| 2167 |
The \marg{step} value describes a shrink |
| 2168 |
offset used for the combination of the partial shadows. |
| 2169 |
The shadow is filled along a \tikzname\ path with the given \tikzname\ \meta{options} but |
| 2170 |
any |opacity| value will be ignored. |
| 2171 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 2172 |
\tcbset{enhanced,colback=red!5!white, |
| 2173 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2174 |
|
| 2175 |
\begin{tcolorbox}[title=My own shadow, |
| 2176 |
fuzzy shadow={2mm}{-1mm}{0mm}{0.1mm}% |
| 2177 |
{black!50!white}] |
| 2178 |
This is a tcolorbox. |
| 2179 |
\end{tcolorbox} |
| 2180 |
\par\bigskip |
| 2181 |
\begin{tcolorbox}[title=Another shadow, |
| 2182 |
fuzzy shadow={-1mm}{-2mm}{0mm}{0.2mm}% |
| 2183 |
{fill=blue}] |
| 2184 |
This is a tcolorbox. |
| 2185 |
\end{tcolorbox} |
| 2186 |
\par\bigskip |
| 2187 |
\begin{tcolorbox}[title=Double shadow, |
| 2188 |
fuzzy shadow={-1.5mm}{-1.5mm}{0mm}{0.1mm}% |
| 2189 |
{blue}, |
| 2190 |
fuzzy shadow={1.5mm}{-1.5mm}{0mm}{0.1mm}% |
| 2191 |
{red}] |
| 2192 |
This is a tcolorbox. |
| 2193 |
\end{tcolorbox} |
| 2194 |
\par\bigskip |
| 2195 |
\begin{tcolorbox}[title=Far shadow, |
| 2196 |
fuzzy shadow={5.5mm}{-3.5mm}{0mm}{0.3mm}% |
| 2197 |
{black}] |
| 2198 |
This is a tcolorbox. |
| 2199 |
\end{tcolorbox} |
| 2200 |
\par\bigskip\bigskip |
| 2201 |
\begin{tcolorbox}[title=Glow shadow, |
| 2202 |
fuzzy shadow={0mm}{0mm}{-1.5mm}{0.15mm}% |
| 2203 |
{yellow!75!red}] |
| 2204 |
This is a tcolorbox. |
| 2205 |
\end{tcolorbox} |
| 2206 |
\end{dispExample*} |
| 2207 |
|
| 2208 |
\begin{dispExample} |
| 2209 |
\newtcolorbox{mybox}[1][]{enhanced, |
| 2210 |
fuzzy shadow={1.0mm}{-1.0mm}{0.12mm}{0mm}{blue!50!white}, |
| 2211 |
fuzzy shadow={-1.0mm}{-1.0mm}{0.12mm}{0mm}{red!50!white}, |
| 2212 |
fuzzy shadow={-1.0mm}{1.0mm}{0.12mm}{0mm}{green!50!white}, |
| 2213 |
fuzzy shadow={1.0mm}{1.0mm}{0.12mm}{0mm}{yellow!50!white},#1 |
| 2214 |
} |
| 2215 |
|
| 2216 |
\begin{mybox}[title=A multi shadow box] |
| 2217 |
This is a tcolorbox. |
| 2218 |
\end{mybox} |
| 2219 |
\end{dispExample} |
| 2220 |
\end{docTcbKey} |
| 2221 |
|
| 2222 |
|
| 2223 |
\clearpage |
| 2224 |
\begin{docTcbKey}[][doc new=2015-05-05]{smart shadow arc}{\colOpt{=true\textbar false}}{default |true|, |
| 2225 |
initially |true|} |
| 2226 |
If set to |true|, the shadow drawing algorithm tries to do a somewhat |
| 2227 |
smart calculation of the arc for the shadow. The result is pleasing for typical boxes |
| 2228 |
with rounded corners, but gives strange results for circular boxes. |
| 2229 |
|
| 2230 |
\begin{dispExample} |
| 2231 |
\tcbset{enhanced,nobeforeafter,colback=red!5!white, |
| 2232 |
colframe=red!75!black,width=3cm,square,halign=center,valign=center |
| 2233 |
} |
| 2234 |
|
| 2235 |
\begin{tcolorbox}[drop shadow] |
| 2236 |
Smart shadow arc (arguably better than normal) |
| 2237 |
\end{tcolorbox} |
| 2238 |
\hfill |
| 2239 |
\begin{tcolorbox}[smart shadow arc=false, drop shadow] |
| 2240 |
Normal shadow arc |
| 2241 |
\end{tcolorbox} |
| 2242 |
\hfill |
| 2243 |
\begin{tcolorbox}[circular arc, drop shadow] |
| 2244 |
Smart shadow arc (worse than normal) |
| 2245 |
\end{tcolorbox} |
| 2246 |
\hfill |
| 2247 |
\begin{tcolorbox}[circular arc, smart shadow arc=false, drop shadow] |
| 2248 |
Normal shadow arc |
| 2249 |
\end{tcolorbox} |
| 2250 |
\end{dispExample} |
| 2251 |
\end{docTcbKey} |
| 2252 |
|
| 2253 |
|
| 2254 |
\begin{docTcbKey}{lifted shadow}{=\marg{xshift}\marg{yshift}\marg{bend}\marg{step}\marg{options}}{no default} |
| 2255 |
Adds a new lifted shadow to the stack of shadows. Actually, this option |
| 2256 |
adds several shadows which appear like a shadow with a fuzzy border. |
| 2257 |
This lifted shadow follows the outline of the |tcolorbox| but is shifted by |
| 2258 |
\meta{xshift} and \meta{yshift} on the lower left corner and by |
| 2259 |
$-$\meta{xshift} and \meta{yshift} on the lower right corner. |
| 2260 |
Additionally, there is a \meta{bend} in the middle. |
| 2261 |
The \marg{step} value describes a shrink |
| 2262 |
offset used for the combination of the partial shadows. |
| 2263 |
The shadow is filled along a \tikzname\ path with the given \tikzname\ \meta{options} but |
| 2264 |
any |opacity| value will be ignored. |
| 2265 |
\begin{dispExample*}{sbs,lefthand ratio=0.6} |
| 2266 |
\tcbset{enhanced,colback=red!5!white, |
| 2267 |
boxrule=0.1pt, |
| 2268 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2269 |
|
| 2270 |
\begin{tcolorbox}[title=My own shadow, |
| 2271 |
lifted shadow={1mm}{-2mm}{3mm}{0.1mm}% |
| 2272 |
{black!50!white}] |
| 2273 |
This is a tcolorbox. |
| 2274 |
\end{tcolorbox} |
| 2275 |
\end{dispExample*} |
| 2276 |
\end{docTcbKey} |
| 2277 |
|
| 2278 |
\clearpage |
| 2279 |
\subsubsection{\tikzname\ Shadows} |
| 2280 |
Alternative to the package shadow options described before, shadows from |
| 2281 |
the \flqq Shadows Library\frqq\ of \tikzname\ can be used. |
| 2282 |
Such shadows can be added directly to the frame path using \refKey{/tcb/frame style}. |
| 2283 |
|
| 2284 |
\begin{exdispExample*}{tikz_shadow_1}{sbs,lefthand ratio=0.7} |
| 2285 |
% \usetikzlibrary{shadows} |
| 2286 |
\begin{tcolorbox}[enhanced, |
| 2287 |
colback=red!5!white,colframe=red!75!black, |
| 2288 |
frame style={drop shadow} ] |
| 2289 |
This is a tcolorbox. |
| 2290 |
\end{tcolorbox} |
| 2291 |
\end{exdispExample*} |
| 2292 |
|
| 2293 |
\begin{exdispExample*}{tikz_shadow_2}{sbs,lefthand ratio=0.7} |
| 2294 |
% \usetikzlibrary{shadows} |
| 2295 |
\begin{tcolorbox}[enhanced,height=3cm, |
| 2296 |
colback=red!5!white,colframe=red!75!black, |
| 2297 |
halign=center,valign=center, |
| 2298 |
frame style={circular drop shadow} ] |
| 2299 |
This is a tcolorbox. |
| 2300 |
\end{tcolorbox} |
| 2301 |
\end{exdispExample*} |
| 2302 |
|
| 2303 |
\begin{exdispExample*}{tikz_shadow_3}{sbs,lefthand ratio=0.7} |
| 2304 |
% \usetikzlibrary{shadows} |
| 2305 |
\begin{tcolorbox}[enhanced,width=2.5cm, |
| 2306 |
square,circular arc, |
| 2307 |
halign=center,valign=center, |
| 2308 |
colback=red!5!white,colframe=red!75!black, |
| 2309 |
frame style={circular glow={fill=red}} ] |
| 2310 |
tcolorbox |
| 2311 |
\end{tcolorbox} |
| 2312 |
\end{exdispExample*} |
| 2313 |
|
| 2314 |
|
| 2315 |
\clearpage |
| 2316 |
\subsection{\tikzname\ Picture Option Keys}\label{subsec:tikzpicture} |
| 2317 |
|
| 2318 |
\begin{docTcbKey}{tikz}{=\meta{tikz option list}}{no default, initially empty} |
| 2319 |
Adds the given \meta{tikz option list} to the main |tikzpicture| environment |
| 2320 |
used to draw the color box, see \cite{tantau:tikz_and_pgf}. If this option is |
| 2321 |
applied a second time, the new \meta{tikz option list} is appended to the |
| 2322 |
current option list. |
| 2323 |
Note that, if \tikzname\ coordinate transformation options are used, |
| 2324 |
|transform shape| may also be needed to transform all box elements. |
| 2325 |
\begin{dispExample*}{sbs,lefthand ratio=0.66, |
| 2326 |
segmentation style={preaction={fill=white},pattern=checkerboard,pattern color=gray!40}} |
| 2327 |
\tcbset{enhanced,colback=red!5!white, |
| 2328 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2329 |
|
| 2330 |
\begin{tcolorbox}[title=Transparent box, |
| 2331 |
tikz={opacity=0.5,transparency group}] |
| 2332 |
This is a tcolorbox. |
| 2333 |
\end{tcolorbox} |
| 2334 |
\end{dispExample*} |
| 2335 |
|
| 2336 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 2337 |
\tcbset{enhanced,colback=red!5!white, |
| 2338 |
colframe=red!75!black,fonttitle=\bfseries, |
| 2339 |
fontupper=\bfseries\Huge, |
| 2340 |
halign title=center,halign=center} |
| 2341 |
|
| 2342 |
\begin{tcolorbox}[title=Rotated box, |
| 2343 |
tikz={rotate=30}] |
| 2344 |
Sold! |
| 2345 |
\end{tcolorbox} |
| 2346 |
\end{dispExample*} |
| 2347 |
|
| 2348 |
\end{docTcbKey} |
| 2349 |
|
| 2350 |
|
| 2351 |
\begin{docTcbKey}{tikz reset}{}{initially set} |
| 2352 |
Removes all options given by \refKey{/tcb/tikz}. |
| 2353 |
\end{docTcbKey} |
| 2354 |
|
| 2355 |
|
| 2356 |
\begin{docTcbKey}{at begin tikz}{=\meta{tikz code}}{no default, initially empty} |
| 2357 |
The given \meta{tikz code} is executed at the beginning of the |tikzpicture| environment |
| 2358 |
after the \tikzname\ option |execute at begin picture| was applied. |
| 2359 |
If this option is applied a second time, the new \meta{tikz code} is appended to the current code. |
| 2360 |
\end{docTcbKey} |
| 2361 |
|
| 2362 |
|
| 2363 |
\begin{docTcbKey}{at begin tikz reset}{}{initially set} |
| 2364 |
Removes all code given by \refKey{/tcb/at begin tikz}. |
| 2365 |
\end{docTcbKey} |
| 2366 |
|
| 2367 |
|
| 2368 |
\begin{docTcbKey}{at end tikz}{=\meta{tikz code}}{no default, initially empty} |
| 2369 |
The given \meta{tikz code} is executed at the ending of the |tikzpicture| environment |
| 2370 |
before the \tikzname\ option |execute at end picture| was applied. |
| 2371 |
If this option is applied a second time, the new \meta{tikz code} is appended to the current code. |
| 2372 |
\end{docTcbKey} |
| 2373 |
|
| 2374 |
|
| 2375 |
\begin{docTcbKey}{at end tikz reset}{}{initially set} |
| 2376 |
Removes all code given by \refKey{/tcb/at end tikz}. |
| 2377 |
\end{docTcbKey} |
| 2378 |
|
| 2379 |
|
| 2380 |
\clearpage |
| 2381 |
\begin{docTcbKey}{rotate}{=\meta{angle}}{no default, initially unset} |
| 2382 |
Rotates the |tcolorbox| by the given \meta{angle}. |
| 2383 |
This also applys |transform shape|. |
| 2384 |
Note that this is a \tikzname\ coordinate transformation i.\,e., not all graphical elements like shadings |
| 2385 |
will really be rotated. |
| 2386 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 2387 |
\tcbset{enhanced,colback=red!5!white, |
| 2388 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2389 |
|
| 2390 |
\begin{tcolorbox}[title=Rotated box,rotate=30] |
| 2391 |
This is a tcolorbox. |
| 2392 |
\end{tcolorbox} |
| 2393 |
\end{dispExample*} |
| 2394 |
\end{docTcbKey} |
| 2395 |
|
| 2396 |
\begin{docTcbKey}{scale}{=\meta{fraction}}{no default, initially unset} |
| 2397 |
Scales the |tcolorbox| by the given \meta{fraction}. |
| 2398 |
This also applys |transform shape|. |
| 2399 |
Note that this is a \tikzname\ coordinate transformation i.\,e., not all graphical elements like line widths |
| 2400 |
will really be scaled. |
| 2401 |
\begin{dispExample*}{sbs,lefthand ratio=0.66} |
| 2402 |
\tcbset{enhanced,colback=red!5!white, |
| 2403 |
colframe=red!75!black,fonttitle=\bfseries} |
| 2404 |
|
| 2405 |
\begin{tcolorbox}[title=Scaled box,scale=0.5] |
| 2406 |
This is a tcolorbox. |
| 2407 |
\end{tcolorbox} |
| 2408 |
\begin{tcolorbox}[title=Scaled box,scale=1.25] |
| 2409 |
This is a tcolorbox. |
| 2410 |
\end{tcolorbox} |
| 2411 |
\end{dispExample*} |
| 2412 |
\end{docTcbKey} |
| 2413 |
|
| 2414 |
|
| 2415 |
\begin{docTcbKey}{remember}{}{style, initially unset} |
| 2416 |
Shortcut for |tikz={remember picture}|. This allows one to reference nodes |
| 2417 |
in other \tikzname\ pictures. |
| 2418 |
\begin{dispExample} |
| 2419 |
\begin{tcolorbox}[enhanced,remember,colback=red!5!white,colframe=red!75!black, |
| 2420 |
fonttitle=\bfseries,title=The four corners of a paper, |
| 2421 |
overlay={\draw[red!50!white,line width=1mm,opacity=0.5,shorten >=3mm] |
| 2422 |
(frame.north west) edge[->] (current page.north west) |
| 2423 |
(frame.north east) edge[->] (current page.north east) |
| 2424 |
(frame.south west) edge[->] (current page.south west) |
| 2425 |
(frame.south east) edge[->] (current page.south east);}] |
| 2426 |
This is a tcolorbox. |
| 2427 |
\end{tcolorbox} |
| 2428 |
\end{dispExample} |
| 2429 |
\end{docTcbKey} |
| 2430 |
|
| 2431 |
\clearpage |
| 2432 |
\tcbinterruptdraftmode% |
| 2433 |
\begin{docTcbKey}{remember as}{=\meta{name}}{style, no default, initially unset} |
| 2434 |
The |frame| node will be remembered by the given \meta{name} to be referenced |
| 2435 |
in other \tikzname\ pictures. |
| 2436 |
\begin{dispExample} |
| 2437 |
% \usepackage{lipsum} |
| 2438 |
\newtcolorbox{mybox}[1][]{enhanced,colframe=blue!75!black,colback=blue!10!white, |
| 2439 |
fonttitle=\bfseries,#1} |
| 2440 |
|
| 2441 |
\begin{mybox}[title=First Box,nobeforeafter,width=\linewidth/4,remember as=one] |
| 2442 |
This is a test. |
| 2443 |
\end{mybox} |
| 2444 |
\hfill |
| 2445 |
\begin{mybox}[title=Second Box,nobeforeafter,width=\linewidth/4,remember as=two] |
| 2446 |
This is a test. |
| 2447 |
\end{mybox} |
| 2448 |
\hfill |
| 2449 |
\begin{mybox}[title=Third Box,nobeforeafter,width=\linewidth/4,remember as=three] |
| 2450 |
This is a test. |
| 2451 |
\end{mybox} |
| 2452 |
|
| 2453 |
\lipsum[2] |
| 2454 |
|
| 2455 |
\begin{mybox}[title=Fourth Box,remember as=four] |
| 2456 |
This is a test. |
| 2457 |
\end{mybox} |
| 2458 |
|
| 2459 |
\begin{tikzpicture}[overlay,remember picture,line width=1mm,draw=red!75!black] |
| 2460 |
\draw[->] (one.east) to[bend right] node[above] {A} (two.west); |
| 2461 |
\draw[->] (two.east) to[bend left] node[above] {B} (three.west); |
| 2462 |
\draw[->] (three.east) to[bend left=90] node[right] {C} (four.east); |
| 2463 |
\draw[->] (four.west) to[bend left=90] node[left] {D} (one.west); |
| 2464 |
\end{tikzpicture} |
| 2465 |
\end{dispExample} |
| 2466 |
\end{docTcbKey} |
| 2467 |
\tcbcontinuedraftmode% |
| 2468 |
|
| 2469 |
|
| 2470 |
\clearpage |
| 2471 |
\subsection{Underlay Option Keys}\label{subsec:skinunderlay} |
| 2472 |
|
| 2473 |
Underlays are quite similar to overlays described in \zvref{subsec:overlays}. |
| 2474 |
Underlays are drawn \emph{after} the frame and interior are |
| 2475 |
drawn and \emph{before} overlays and the text content is drawn; see |
| 2476 |
\zvref{subsec:tcolorboxdrawing} for the general drawing scheme. |
| 2477 |
|
| 2478 |
The differences between underlays and overlays are: |
| 2479 |
\begin{itemize} |
| 2480 |
\item Underlays are not applicable for the skins |
| 2481 |
\refSkin{standard} and |
| 2482 |
\refSkin{standard jigsaw}, |
| 2483 |
whereas overlays are applicable also for these skins. |
| 2484 |
The skin \refSkin{spartan} supports underlays but no overlays. |
| 2485 |
\begin{marker} |
| 2486 |
If an underlay is used with the \refSkin{standard} skin, it is silently ignored. |
| 2487 |
\end{marker} |
| 2488 |
\item Underlays are stackable, i.\,e., several different underlays can be |
| 2489 |
used on the same |tcolorbox|. Overlays are not stackable by default (but with |
| 2490 |
some help of the library \mylib{hooks}). |
| 2491 |
\item Boxed titles are implemented with underlays (\zvref{subsec:skinboxedtitle}), |
| 2492 |
watermarks are implemented with overlays (\zvref{subsec:watermarks}). |
| 2493 |
\end{itemize} |
| 2494 |
|
| 2495 |
|
| 2496 |
\begin{docTcbKey}{underlay}{=\meta{graphical code}}{no default, initially unset} |
| 2497 |
Adds \meta{graphical code} to the box drawing process. This \meta{graphical code} |
| 2498 |
is drawn \emph{after} the frame and interior and \emph{before} the text content. |
| 2499 |
\begin{dispExample} |
| 2500 |
\newtcolorbox{mybox}[1][]{enhanced,colback=red!5!white, |
| 2501 |
colbacktitle=red!85!black!50!white, |
| 2502 |
colframe=red!75!black,fonttitle=\bfseries,watermark color=yellow!50!white, |
| 2503 |
underlay={\begin{tcbclipinterior} |
| 2504 |
\draw[red!40!white,line width=1cm] (interior.south west)--(interior.north east); |
| 2505 |
\end{tcbclipinterior}}, |
| 2506 |
attach boxed title to top center={yshift=-2mm},#1} |
| 2507 |
|
| 2508 |
\begin{mybox}[title=My box,watermark text=My Watermark] |
| 2509 |
\lipsum[2] |
| 2510 |
\end{mybox} |
| 2511 |
\end{dispExample} |
| 2512 |
\end{docTcbKey} |
| 2513 |
|
| 2514 |
|
| 2515 |
\begin{docTcbKey}{no underlay}{}{style, no default, initially set} |
| 2516 |
Removes the underlay if set before. |
| 2517 |
\end{docTcbKey} |
| 2518 |
|
| 2519 |
\clearpage |
| 2520 |
\begin{docTcbKey}{underlay broken}{=\meta{graphical code}}{no default, initially unset} |
| 2521 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2522 |
then the \meta{graphical code} is added to the box drawing process. |
| 2523 |
\refKey{/tcb/underlay} overwrites this key. |
| 2524 |
\end{docTcbKey} |
| 2525 |
|
| 2526 |
\enlargethispage*{1cm} |
| 2527 |
|
| 2528 |
\begin{docTcbKey}{underlay unbroken}{=\meta{graphical code}}{no default, initially unset} |
| 2529 |
If the box is set to be \refKey{/tcb/breakable} but \emph{is not} broken actually |
| 2530 |
or if the box is set to be \refKey{/tcb/unbreakable}, |
| 2531 |
then the \meta{graphical code} is added to the box drawing process. |
| 2532 |
\refKey{/tcb/underlay} overwrites this key. |
| 2533 |
\end{docTcbKey} |
| 2534 |
|
| 2535 |
\begin{docTcbKey}{no underlay unbroken}{}{style, no default, initially set} |
| 2536 |
Removes the unbroken underlay if set before. |
| 2537 |
\end{docTcbKey} |
| 2538 |
|
| 2539 |
\begin{docTcbKey}{underlay first}{=\meta{graphical code}}{no default, initially unset} |
| 2540 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2541 |
then the \meta{graphical code} is added to the box drawing process for |
| 2542 |
the \emph{first} part of the break sequence. |
| 2543 |
\refKey{/tcb/underlay} overwrites this key. |
| 2544 |
\end{docTcbKey} |
| 2545 |
|
| 2546 |
\begin{docTcbKey}{no underlay first}{}{style, no default, initially set} |
| 2547 |
Removes the first underlay if set before. |
| 2548 |
\end{docTcbKey} |
| 2549 |
|
| 2550 |
\begin{docTcbKey}{underlay middle}{=\meta{graphical code}}{no default, initially unset} |
| 2551 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2552 |
then the \meta{graphical code} is added to the box drawing process for |
| 2553 |
the \emph{middle} parts (if any) of the break sequence. |
| 2554 |
\refKey{/tcb/underlay} overwrites this key. |
| 2555 |
\end{docTcbKey} |
| 2556 |
|
| 2557 |
\begin{docTcbKey}{no underlay middle}{}{style, no default, initially set} |
| 2558 |
Removes the middle underlay if set before. |
| 2559 |
\end{docTcbKey} |
| 2560 |
|
| 2561 |
\begin{docTcbKey}{underlay last}{=\meta{graphical code}}{no default, initially unset} |
| 2562 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2563 |
then the \meta{graphical code} is added to the box drawing process for |
| 2564 |
the \emph{last} part of the break sequence. |
| 2565 |
\refKey{/tcb/underlay} overwrites this key. |
| 2566 |
\end{docTcbKey} |
| 2567 |
|
| 2568 |
\begin{docTcbKey}{no underlay last}{}{style, no default, initially set} |
| 2569 |
Removes the last underlay if set before. |
| 2570 |
\end{docTcbKey} |
| 2571 |
|
| 2572 |
\begin{docTcbKey}{underlay boxed title}{=\meta{graphical code}}{no default, initially unset} |
| 2573 |
If the box has a \emph{boxed title}, see \zvref{subsec:skinboxedtitle}, |
| 2574 |
then the \meta{graphical code} is added to the box drawing process |
| 2575 |
\emph{before} the boxed title is drawn. |
| 2576 |
\end{docTcbKey} |
| 2577 |
|
| 2578 |
\begin{docTcbKey}{no underlay boxed title}{}{style, no default, initially set} |
| 2579 |
Removes the boxed title underlay if set before. |
| 2580 |
\end{docTcbKey} |
| 2581 |
|
| 2582 |
\begin{docTcbKey}{underlay unbroken and first}{=\meta{graphical code}}{no default, initially unset} |
| 2583 |
This is an abbreviation for setting |
| 2584 |
\refKey{/tcb/underlay unbroken} and |
| 2585 |
\refKey{/tcb/underlay first} together. |
| 2586 |
\refKey{/tcb/underlay} overwrites this key. |
| 2587 |
\end{docTcbKey} |
| 2588 |
|
| 2589 |
\begin{docTcbKey}{underlay middle and last}{=\meta{graphical code}}{no default, initially unset} |
| 2590 |
This is an abbreviation for setting |
| 2591 |
\refKey{/tcb/underlay middle} and |
| 2592 |
\refKey{/tcb/underlay last} together. |
| 2593 |
\refKey{/tcb/underlay} overwrites this key. |
| 2594 |
\end{docTcbKey} |
| 2595 |
|
| 2596 |
\begin{docTcbKey}{underlay unbroken and last}{=\meta{graphical code}}{no default, initially unset} |
| 2597 |
This is an abbreviation for setting |
| 2598 |
\refKey{/tcb/underlay unbroken} and |
| 2599 |
\refKey{/tcb/underlay last} together. |
| 2600 |
\refKey{/tcb/underlay} overwrites this key. |
| 2601 |
\end{docTcbKey} |
| 2602 |
|
| 2603 |
\begin{docTcbKey}[][doc new=2014-09-19]{underlay first and middle}{=\meta{graphical code}}{no default, initially unset} |
| 2604 |
This is an abbreviation for setting |
| 2605 |
\refKey{/tcb/underlay first} and |
| 2606 |
\refKey{/tcb/underlay middle} together. |
| 2607 |
\refKey{/tcb/underlay} overwrites this key. |
| 2608 |
\end{docTcbKey} |
| 2609 |
|
| 2610 |
|
| 2611 |
\clearpage |
| 2612 |
\subsection{Finish Option Keys}\label{subsec:skinfinish} |
| 2613 |
|
| 2614 |
Finishes are quite similar to underlays described in \zvref{subsec:skinunderlay} |
| 2615 |
and overlays described in \zvref{subsec:overlays}. |
| 2616 |
Finishes are drawn \emph{after} the text content is drawn; see |
| 2617 |
\zvref{subsec:tcolorboxdrawing} for the general drawing scheme. |
| 2618 |
Therefore, a finish will reduce the readability of the text content. |
| 2619 |
|
| 2620 |
Finishes are intended for special effects like highlights or glosses or text over text. |
| 2621 |
|
| 2622 |
\begin{itemize} |
| 2623 |
\item Finishes are only applicable for the skins |
| 2624 |
\refSkin{enhanced}, |
| 2625 |
\refSkin{empty}, |
| 2626 |
\refSkin{freelance}, |
| 2627 |
\refSkin{bicolor}, |
| 2628 |
\refSkin{beamer}, and |
| 2629 |
\refSkin{widget}. |
| 2630 |
\begin{marker} |
| 2631 |
If a finish is used with the \refSkin{standard} skin, it is silently ignored. |
| 2632 |
\end{marker} |
| 2633 |
\item Finishes are stackable, i.\,e., several different finishes can be |
| 2634 |
used on the same |tcolorbox|. |
| 2635 |
\end{itemize} |
| 2636 |
|
| 2637 |
\enlargethispage*{2cm} |
| 2638 |
\begin{docTcbKey}{finish}{=\meta{graphical code}}{no default, initially unset} |
| 2639 |
Adds \meta{graphical code} to the box drawing process. This \meta{graphical code} |
| 2640 |
is drawn \emph{after} the text content. |
| 2641 |
\begin{dispExample} |
| 2642 |
\newtcolorbox{mybox}[1][]{enhanced,colback=red!5!white, |
| 2643 |
colbacktitle=red!85!black!50!white,colframe=red!75!black,fonttitle=\bfseries, |
| 2644 |
finish={\begin{tcbclipframe} |
| 2645 |
\path[bottom color=black,top color=black!50!white,opacity=0.1] |
| 2646 |
(frame.south west) -- (frame.south east) -- (frame.north east) -- cycle; |
| 2647 |
\path[top color=white,bottom color=black!50!white,opacity=0.1] |
| 2648 |
(frame.south west) -- (frame.north east) -- (frame.north west) -- cycle; |
| 2649 |
\end{tcbclipframe}},#1} |
| 2650 |
|
| 2651 |
\begin{mybox}[title=My box] |
| 2652 |
\lipsum[2] |
| 2653 |
\end{mybox} |
| 2654 |
\end{dispExample} |
| 2655 |
\begin{dispExample} |
| 2656 |
\newtcolorbox{mybox}[1][]{enhanced,colback=red!5!white, |
| 2657 |
colbacktitle=red!85!black!50!white,colframe=red!75!black,fonttitle=\bfseries, |
| 2658 |
finish={\node[draw,fill=white,fill opacity=0.85,inner sep=5mm, |
| 2659 |
rounded corners] at (frame.center) {\Huge\bfseries Finish!};},#1} |
| 2660 |
|
| 2661 |
\begin{mybox}[title=My box] |
| 2662 |
\lipsum[2] |
| 2663 |
\end{mybox} |
| 2664 |
\end{dispExample} |
| 2665 |
\end{docTcbKey} |
| 2666 |
|
| 2667 |
\clearpage |
| 2668 |
\begin{docTcbKey}{no finish}{}{style, no default, initially set} |
| 2669 |
Removes the finish if set before. |
| 2670 |
\end{docTcbKey} |
| 2671 |
|
| 2672 |
|
| 2673 |
\begin{docTcbKey}{finish broken}{=\meta{graphical code}}{no default, initially unset} |
| 2674 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2675 |
then the \meta{graphical code} is added to the box drawing process. |
| 2676 |
\refKey{/tcb/finish} overwrites this key. |
| 2677 |
\end{docTcbKey} |
| 2678 |
|
| 2679 |
\begin{docTcbKey}{finish unbroken}{=\meta{graphical code}}{no default, initially unset} |
| 2680 |
If the box is set to be \refKey{/tcb/breakable} but \emph{is not} broken actually |
| 2681 |
or if the box is set to be \refKey{/tcb/unbreakable}, |
| 2682 |
then the \meta{graphical code} is added to the box drawing process. |
| 2683 |
\refKey{/tcb/finish} overwrites this key. |
| 2684 |
\end{docTcbKey} |
| 2685 |
|
| 2686 |
\begin{docTcbKey}{no finish unbroken}{}{style, no default, initially set} |
| 2687 |
Removes the unbroken finish if set before. |
| 2688 |
\end{docTcbKey} |
| 2689 |
|
| 2690 |
\begin{docTcbKey}{finish first}{=\meta{graphical code}}{no default, initially unset} |
| 2691 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2692 |
then the \meta{graphical code} is added to the box drawing process for |
| 2693 |
the \emph{first} part of the break sequence. |
| 2694 |
\refKey{/tcb/finish} overwrites this key. |
| 2695 |
\end{docTcbKey} |
| 2696 |
|
| 2697 |
\begin{docTcbKey}{no finish first}{}{style, no default, initially set} |
| 2698 |
Removes the first finish if set before. |
| 2699 |
\end{docTcbKey} |
| 2700 |
|
| 2701 |
\begin{docTcbKey}{finish middle}{=\meta{graphical code}}{no default, initially unset} |
| 2702 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2703 |
then the \meta{graphical code} is added to the box drawing process for |
| 2704 |
the \emph{middle} parts (if any) of the break sequence. |
| 2705 |
\refKey{/tcb/finish} overwrites this key. |
| 2706 |
\end{docTcbKey} |
| 2707 |
|
| 2708 |
\begin{docTcbKey}{no finish middle}{}{style, no default, initially set} |
| 2709 |
Removes the middle finish if set before. |
| 2710 |
\end{docTcbKey} |
| 2711 |
|
| 2712 |
\begin{docTcbKey}{finish last}{=\meta{graphical code}}{no default, initially unset} |
| 2713 |
If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, |
| 2714 |
then the \meta{graphical code} is added to the box drawing process for |
| 2715 |
the \emph{last} part of the break sequence. |
| 2716 |
\refKey{/tcb/finish} overwrites this key. |
| 2717 |
\end{docTcbKey} |
| 2718 |
|
| 2719 |
\begin{docTcbKey}{no finish last}{}{style, no default, initially set} |
| 2720 |
Removes the last finish if set before. |
| 2721 |
\end{docTcbKey} |
| 2722 |
|
| 2723 |
\begin{docTcbKey}{finish unbroken and first}{=\meta{graphical code}}{no default, initially unset} |
| 2724 |
This is an abbreviation for setting |
| 2725 |
\refKey{/tcb/finish unbroken} and |
| 2726 |
\refKey{/tcb/finish first} together. |
| 2727 |
\refKey{/tcb/finish} overwrites this key. |
| 2728 |
\end{docTcbKey} |
| 2729 |
|
| 2730 |
\begin{docTcbKey}{finish middle and last}{=\meta{graphical code}}{no default, initially unset} |
| 2731 |
This is an abbreviation for setting |
| 2732 |
\refKey{/tcb/finish middle} and |
| 2733 |
\refKey{/tcb/finish last} together. |
| 2734 |
\refKey{/tcb/finish} overwrites this key. |
| 2735 |
\end{docTcbKey} |
| 2736 |
|
| 2737 |
\begin{docTcbKey}{finish unbroken and last}{=\meta{graphical code}}{no default, initially unset} |
| 2738 |
This is an abbreviation for setting |
| 2739 |
\refKey{/tcb/finish unbroken} and |
| 2740 |
\refKey{/tcb/finish last} together. |
| 2741 |
\refKey{/tcb/finish} overwrites this key. |
| 2742 |
\end{docTcbKey} |
| 2743 |
|
| 2744 |
|
| 2745 |
\begin{docTcbKey}[][doc new=2014-09-19]{finish first and middle}{=\meta{graphical code}}{no default, initially unset} |
| 2746 |
This is an abbreviation for setting |
| 2747 |
\refKey{/tcb/finish first} and |
| 2748 |
\refKey{/tcb/finish middle} together. |
| 2749 |
\refKey{/tcb/finish} overwrites this key. |
| 2750 |
\end{docTcbKey} |
| 2751 |
|
| 2752 |
\clearpage |
| 2753 |
\subsection{Hyper Option Keys}\label{subsec:hyper} |
| 2754 |
All options of this section need the package \refPkg{hyperref} \cite{rahtz:hyperref} |
| 2755 |
to be loaded separately. All these options are implemented as |
| 2756 |
\refKey{/tcb/finish} and can be disabled by \refKey{/tcb/no finish}. |
| 2757 |
|
| 2758 |
\begin{marker} |
| 2759 |
If the package \refPkg{hyperref} \cite{rahtz:hyperref} is not loaded or if |
| 2760 |
the \refSkin{standard} skin is used, all hyper option are silently ignored. |
| 2761 |
\end{marker} |
| 2762 |
|
| 2763 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperref}{=\meta{marker}}{no default, initially unset} |
| 2764 |
The whole \textit{frame} of a |tcolorbox| is made an active hyperlink for a |
| 2765 |
\meta{marker} which was given by |\label| or \refKey{/tcb/label} or \refKey{/tcb/phantomlabel}. |
| 2766 |
Such, the |tcolorbox| is made a clickable button (depending on the previewer). |
| 2767 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2768 |
% \section{Library skins}\label{sec:skins}% |
| 2769 |
\begin{tcolorbox}[beamer,colback=red!50, |
| 2770 |
hyperref=sec:skins] |
| 2771 |
Jump to the heading of Section~\ref*{sec:skins}. |
| 2772 |
\end{tcolorbox} |
| 2773 |
\end{dispExample*} |
| 2774 |
\end{docTcbKey} |
| 2775 |
|
| 2776 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperref interior}{=\meta{marker}}{no default, initially unset} |
| 2777 |
Identical to \refKey{/tcb/hyperref}, but only the \textit{interior} of a |
| 2778 |
|tcolorbox| is made a hyperlink (without frame and title). |
| 2779 |
\end{docTcbKey} |
| 2780 |
|
| 2781 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperref title}{=\meta{marker}}{no default, initially unset} |
| 2782 |
Identical to \refKey{/tcb/hyperref}, but only the \textit{title} of a |
| 2783 |
|tcolorbox| is made a hyperlink. |
| 2784 |
\end{docTcbKey} |
| 2785 |
|
| 2786 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperref node}{=\marg{marker}\marg{node}}{no default, initially unset} |
| 2787 |
Identical to \refKey{/tcb/hyperref}, but only the given \tikzname\ \meta{node} |
| 2788 |
is made a hyperlink. This \meta{node} may be |frame|, |interior|, |title|, or |
| 2789 |
any other named node used for drawing the |tcolorbox|. |
| 2790 |
The \meta{node} may be defined inside |
| 2791 |
\refKey{/tcb/underlay}, \refKey{/tcb/overlay} or \refKey{/tcb/finish}. |
| 2792 |
If the later is used, define the node \emph{before} \refKey{/tcb/hyperref node} |
| 2793 |
is applied. |
| 2794 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2795 |
% \section{Library skins}\label{sec:skins}% |
| 2796 |
\begin{tcolorbox}[enhanced,colback=yellow!10, |
| 2797 |
underlay={\node[red,fill=red!30,inner sep=3mm] |
| 2798 |
(click) at (frame.center) {X};}, |
| 2799 |
hyperref node={sec:skins}{click}] |
| 2800 |
Jump to the heading of Section~\ref*{sec:skins} |
| 2801 |
(X marks the click point). |
| 2802 |
\end{tcolorbox} |
| 2803 |
\end{dispExample*} |
| 2804 |
\end{docTcbKey} |
| 2805 |
|
| 2806 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperlink}{=\meta{marker}}{no default, initially unset} |
| 2807 |
The whole \textit{frame} of a |tcolorbox| is made an active hyperlink for a |
| 2808 |
\meta{marker} which was given by |\hypertarget| or \refKey{/tcb/hypertarget}. |
| 2809 |
Such, the |tcolorbox| is made a clickable button (depending on the previewer). |
| 2810 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2811 |
% \usepackage{hyperref}% |
| 2812 |
\begin{tcolorbox}[enhanced, |
| 2813 |
colback=blue!10,colframe=blue!50!black, |
| 2814 |
hypertarget=hypertwinB, |
| 2815 |
hyperlink=hypertwinA, |
| 2816 |
title=Box B] |
| 2817 |
Click me to jump to Box A. |
| 2818 |
\end{tcolorbox} |
| 2819 |
\end{dispExample*} |
| 2820 |
\end{docTcbKey} |
| 2821 |
|
| 2822 |
\clearpage |
| 2823 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperlink interior}{=\meta{marker}}{no default, initially unset} |
| 2824 |
Identical to \refKey{/tcb/hyperlink}, but only the \textit{interior} of a |
| 2825 |
|tcolorbox| is made a hyperlink (without frame and title). |
| 2826 |
\end{docTcbKey} |
| 2827 |
|
| 2828 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperlink title}{=\meta{marker}}{no default, initially unset} |
| 2829 |
Identical to \refKey{/tcb/hyperlink}, but only the \textit{title} of a |
| 2830 |
|tcolorbox| is made a hyperlink. |
| 2831 |
\end{docTcbKey} |
| 2832 |
|
| 2833 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperlink node}{=\marg{marker}\marg{node}}{no default, initially unset} |
| 2834 |
Identical to \refKey{/tcb/hyperlink}, but only the given \tikzname\ \meta{node} |
| 2835 |
is made a hyperlink. This \meta{node} may be |frame|, |interior|, |title|, or |
| 2836 |
any other named node used for drawing the |tcolorbox|. |
| 2837 |
The \meta{node} may be defined inside |
| 2838 |
\refKey{/tcb/underlay}, \refKey{/tcb/overlay} or \refKey{/tcb/finish}. |
| 2839 |
If the later is used, define the node \emph{before} \refKey{/tcb/hyperlink node} |
| 2840 |
is applied. |
| 2841 |
\end{docTcbKey} |
| 2842 |
|
| 2843 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl}{=\meta{url}}{no default, initially unset} |
| 2844 |
The whole \textit{frame} of a |tcolorbox| is made an active hyperlink for a |
| 2845 |
\meta{url} in the same manner as using |\href| or |\url|. |
| 2846 |
Such, the |tcolorbox| is made a clickable button (depending on the previewer). |
| 2847 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2848 |
\begin{tcolorbox}[enhanced,colback=red!50, |
| 2849 |
hyperurl=https://www.ctan.org/pkg/tcolorbox] |
| 2850 |
View CTAN with a browser. |
| 2851 |
\end{tcolorbox} |
| 2852 |
\end{dispExample*} |
| 2853 |
\end{docTcbKey} |
| 2854 |
|
| 2855 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl interior}{=\meta{url}}{no default, initially unset} |
| 2856 |
Identical to \refKey{/tcb/hyperurl}, but only the \textit{interior} of a |
| 2857 |
|tcolorbox| is made a hyperlink (without frame and title). |
| 2858 |
\end{docTcbKey} |
| 2859 |
|
| 2860 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl title}{=\meta{url}}{no default, initially unset} |
| 2861 |
Identical to \refKey{/tcb/hyperurl}, but only the \textit{title} of a |
| 2862 |
|tcolorbox| is made a hyperlink. |
| 2863 |
\end{docTcbKey} |
| 2864 |
|
| 2865 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl node}{=\marg{url}\marg{node}}{no default, initially unset} |
| 2866 |
Identical to \refKey{/tcb/hyperurl}, but only the given \tikzname\ \meta{node} |
| 2867 |
is made a hyperlink. This \meta{node} may be |frame|, |interior|, |title|, or |
| 2868 |
any other named node used for drawing the |tcolorbox|. |
| 2869 |
The \meta{node} may be defined inside |
| 2870 |
\refKey{/tcb/underlay}, \refKey{/tcb/overlay} or \refKey{/tcb/finish}. |
| 2871 |
If the later is used, define the node \emph{before} \refKey{/tcb/hyperurl node} |
| 2872 |
is applied. |
| 2873 |
\end{docTcbKey} |
| 2874 |
|
| 2875 |
|
| 2876 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl*}{=\marg{options}\marg{url}}{no default, initially unset} |
| 2877 |
Identical to \refKey{/tcb/hyperurl}, but additional |
| 2878 |
\refPkg{hyperref} \cite{rahtz:hyperref} \meta{options} are applied. |
| 2879 |
\begin{dispExample*}{sbs,lefthand ratio=0.7} |
| 2880 |
\begin{tcolorbox}[enhanced,colback=green!50, |
| 2881 |
hyperurl*={page=3,pdfnewwindow=true}% |
| 2882 |
{tcolorbox-example.pdf}] |
| 2883 |
Open example file on Page~3. |
| 2884 |
\end{tcolorbox} |
| 2885 |
\end{dispExample*} |
| 2886 |
\end{docTcbKey} |
| 2887 |
|
| 2888 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl* interior}{=\marg{options}\marg{url}}{no default, initially unset} |
| 2889 |
Identical to \refKey{/tcb/hyperurl interior}, but additional |hyperref| \cite{rahtz:hyperref} |
| 2890 |
\meta{options} are applied. |
| 2891 |
\end{docTcbKey} |
| 2892 |
|
| 2893 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl* title}{=\marg{options}\marg{url}}{no default, initially unset} |
| 2894 |
Identical to \refKey{/tcb/hyperurl title}, but additional |hyperref| \cite{rahtz:hyperref} |
| 2895 |
\meta{options} are applied. |
| 2896 |
\end{docTcbKey} |
| 2897 |
|
| 2898 |
\enlargethispage*{1cm} |
| 2899 |
|
| 2900 |
\begin{docTcbKey}[][doc new=2017-02-03]{hyperurl* node}{=\marg{options}\marg{url}\marg{node}}{no default, initially unset} |
| 2901 |
Identical to \refKey{/tcb/hyperurl node}, but additional |hyperref| \cite{rahtz:hyperref} |
| 2902 |
\meta{options} are applied. |
| 2903 |
\end{docTcbKey} |
| 2904 |
|
| 2905 |
|
| 2906 |
|
| 2907 |
\clearpage |
| 2908 |
\subsection{Jigsaw Skin Variants}\label{subsec:skinjigsaw} |
| 2909 |
As described in \zvref{sec:skincorekeys}, a |tcolorbox| is drawn by up to |
| 2910 |
four \emph{engines}. Typically, the \emph{frame} engine fills the complete box area |
| 2911 |
with color and the other engines fill certain areas with other colors. |
| 2912 |
Finally, only the area which you see as \emph{frame} of the box will display |
| 2913 |
the frame color. For most applications, this is a good approach. |
| 2914 |
|
| 2915 |
For certain boxes, a more delicate procedure is needed. E.\,g., if the box should |
| 2916 |
be translucent, an already painted area cannot be made unpainted. Therefore, |
| 2917 |
more elaborate frame engines saw holes into the frame where the interior area and |
| 2918 |
optionally the title area will be painted. |
| 2919 |
The resulting skins are called \emph{jigsaw} skins. For \refSkin{standard}, |
| 2920 |
\refSkin{enhanced}, and \refSkin{bicolor}, there are variants called \refSkin{standard jigsaw}, |
| 2921 |
\refSkin{enhanced jigsaw}, and \refSkin{bicolor jigsaw}. |
| 2922 |
|
| 2923 |
|
| 2924 |
\begin{dispExample*}{segmentation style={preaction={fill=white},pattern=checkerboard,pattern color=gray!40}} |
| 2925 |
\newcommand{\ballexample}{\begin{tikzpicture} |
| 2926 |
\path[use as bounding box] (0,0.8) rectangle +(0.1,0.1); |
| 2927 |
\shadedraw [shading=ball] (0,0) circle (1cm); |
| 2928 |
\shadedraw [ball color=red] (3,-2.2) circle (1cm); |
| 2929 |
\end{tikzpicture}} |
| 2930 |
|
| 2931 |
\tcbset{enhanced,colback=blue!5!white, |
| 2932 |
frame style={left color=red!75!black,right color=red!10!yellow}, |
| 2933 |
fonttitle=\bfseries } |
| 2934 |
|
| 2935 |
\ballexample |
| 2936 |
|
| 2937 |
\begin{tcolorbox}[title=A normal box] |
| 2938 |
\lipsum[2] |
| 2939 |
\end{tcolorbox} |
| 2940 |
|
| 2941 |
\ballexample |
| 2942 |
|
| 2943 |
\begin{tcolorbox}[title=A translucent jigsaw box, |
| 2944 |
enhanced jigsaw,opacityback=0.35] |
| 2945 |
\lipsum[2] |
| 2946 |
\end{tcolorbox} |
| 2947 |
\end{dispExample*} |
| 2948 |
|
| 2949 |
|
| 2950 |
\begin{dispExample*}{segmentation style={preaction={fill=white},pattern=checkerboard,pattern color=gray!40}} |
| 2951 |
\tcbset{enhanced,colback=red!10!white,coltitle=black, |
| 2952 |
frame style={left color=red!75!black,right color=red!10!yellow}, |
| 2953 |
fonttitle=\bfseries,interior hidden,title hidden} |
| 2954 |
|
| 2955 |
\begin{tcolorbox}[title=A normal box with hidden interior and title] |
| 2956 |
This is a tcolorbox. |
| 2957 |
\end{tcolorbox} |
| 2958 |
|
| 2959 |
\begin{tcolorbox}[enhanced jigsaw, |
| 2960 |
title=A jigsaw box with hidden interior and title] |
| 2961 |
This is a tcolorbox. |
| 2962 |
\end{tcolorbox} |
| 2963 |
\end{dispExample*} |
| 2964 |
|
| 2965 |
|
| 2966 |
\begin{dispExample*}{segmentation style={preaction={fill=white},pattern=checkerboard,pattern color=gray!40}} |
| 2967 |
\newtcolorbox{mybox}{skin=enhancedmiddle jigsaw,leftrule=5mm,rightrule=5mm, |
| 2968 |
boxsep=0mm,top=0mm,bottom=0mm, |
| 2969 |
frame style={top color=blue,bottom color=red},interior hidden} |
| 2970 |
|
| 2971 |
\begin{mybox} |
| 2972 |
\lipsum[2] |
| 2973 |
\end{mybox} |
| 2974 |
\end{dispExample*} |
| 2975 |
|
| 2976 |
|
| 2977 |
\clearpage |
| 2978 |
\subsection{Draft Mode}\label{subsec:draftmode} |
| 2979 |
To reduce the compilation time while drafting a document, the \emph{draft mode} |
| 2980 |
can be applied. Basically, it changes all skins to \refSkin{spartan} and |
| 2981 |
sets the \refKey{/tcb/fit algorithm} to |squeeze|. Especially, |
| 2982 |
when fuzzy shadows are used, the speedup will be considerable high. |
| 2983 |
|
| 2984 |
\begin{marker} |
| 2985 |
It is strongly recommended that the draft mode is \emph{not} used for the final document. |
| 2986 |
Use \refSkin{spartan} directly, if you want to stay with it. The draft mode |
| 2987 |
implementation may change in future. |
| 2988 |
\end{marker} |
| 2989 |
|
| 2990 |
\begin{marker} |
| 2991 |
Normally, switching to the draft mode should not alter the geometry of |
| 2992 |
your document. Since overlays are deactivated, any code placed there |
| 2993 |
(e.\,g.\ counter changes) is not executed anymore! Also, \refKey{/tcb/remember as} |
| 2994 |
will not have any effect. You may exclude critical code with |
| 2995 |
\refCom{tcbinterruptdraftmode} / \refCom{tcbcontinuedraftmode} |
| 2996 |
from converting to draft mode. |
| 2997 |
\end{marker} |
| 2998 |
|
| 2999 |
|
| 3000 |
\begin{docCommand}{tcbstartdraftmode}{} |
| 3001 |
Any following |tcolorbox| code is put into \emph{draft mode}. All skin |
| 3002 |
settings are overruled with \refSkin{spartan}. Overlays, watermarks, |
| 3003 |
shadows, borderlines, and rounded corners are deactivated for all |tcolorbox| |
| 3004 |
layers. |
| 3005 |
\end{docCommand} |
| 3006 |
|
| 3007 |
\begin{docCommand}{tcbstopdraftmode}{} |
| 3008 |
The \emph{draft mode} is deactivated for the following code. |
| 3009 |
\end{docCommand} |
| 3010 |
|
| 3011 |
\begin{docCommand}{tcbinterruptdraftmode}{} |
| 3012 |
If the compilation is in \emph{draft mode}, the \emph{draft mode} is deactivated |
| 3013 |
until a following \refCom{tcbcontinuedraftmode} is detected.\par |
| 3014 |
If the compilation is not in \emph{draft mode}, nothing happens and a following |
| 3015 |
\refCom{tcbcontinuedraftmode} will not start the \emph{draft mode}. |
| 3016 |
\begin{marker} |
| 3017 |
The pair |\tcbinterruptdraftmode| and |\tcbcontinuedraftmode| cannot |
| 3018 |
be used nested. |
| 3019 |
\end{marker} |
| 3020 |
\end{docCommand} |
| 3021 |
|
| 3022 |
\begin{docCommand}{tcbcontinuedraftmode}{} |
| 3023 |
Continues the \emph{draft mode} which was suspended by a preceding |
| 3024 |
\refCom{tcbinterruptdraftmode}. Nothing happens, if there was no draft |
| 3025 |
mode before \refCom{tcbinterruptdraftmode}. |
| 3026 |
\begin{marker} |
| 3027 |
Code, which is place between \refCom{tcbinterruptdraftmode} and |
| 3028 |
\refCom{tcbcontinuedraftmode} is shielded from \emph{draft mode}. |
| 3029 |
\end{marker} |
| 3030 |
\end{docCommand} |
| 3031 |
|
| 3032 |
|
| 3033 |
\clearpage |
| 3034 |
|
| 3035 |
\begin{docTcbKey}{draftmode}{\colOpt{=true\textbar false}}{default |true|, initially |false|} |
| 3036 |
If set to |true|, the \emph{draft mode} is started. |
| 3037 |
If set to |false|, the \emph{draft mode} is stopped. |
| 3038 |
|
| 3039 |
\begin{dispExample*}{} |
| 3040 |
\newtcolorbox{mybeamer}[2][]{beamer,colback=Salmon!50!white, |
| 3041 |
colframe=FireBrick!75!black,adjusted title={#2},#1} |
| 3042 |
|
| 3043 |
\begin{mybeamer}{Beamer box} |
| 3044 |
This box looks like a box provided by the \texttt{beamer} class. |
| 3045 |
\end{mybeamer}\par\medskip |
| 3046 |
\begin{mybeamer}[draftmode]{Beamer box} |
| 3047 |
This box looks like a box provided by the \texttt{beamer} class. |
| 3048 |
\end{mybeamer} |
| 3049 |
\end{dispExample*} |
| 3050 |
\end{docTcbKey} |
| 3051 |
|
| 3052 |
|