summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tcolorbox/tcolorbox.doc.technical.tex
blob: 2d637f4678aa82e27daa13401fd7e1f587a9a78b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
% !TeX root = tcolorbox.tex
% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox)
\clearpage
\section{Technical Overview and Customization}\label{sec:technical}%
\tcbset{external/prefix=external/technical_}%
This section provides a technical overview of the skin concept of |tcolorbox|.
For most applications of |tcolorbox|, one will not need to know the bells and
whistles described herein.
You may proceed to \Vref{sec:skins} where the customization options
for most users are documented.

The following explanations also cover options and settings from the \mylib{skins} library,
see  \Vref{sec:skins}.

\subsection{Skins and Drawing Engines}\label{sec:skincorekeys}
From a technical point of view, a \emph{skin} is a style definition for the
appearance of a |tcolorbox|. The core package provides some additional
option keys for skins but only two skins called \refSkin{standard}
and \refSkin{standard jigsaw}.
The \mylib{skins} library adds several more skins. To change to a skin, only one
option from the core package has to be set.

\begin{docTcbKey}{skin}{=\meta{name}}{style, no default, initially \texttt{standard}}
  Sets the current skin to \meta{name}. This is a style definition which sets all the following
  keys, i.\,e.\ for many use cases there is nothing more to do.
\begin{dispExample}
\tcbset{colback=Salmon!50!white,colframe=FireBrick!75!black,
  width=(\linewidth-8mm)/2,before=,after=\hfill,equal height group=ske}

\begin{tcolorbox}[adjusted title=My title]
  This is my content.
\end{tcolorbox}
\begin{tcolorbox}[skin=beamer,beamer,adjusted title=My title]
  This is my content.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{skin first}{=\meta{name}}{style, no default, initially \texttt{standard}}
  If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually,
  then the skin for the \emph{first} part of the break sequence
  is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}.
  Typically, this key is set by a \refKey{/tcb/skin}.
\end{docTcbKey}


\begin{docTcbKey}{skin middle}{=\meta{name}}{style, no default, initially \texttt{standard}}
  If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually,
  then the skin for the \emph{middle} parts (if any) of the break sequence
  is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}.
  Typically, this key is set by a \refKey{/tcb/skin}.
\end{docTcbKey}


\begin{docTcbKey}{skin last}{=\meta{name}}{style, no default, initially \texttt{standard}}
  If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually,
  then the skin for the \emph{last} part of the break sequence
  is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}.
  Typically, this key is set by a \refKey{/tcb/skin}.
\end{docTcbKey}


\clearpage

\begin{docTcbKey}{graphical environment}{=\meta{name}}{no default, initially \texttt{pgfpicture}}
  Sets the graphical environment for the |tcolorbox| to \meta{name}.
  Feasible values are |pgfpicture| and |tikzpicture| or environments which
  inherit from one of these two. This key is set by a \refKey{/tcb/skin} and
  may seldom be used directly.
\end{docTcbKey}

The skin of a |tcolorbox| is drawn by up to four \emph{engines}.
Afterwards, the text content is drawn which is not part of a skin.
The four steps are:
\begin{enumerate}
\item The \emph{frame} of the box, drawn by \refKey{/tcb/frame engine}.
\item The \emph{interior} of the box. The interior of a box with title is
  drawn differently from a box without title.
  \refKey{/tcb/interior titled engine} or \refKey{/tcb/interior engine}
  is used to draw the interior.
\item The \emph{segmentation} (line) of the box, if there is a lower part;
  drawn by \refKey{/tcb/segmentation engine}.
\item The \emph{title area} of the box, if there is a title and
  \refKey{/tcb/title filled} is set to |true|; drawn
  by \refKey{/tcb/title engine}.
\end{enumerate}

%Every engine for the up to four steps can be set to one of the following types:
%\begin{enumerate}
%\item\docValue{standard}: the original code from the core package.
%\item\docValue{path}: a |tikz| path which can be controlled by options.
%\item\docValue{pathfirst}: a |tikz| path which can be controlled by options.
%\item\docValue{pathmiddle}: a |tikz| path which can be controlled by options.
%\item\docValue{pathlast}: a |tikz| path which can be controlled by options.
%\item\docValue{freelance}: arbitrary user code.
%\item\docValue{spartan}: a quite spartan code.
%\end{enumerate}
%\clearpage

