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:
\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}
For this definition, we get the maximal number of drawing steps:
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
1. shadow
• Section7.6 on page 121
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
2. frame
• /tcb/colframeÕ P. 19,/tcb/opacityframeÕ P. 33
• /tcb/frame codeÕ P. 85
• /tcb/frame styleÕ P. 93
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
3. interior
• /tcb/colbackÕ P. 19,/tcb/opacitybackÕ P. 33
• /tcb/interior codeÕ P. 86,/tcb/interior titled codeÕ P. 85
• /tcb/interior styleÕ P. 94
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
4. title area
• /tcb/colbacktitleÕ P. 19,/tcb/opacitybacktitleÕ P. 33
• /tcb/title codeÕ P. 87
• /tcb/title styleÕ P. 96
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
5. segmentation
• /tcb/lower separatedÕ P. 17
• /tcb/segmentation codeÕ P. 86
• /tcb/segmentation styleÕ P. 96
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
6. border line
• Section7.5 on page 118
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
7. underlay
• Section7.2 on page 99
• Section7.8 on page 133
Watermark
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
8. overlay
• Section3.8 on page 50
• Section7.3 on page 106
Watermark
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
9. text content
• /tcb/colupperÕ P. 20,/tcb/collowerÕ P. 20,/tcb/coltitleÕ P. 20
• /tcb/fontupperÕ P. 21,/tcb/fontlowerÕ P. 21,/tcb/fonttitleÕ P. 21
• /tcb/opacityupperÕ P. 34,/tcb/opacitylowerÕ P. 34,/tcb/opacitytitleÕ P. 34
Watermark
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
10. finish
• Section7.9 on page 135 All together, the box is drawn:
% \usepackage{lipsum}
\begin{testbox}
\lipsum[2]
\tcblower Lower part
\end{testbox}
Watermark
Test Box
Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo.
Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed ac-cumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.
Lower part
7 Library
LIBskins
The library is loaded by a package option or inside the preamble by:
\tcbuselibrary{skins}
This also loads the package tikz [19]. Typically but not necessarily, the following skins use tikz instead of pgf.
7.1 Style Option Keys
The following style options are applicable for all skins which use engines of type path, pathfirst, pathmiddle, or pathlast. Especially, the skin enhancedÕ P. 142 supports all of them and standardÕ P. 140 none.
/tcb/frame style=htikz keysi (style, no default)
The htikz keysi are used inside the tikz path command for drawing the frame of the box.
This option is available if the /tcb/frame engineÕ P. 82 is set to path, pathfirst, pathmiddle, or pathlast. It is not available for standard.
\tcbset{colback=red!5!white,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, frame style={left color=red!75!black,
right color=blue!75!black}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/frame style image=hfile namei (no default, initially unset) Fills the frame with an external image referenced by hfile namei. For advanced fea-tures like blending of a picture with the background, use/tcb/frame styletogether with /tikz/fill stretch imageÕ P. 183.
\tcbset{colback=red!5!white,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, frame style image=blueshade.png]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/frame style tile={hgraphics optionsi}{hfile namei} (no default, initially unset) Fills the frame with a tile pattern based on an external image referenced by hfile namei.
The hgraphics optionsi are given to the underlying \includegraphics command. For ad-vanced features like blending of a picture with the background, use/tcb/frame styleÕ P. 93 together with /tikz/fill tile imageÕ P. 187.
\tcbset{colback=red!5!white,coltitle=red!30!black, opacityback=0.75,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, frame style tile={width=1cm}{pink_marble.png}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/frame hidden (style, no value)
This is a shortcut for frame style={draw=none,fill=none}. Depending on the skin, this option switches off the drawing of the frame. Alternatively, use /tcb/frame emptyÕ P. 85.
\tcbset{colback=red!5!white,colframe=red!75!black, fonttitle=\bfseries,coltitle=black}
\begin{tcolorbox}[enhanced,title=My title, frame hidden]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/interior style=htikz keysi (style, no default)
The htikz keysi are used inside the tikz path command for drawing the interior of the box. They are used for the titled and for the untitled version as well.
This option is available if the /tcb/interior titled engineÕ P. 82 or /tcb/interior engineÕ P. 83 is set to path, pathfirst, pathmiddle, or pathlast. It is not available for standard.
\tcbset{colframe=red!75!black,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, interior style={left color=red!20!white,
right color=yellow!50!white}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/interior style image=hfile namei (no default, initially unset) Fills the interior with an external image referenced by hfile namei. For advanced features like blending of a picture with the background, use /tcb/interior styleÕ P. 94 together with/tikz/fill stretch imageÕ P. 183.
\tcbset{colframe=red!75!black,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, interior style image=goldshade.png]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/interior style tile={hgraphics optionsi}{hfile namei} (no default, initially unset) Fills the interior with a tile pattern based on an external image referenced by hfile namei.
The hgraphics optionsi are given to the underlying \includegraphics command. For advanced features like blending of a picture with the background, use /tcb/interior styleÕ P. 94 together with /tikz/fill tile imageÕ P. 187.
\tcbset{colframe=red!75!black,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title,
interior style tile={width=2cm}{crinklepaper.png}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/interior hidden (style, no value)
This is a shortcut for interior style={draw=none,fill=none}. Depending on the skin, this option switches off the drawing of the interior. Alternatively, use /tcb/interior emptyÕ P. 86 and/or /tcb/interior titled emptyÕ P. 85.
\tcbset{frame style={top color=red!20!white, bottom color=red!20!white!75!black}, fonttitle=\bfseries,coltitle=black}
\begin{tcolorbox}[enhanced,title=My title, interior hidden]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/segmentation style=htikz keysi (style, no default) The htikz keysi are used inside the tikz path command for drawing the segmentation line of the box.
This option is available if the /tcb/segmentation engineÕ P. 83 is set to path. It is not available for standard.
\tcbset{colback=red!5!white,colframe=red!75!black, fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, segmentation style={double=white,draw=blue,
double distance=1pt,solid}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/segmentation hidden (style, no value)
This is a shortcut for segmentation style={draw=none,fill=none}. Depending on the skin, this option switches off the drawing of the segmentation line. See also /tcb/lower separatedÕ P. 17 which has the same effect for most skins. Alternatively, use /tcb/segmentation emptyÕ P. 86.
\tcbset{colback=red!5!white,colframe=red!75!black, fonttitle=\bfseries}
\begin{tcolorbox}[title=My title, enhanced,segmentation hidden]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/title style=htikz keysi (style, no default)
The htikz keysi are used inside the tikz path command for drawing the title area of the box.
This option is available if the /tcb/title engineÕ P. 83 is set to path, pathfirst, pathmiddle, or pathlast. It is not available for standard.
\tcbset{colback=red!5!white,colframe=red!75!black, coltitle=blue!50!black,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, title style={left color=blue!15!yellow,
right color=red!85!black}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/title style image=hfile namei (no default, initially unset) Fills the title area with an external image referenced by hfile namei. For advanced features like blending of a picture with the background, use /tcb/title styleÕ P. 96 together with /tikz/fill stretch imageÕ P. 183.
\tcbset{colback=blue!5!white,colframe=blue!75!black, fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, title style image=blueshade.png]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/title style tile={hgraphics optionsi}{hfile namei} (no default, initially unset) Fills the title area with a tile pattern based on an external image referenced by hfile namei.
The hgraphics optionsi are given to the underlying \includegraphics command. For ad-vanced features like blending of a picture with the background, use/tcb/title styleÕ P. 96 together with /tikz/fill tile imageÕ P. 187.
\tcbset{colback=red!5!white,colframe=red!75!black, coltitle=blue!50!black,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=My title, title style tile={width=1cm}{pink_marble.png}]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tcb/title hidden (style, no value)
This is a shortcut for title style={draw=none,fill=none}. Depending on the skin, this option switches off the drawing of the title background. See also/tcb/title filledÕ P. 19 for a similar effect. Alternatively, use /tcb/title emptyÕ P. 87.
\tcbset{colback=red!5!white,colframe=red!75!black, fonttitle=\bfseries}
\begin{tcolorbox}[title=My title, enhanced,title hidden]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
The combined TikZ style applied to frame, interior, and title background can used by authors in customizing code.
/tikz/tcb fill frame (style, no value)
This is a TikZ style which is finally applied to the frame of the box.
% \tcbuselibrary{hooks}
\tcbset{enhanced,colback=red!5!white, colframe=red!75!black,fonttitle=\bfseries, frame code app={\path[tcb fill frame]
([yshift=-2mm]frame.north) circle (8mm); } }
\begin{tcolorbox}[title=My title]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tikz/tcb fill interior (style, no value)
This is a TikZ style which is finally applied to the interior of the box.
% \tcbuselibrary{hooks}
\tcbset{enhanced,colback=red!5!white, colframe=red!75!black,fonttitle=\bfseries,
interior titled code app={\path[tcb fill interior]
([yshift=-0.1pt]interior.north east) --([yshift=3pt]interior.north)
--([yshift=-0.1pt]interior.north west) --cycle;} }
\begin{tcolorbox}[title=My title]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.
/tikz/tcb fill title (style, no value)
This is a TikZ style which is finally applied to the title area of the box.
% \tcbuselibrary{hooks}
\tcbset{enhanced,colback=red!5!white, colframe=red!75!black,fonttitle=\bfseries, colbacktitle=blue!75!black,
title code app={\path[tcb fill title]
(title) circle (5mm); } }
\begin{tcolorbox}[title=My title]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
My title
This is a tcolorbox.
This is the lower part.