[Tex/LaTex] Boxes placement in tcolorbox

tcolorbox

I'd like to know if there is a way to place tcolorboxes like this:

-------- --------
| box1 | |      |
-------- | box3 |  
-------- |      | 
| box2 | |      |
-------- --------

To do that I'm actually placing the boxes inside tikz nodes, but that seems like an overkill solution. Is there a tikz-free approach?

Best Answer

Obviously, you would use the \tcbox macro version for your boxes, rather than the environment form. Calculation of the stackgap is shown automated in this MWE. (Note: this example works starting with V2.30 of tcolorbox).

\documentclass{article}
\usepackage{stackengine}
\usepackage{tcolorbox}
\begin{document}

\def\boxone{\tcbox[nobeforeafter]{This is a test}}
\def\boxtwo{\tcbox[nobeforeafter]{Another test}}
\def\boxthree{\tcbox[nobeforeafter,minipage,width=0.7in]{this is a very long box}}

\stackon[\heightof{\boxthree}-\heightof{\boxone}-\heightof{\boxtwo}]%
  {\boxtwo}{\boxone}~\boxthree

\end{document}

enter image description here

Related Question