\begin{docTcbKey}{frame engine}{=\meta{name}}{no default, initially \texttt{standard}}
  Sets the \emph{frame} drawing engine for a box to \meta{name}.
  Typically, this key is set by a \refKey{/tcb/skin}.
  Feasible values for \meta{name} are:
  \begin{itemize}
  \item\docValue{standard}: the original code from the core package,
  \item\docValue{path}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{pathjigsaw}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{pathfirst}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{pathfirstjigsaw}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{pathmiddle}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{pathmiddlejigsaw}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{pathlast}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{pathlastjigsaw}: a |tikz| path which is controlled by \refKey{/tcb/frame style},
  \item\docValue{freelance}: deprecated.
  \item\docValue{spartan}: a quite spartan code.
  \item\docValue{empty}: draw nothing.
\end{itemize}
\end{docTcbKey}

\begin{docTcbKey}{interior titled engine}{=\meta{name}}{no default, initially \texttt{standard}}
  Sets the \emph{interior} drawing engine for a titled box to \meta{name}.
  Typically, this key is set by a \refKey{/tcb/skin}.
  Feasible values for \meta{name} are:
  \begin{itemize}
  \item\docValue{standard}: the original code from the core package,
  \item\docValue{path}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{pathfirst}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{pathmiddle}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{pathlast}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{freelance}: deprecated.
  \item\docValue{spartan}: a quite spartan code.
  \item\docValue{empty}: draw nothing.
  \end{itemize}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{interior engine}{=\meta{name}}{no default, initially \texttt{standard}}
  Sets the \emph{interior} drawing engine for an untitled box to \meta{name}.
  Typically, this key is set by a \refKey{/tcb/skin}.
  Feasible values for \meta{name} are:
  \begin{itemize}
  \item\docValue{standard}: the original code from the core package,
  \item\docValue{path}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{pathfirst}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{pathmiddle}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{pathlast}: a |tikz| path which is controlled by \refKey{/tcb/interior style},
  \item\docValue{freelance}: deprecated.
  \item\docValue{spartan}: a quite spartan code.
  \item\docValue{empty}: draw nothing.
  \end{itemize}
\end{docTcbKey}

\begin{docTcbKey}{segmentation engine}{=\meta{name}}{no default, initially \texttt{standard}}
  Sets the \emph{segmentation} (line) drawing engine for a box to \meta{name}.
  Typically, this key is set by a \refKey{/tcb/skin}.
  Feasible values for \meta{name} are:
  \begin{itemize}
  \item\docValue{standard}: the original code from the core package,
  \item\docValue{path}: a |tikz| path which is controlled by \refKey{/tcb/segmentation style},
  \item\docValue{freelance}: deprecated.
  \item\docValue{spartan}: a quite spartan code.
  \item\docValue{empty}: draw nothing.
  \end{itemize}
\end{docTcbKey}

\begin{docTcbKey}{title engine}{=\meta{name}}{no default, initially \texttt{standard}}
  Sets the \emph{title area} drawing engine for a titled box to \meta{name}.
  Typically, this key is set by a \refKey{/tcb/skin}.
  Feasible values for \meta{name} are:
  \begin{itemize}
  \item\docValue{standard}: the original code from the core package,
  \item\docValue{path}: a |tikz| path which is controlled by \refKey{/tcb/title style},
  \item\docValue{pathfirst}: a |tikz| path which is controlled by \refKey{/tcb/title style},
  \item\docValue{pathmiddle}: a |tikz| path which is controlled by \refKey{/tcb/title style},
  \item\docValue{pathlast}: a |tikz| path which is controlled by \refKey{/tcb/title style},
  \item\docValue{freelance}: deprecated.
  \item\docValue{spartan}: a quite spartan code.
  \item\docValue{empty}: draw nothing.
  \end{itemize}
\end{docTcbKey}

\begin{marker}
After an engine is set to an initializing value, the resulting graphical
code can be changed using code option keys, see \Vref{subsec:addcodeoptions}.
\end{marker}

