% /tcbuselibrary (Skins, Xparse) % /usepackage (Lipsum) % /newsavebox/mysavebox % Preamble
% /tcbuselibrary (Skins, Xparse) % /usepackage (Lipsum) % /newsavebox/mysavebox % Preamble
% /tcbuselibrary (Skins, Xparse) % /usepackage (Lipsum) % /newsavebox/mysavebox % Preamble
to be computed beforehand. The following example uses a savebox \mysavebox to store the
picture to determine its width. A more convenient way to handle this task is to use the methods
from Section 6.2 on page 121.
% \tcbuselibrary{skins,xparse}
% \usepackage{lipsum}
% \newsavebox\mysavebox % preamble
\DeclareTotalTColorBox{\mysidebox}{ O{} +m +m }{
bicolor,colback=white,colbacklower=yellow!10,
fonttitle=\bfseries,center title,
sidebyside,
code={\sbox{\mysavebox}{#2}},
lefthand width=\wd\mysavebox,
drop lifted shadow,
#1
}
{\usebox{\mysavebox}\tcblower#3}
\mysidebox[title=The Triangle]{%
\begin{tikzpicture}
\path[fill=red!20,draw=red!50!black]
(0,0) node[below]{A} -- (3,1) node[right]{B}
-- (1,4) node[above]{C} -- cycle;
\end{tikzpicture}%
}{%
\lipsum[1]
}
The Triangle
120