\clearpage
\begin{docTcbKey}{geometry nodes}{\colOpt{=true\textbar false}}{default |true|, initially |false|}
  If set to |true|, up to four |tikz| nodes are defined for a |tcolorbox|
  which are named |frame|, |interior|, |segmentation|, and |title|. These nodes
  describe the boundaries of the equally named parts of a |tcolorbox|.
  They are used by most engines based on \tikzname.
  Typically, this key is set automatically by a \refKey{/tcb/skin}.
\begin{dispExample}
\tcbset{colback=Salmon!50!white,colframe=FireBrick!75!black,
  width=(\linewidth-8mm)/2,before=,after=\hfill,equal height group=geon}

\begin{tcolorbox}[adjusted title=The title]
  The upper part.\tcblower The lower part.
\end{tcolorbox}
\begin{tcolorbox}[enhanced,adjusted title=The title,
  frame code={\path[draw=red,fill=red!25]
      (frame.south west) rectangle (frame.north east);},
  interior titled code={\path[draw=blue,fill=blue!25]
      (interior.south west) rectangle (interior.north east);},
  segmentation code={\path[draw=green,fill=green!25]
      (segmentation.south west) rectangle (segmentation.north east);},
  title code={\path[draw=black,fill=brown!75!black]
      (title.south west) rectangle (title.north east);}]
  The upper part.\tcblower The lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}






\clearpage
\subsection{Code Option Keys}\label{subsec:addcodeoptions}
The following code options are applicable for all skins.
%which
%use engines of type |freelance|.
%Especially, the skin \refSkin{freelance} supports \emph{all} of them,
%\refSkin{standard} and \refSkin{enhanced} \emph{none} of them.
The used \meta{graphical code} can be any |pgf| code. For all skins
with exception of \refSkin{standard}
and \refSkin{standard jigsaw}, the \meta{graphical code} can also
be any \tikzname\ code.


\begin{docTcbKey}{frame code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|}
  The given \meta{graphical code} is used for drawing the \emph{frame} of the box.
  %This option is available only if the \refKey{/tcb/frame engine} is set to |freelance|.
\begin{dispExample}
\tcbset{colback=red!5!white,colframe=red!75!black}

\begin{tcolorbox}[enhanced,frame code={
  \foreach \n in {north east,north west,south east,south west}
  {\path [fill=red!75!black] (interior.\n) circle (3mm); }; }]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{frame empty}{}{style, no value}
  This is a shortcut for setting  \refKey{/tcb/frame code} to empty.
  This option removes the drawing of the frame.
  Alternatively, use \refKey{/tcb/frame hidden}.
\end{docTcbKey}


\begin{docTcbKey}{interior titled code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|}
  The given \meta{graphical code} is used
  for drawing the \emph{interior} of the box, if the box comes with a title.
  %This option is available only if the \refKey{/tcb/interior titled engine} is set to |freelance|.
\begin{dispExample}
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}

\begin{tcolorbox}[enhanced,title=My title,interior titled code={
  \path[draw=red!5!white,line width=5mm,line cap=round]
    ([xshift=3mm,yshift=-3mm]interior.north west)
    --([xshift=-3mm,yshift=3mm]interior.south east)
    ([xshift=3mm,yshift=3mm]interior.south west)
    --([xshift=-3mm,yshift=-3mm]interior.north east);}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{interior titled empty}{}{style, no value}
  This is a shortcut for setting  \refKey{/tcb/interior titled code} to empty.
  This option removes the drawing of the untitled interior.
  Alternatively, use \refKey{/tcb/interior hidden}.
\end{docTcbKey}



\clearpage
\begin{docTcbKey}{interior code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|}
  The given \meta{graphical code} is used
  for drawing the \emph{interior} of the box, if the box is without a title.%\\
  %This option is available only if the \refKey{/tcb/interior engine} is set to |freelance|.
\begin{dispExample}
\tcbset{colback=red!5!white,colframe=red!75!black}

\begin{tcolorbox}[enhanced,interior code={
  \path[draw=red!5!white,line width=5mm,line cap=round]
    ([xshift=3mm,yshift=-3mm]interior.north west)
    --([xshift=-3mm,yshift=3mm]interior.south east)
    ([xshift=3mm,yshift=3mm]interior.south west)
    --([xshift=-3mm,yshift=-3mm]interior.north east);}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{interior empty}{}{style, no value}
  This is a shortcut for setting  \refKey{/tcb/interior code} to empty.
  This option removes the drawing of the interior.
  Alternatively, use \refKey{/tcb/interior hidden}.
\end{docTcbKey}


\begin{docTcbKey}{segmentation code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|}
  The given \meta{graphical code} is used for drawing the
  \emph{segmentation} area of the box.%\\
  %This option is available only if the \refKey{/tcb/segmentation engine} is set to |freelance|.
\begin{dispExample}
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}

\begin{tcolorbox}[enhanced,title=My title,segmentation code={
  \path[top color=red!5!white,bottom color=red!5!white,middle color=blue]
  (segmentation.south west) rectangle (segmentation.north east);}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{segmentation empty}{}{style, no value}
  This is a shortcut for setting  \refKey{/tcb/segmentation code} to empty.
  This option removes the drawing of the segmentation line.
  Alternatively, use \refKey{/tcb/segmentation hidden}.
\end{docTcbKey}



\clearpage
\begin{docTcbKey}{title code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|}
  The given \meta{graphical code} is used for drawing the
  \emph{title} area of the box.
  %\\
  %This option is available only if the \refKey{/tcb/title engine} is set to |freelance|.
\begin{dispExample}
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,
  coltitle=black}

\begin{tcolorbox}[enhanced,title=My title,title code={
  \path[draw=yellow,solid,decorate,line width=2mm,
    decoration={coil,aspect=0,segment length=10.1mm}]
    ([xshift=1mm]title.west) -- ([xshift=-1mm]title.east);}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{title empty}{}{style, no value}
  This is a shortcut for setting  \refKey{/tcb/title code} to empty.
  This option removes the drawing of the title area.
  Alternatively, use \refKey{/tcb/title hidden}.
\end{docTcbKey}

\clearpage
\subsection{Subskins}\label{subsec:subskins}
A subskin is a new \refKey{/tcb/skin} based on an existing skin which
is extended or changed.

\begin{marker}
Never use geometry settings or bounding box options inside a subskin definition!
If one skin is replaced by another skin, the overall bounding box should stay
constant. Especially, if a skin is used for a breakable box, unpredictable
and unpleasant results could arise otherwise. If you want to change the
geometry also, use an additional style. See the skin \refSkin{beamer} and
the style \refKey{/tcb/beamer} as pattern.
\end{marker}

\begin{docCommand}{tcbsubskin}{\marg{name}\marg{base skin}\marg{options}}
  Creates a new skin \meta{name} which inherits all properties of an
  existing \meta{base skin} plus the given \meta{options}.
  The new skin \meta{name} can be used as value for the keys
  \refKey{/tcb/skin},
  \refKey{/tcb/skin first},
  \refKey{/tcb/skin middle}, and
  \refKey{/tcb/skin last}.
  As \meta{base skin}, one can take \refSkin{standard}, \refSkin{empty},
  \refSkin{enhanced}, or any skin from the \mylib{skins} library,
  see \Vref{sec:skins}.

\begin{dispExample}
% \tcbuselibrary{skins}
\tcbsubskin{mycross}{empty}{frame code={%
  \draw[red,line width=5pt] (frame.south west)--(frame.north east);
  \draw[red,line width=5pt] (frame.north west)--(frame.south east);},
  skin first=mycross,skin middle=mycross,skin last=mycross }

\begin{tcolorbox}[skin=mycross]
  This is my content.
\end{tcolorbox}
\end{dispExample}

\end{docCommand}


\begin{docTcbKey}{skin first is subskin of}{=\marg{base skin}\marg{options}}{no default, initially unset}
  Creates a new unnamed skin which inherits all properties of an
  existing \meta{base skin} plus the given \meta{options}.
  This skin is set as \refKey{/tcb/skin first}.\\
  See a detailed example on page~\pageref{freeboxexample}.
\end{docTcbKey}


\begin{docTcbKey}{skin middle is subskin of}{=\marg{base skin}\marg{options}}{no default, initially unset}
  Creates a new unnamed skin which inherits all properties of an
  existing \meta{base skin} plus the given \meta{options}.
  This skin is set as \refKey{/tcb/skin middle}.\\
  See a detailed example on page~\pageref{freeboxexample}.
\end{docTcbKey}


\begin{docTcbKey}{skin last is subskin of}{=\marg{base skin}\marg{options}}{no default, initially unset}
  Creates a new unnamed skin which inherits all properties of an
  existing \meta{base skin} plus the given \meta{options}.
  This skin is set as \refKey{/tcb/skin last}.\\
  See a detailed example on page~\pageref{freeboxexample}.
\end{docTcbKey}


\clearpage
\subsection{Drawing Scheme}\label{subsec:tcolorboxdrawing}

\bgroup

Depending on the complexity of a |tcolorbox| definition, the resulting box
is drawn in a more or less complex series of steps.

To document and demonstrate these drawing steps, we consider the
following box definition:

\begin{dispListing}
\newtcolorbox{testbox}[1][]{enhanced,title=Test Box,
  boxrule=1mm,titlerule=0.5mm,colframe=blue!50!black,
  interior style={top color=blue!20!green!50!white,bottom color=blue!20!yellow!50!white},
  colbacktitle=blue!50!green!90!white,segmentation style={solid},
  fonttitle=\bfseries,drop fuzzy shadow,borderline={0.3mm}{0.35mm}{yellow!50!white},
  underlay={\path[fill image opacity=0.15,fill image scale=0.9,
    fill stretch picture={\draw[blue,line width=2mm] circle (1);}]
    (interior.south west) rectangle (interior.north east);},
  watermark text={Watermark},watermark color={green!20!white},
  finish={\begin{tcbclipframe}
    \path[bottom color=black,top color=black!50!white,opacity=0.1]
      (frame.south west) -- (frame.south east) -- (frame.north east) -- cycle;
    \path[top color=white,bottom color=black!50!white,opacity=0.1]
      (frame.south west) -- (frame.north east) -- (frame.north west) -- cycle;
    \end{tcbclipframe}},#1}
\end{dispListing}
\tcbusetemp

For this definition, we get the maximal number of drawing steps:

\newtcolorbox{itembox}{oversize,enhanced,frame empty,segmentation empty,colback=white,middle=2mm,boxsep=0pt,
  fuzzy halo=0.5mm with blue!15!white,
  before lower=\raggedright\begin{itemize},after lower=\end{itemize}}

\tcbset{finishcomment/.style={
  finish={\node[fill=white,draw=black!50!white,rounded corners] at (frame.center) {#1};}
}}


\begin{itembox}
\begin{testbox}[frame empty,interior titled empty,title empty,segmentation empty,
  no shadow,no borderline,no underlay,no overlay,no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  drop fuzzy shadow=red!75!white,
  finishcomment={1.~shadow}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item Section~\ref{subsec:shadows} on page \pageref{subsec:shadows}.
\end{itembox}

\begin{itembox}
\begin{testbox}[interior titled empty,title empty,segmentation empty,
  no borderline,no underlay,no overlay,no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  colframe=red!75!white,
  finishcomment={2.~frame}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\refKey{/tcb/colframe}, \refKey{/tcb/opacityframe}
\item\refKey{/tcb/frame code}
\item\refKey{/tcb/frame style}
\end{itembox}


\begin{itembox}
\begin{testbox}[title empty,segmentation empty,
  no borderline,no underlay,no overlay,no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  colback=red!75!white,
  finishcomment={3.~interior}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\refKey{/tcb/colback}, \refKey{/tcb/opacityback}
\item\refKey{/tcb/interior code}, \refKey{/tcb/interior titled code}
\item\refKey{/tcb/interior style}
\end{itembox}


\begin{itembox}
\begin{testbox}[segmentation empty,
  no borderline,no underlay,no overlay,no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  colbacktitle=red!75!white,
  finishcomment={4.~title area}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\refKey{/tcb/colbacktitle}, \refKey{/tcb/opacitybacktitle}
\item\refKey{/tcb/title code}
\item\refKey{/tcb/title style}
\end{itembox}


\begin{itembox}
\begin{testbox}[
  no borderline,no underlay,no overlay,no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  segmentation style={solid,red!75!white},
  finishcomment={5.~segmentation}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\refKey{/tcb/lower separated}
\item\refKey{/tcb/segmentation code}
\item\refKey{/tcb/segmentation style}
\end{itembox}


\begin{itembox}
\begin{testbox}[
  no borderline,no underlay,no overlay,no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  borderline={0.3mm}{0.35mm}{red!75!white},
  finishcomment={6.~border line}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\Vref{subsec:borderline}
\end{itembox}


\begin{itembox}
\begin{testbox}[
  no underlay,no overlay,no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  underlay={\path[opacity=0.15,fill image scale=0.9,
    fill stretch picture={\draw[red,line width=2mm] circle (1);}]
    (interior.south west) rectangle (interior.north east);},
  finishcomment={7.~underlay}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\Vref{subsec:skinboxedtitle}
\item\Vref{subsec:skinunderlay}
\end{itembox}


\begin{itembox}
\begin{testbox}[
  no finish,opacityupper=0,opacitylower=0,opacitytitle=0,
  watermark color={red!75!white},
  finishcomment={8.~overlay}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\Vref{subsec:overlays}
\item\Vref{subsec:watermarks}
\end{itembox}


\begin{itembox}
\begin{testbox}[
  no finish,
  colupper=red!75!white,coltitle=red!75!white,collower=red!75!white,
  finishcomment={9.~text content}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\refKey{/tcb/colupper}, \refKey{/tcb/collower}, \refKey{/tcb/coltitle}
\item\refKey{/tcb/fontupper}, \refKey{/tcb/fontlower}, \refKey{/tcb/fonttitle}
\item\refKey{/tcb/opacityupper}, \refKey{/tcb/opacitylower}, \refKey{/tcb/opacitytitle}
\end{itembox}


\begin{itembox}
\begin{testbox}[
  finishcomment={10.~finish}]
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\tcblower
\item\Vref{subsec:skinfinish}
\end{itembox}

All together, the box is drawn:
\begin{dispExample}
% \usepackage{lipsum}
\begin{testbox}
\lipsum[2]
\tcblower
Lower part
\end{testbox}
\end{dispExample}

\egroup


\clearpage
\subsection{Color Names}\label{subsec:tech_colornames}
Color settings for a |tcolorbox| are saved into named colors which may be
used inside a box, e.g. for an overlay.
\tcbdocmarginnote{\tcbdocnew{2019-01-18}}
These color names are
\begin{itemize}
\item\docColor{tcbcolframe} set by \refKey{/tcb/colframe} (frame color)
\item\docColor{tcbcolback} set by \refKey{/tcb/colback} (background color)
\item\docColor{tcbcolbacktitle} set by \refKey{/tcb/colbacktitle} (background color of the title)
\item\docColor{tcbcolbacklower} set by \refKey{/tcb/colbacklower} (skin dependend background color
  of the lower part; needs \mylib{skins} to be loaded)
\item\docColor{tcbcolupper} set by \refKey{/tcb/colupper} (text color upper part)
\item\docColor{tcbcollower} set by \refKey{/tcb/collower} (text color lower part)
\item\docColor{tcbcoltitle} set by \refKey{/tcb/coltitle} (text color title)
\end{itemize}

\medskip

\begin{dispExample}
% \tcbuselibrary{skins}
\begin{tcolorbox}[title=Color names,
    colframe=blue!50!black,colback=blue!5,
    colbacktitle=blue!50,colupper=red!35!black]
  \foreach \name in {tcbcolframe,tcbcolback,tcbcolbacktitle,tcbcolbacklower,
    tcbcolupper,tcbcollower,tcbcoltitle}
  {\tikz\path[draw,fill=\name]
    (0,0) rectangle node[right=4mm,font=\ttfamily]{\name} (0.8,0.8);\par}
\end{tcolorbox}
\end{dispExample}



\clearpage
\subsection{Useful Properties}\label{subsec:tech_properties}

The following macros describe certain \textit{properties} which may be
used for the drawing scheme, see \Fullref{subsec:tcolorboxdrawing}.
Sometimes, they are even available inside the box content. All of them are
considered to be \textit{read-only} and should never be redefined by the user.

\begin{docCommand}[doc new=2016-02-16]{tcbheightspace}{}
  If the height of a |tcolorbox| is not the natural height, the space
  difference between the forced and the natural size is hold by
  \refCom{tcbheightspace}.
  This macro is not usable inside the box content, but for skins or
  inside \refKey{/tcb/underlay}, \refKey{/tcb/overlay}, etc.

  If such a space information is needed inside the box content, see
  \refKey{/tcb/space to} instead.
\begin{dispExample}
% \tcbuselibrary{skins}
\newtcolorbox{testbox}[2][]{enhanced,size=fbox,
  colframe=blue!75!black,colback=white,height=#2,
  underlay={\node[above,inner sep=3pt] at (interior.south){%
    \includegraphics[width=\tcbtextwidth,height=\tcbheightspace-3pt]{goldshade.png}};
    },
  #1}
\begin{testbox}{3cm}
  This is my box. The space is filled with a picture.
\end{testbox}
\begin{testbox}{2cm}
  This is my box. The space is filled with a picture.
\end{testbox}
\end{dispExample}
\end{docCommand}


\begin{docCommand}[doc new=2016-02-16]{tcbtextwidth}{}
  This property describes the box content width.
  \begin{itemize}
  \item  If there also is a lower part, it describes the width of the upper part.
  \item For \refKey{/tcb/sidebyside} boxes, it describes the combined text
    width plus segmentation.
  \item This property can be used inside the box content text with exception
    of \refKey{/tcb/fit} boxes.
  \item \refCom{tcbtextwidth} can be used for all box types for skins or
    inside \refKey{/tcb/underlay}, \refKey{/tcb/overlay}, etc.
  \end{itemize}
\begin{dispExample}
\begin{tcolorbox}[colframe=blue!75!black]
  Inside a box: \tcbtextwidth\ (=\the\linewidth).
\end{tcolorbox}
\end{dispExample}
\end{docCommand}

\pagebreak
\begin{docCommand}[doc new=2016-02-16]{tcbtextheight}{}
  This property describes the designated box content height. If the
  box is larger than the natural height, the actual content will be smaller
  than \refCom{tcbtextheight}.
  \begin{itemize}
  \item For boxes with a fixed \refKey{/tcb/height}, this property can
    be used inside the box content text. For other boxes, it denotes |0pt|
    inside the box content.
  \item \refCom{tcbtextheight} can be used for all box types for skins or
    inside \refKey{/tcb/underlay}, \refKey{/tcb/overlay}, etc.
  \end{itemize}

\begin{dispExample}
% \tcbuselibrary{skins}
\begin{tcolorbox}[enhanced,colframe=blue!75!black,
    underlay={\node[left,red] at (frame.east) {Here: \tcbtextheight};}]
  Inside a box with natural height: \tcbtextheight.
\end{tcolorbox}
\begin{tcolorbox}[enhanced,colframe=blue!75!black,height=1cm,
    underlay={\node[left,red] at (frame.east) {Here: \tcbtextheight};}]
  Inside a box with fixed height: \tcbtextheight.
\end{tcolorbox}
\end{dispExample}
\end{docCommand}


\begin{docCommand}[doc new=2017-04-25]{tcbsegmentstate}{}
  This macro contains |0|, |1|, or |2|. Itis set for every unbroken box and every broken partial box
  with the following meaning:
  \begin{itemize}
    \item\docValue{0}: The current (partial) box contains only an upper part.
    \item\docValue{1}: The current (partial) box contains an upper and a lower part.
      The segmentation node can be used for positioning.
    \item\docValue{2}: The current (partial) box contains only a lower part.
      This can only be true for parts of breakable boxes.
  \end{itemize}
  Skins like \refSkin{bicolor} use this property to paint the (partial) boxes.
\begin{dispExample}
% \tcbuselibrary{skins,raster}
\begin{tcbraster}[raster equal height,enhanced,
    watermark text=\tcbsegmentstate]
  \begin{tcolorbox}Upper part\end{tcolorbox}
  \begin{tcolorbox}Upper part\tcblower Lower part\end{tcolorbox}
\end{tcbraster}
\end{dispExample}
\end{docCommand}