# tcolorbox: raster of equal height and a minimum height

I would like to make a tcolorbox raster, where every box in a row has the same height (easy). But I would also like to use the height from key to set a minimum height for the boxes. But as soon as I do it, I loose the equal height feature. Is there a way to combine both?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[many]{tcolorbox}
\begin{document}

\tcbset{enhanced,left=1cm}
\tcbset{marktext/.style={overlay={\node[rotate=90,text=black,anchor=north east] at (frame.north west){#1};}}}
\begin{tcbraster}[raster columns=3,raster equal height=rows]
\begin{tcolorbox}[marktext=shorter]
blbllb
\end{tcolorbox}
\begin{tcolorbox}[%height from=3cm to 30cm,
marktext=somelonger text]
blbllb\\blblb\\blblb\\blblb
\end{tcolorbox}
\begin{tcolorbox}[marktext=short]
blbllb
\end{tcolorbox}
\begin{tcolorbox}[marktext=x]
blbllb
\end{tcolorbox}

\end{tcbraster}
\end{document}


### Result when the height from is used (middle box is large enough, but equal height is lost):

• I still don't understand how they work, but last version (3.90) includes some rasters combining rows and columns and rasters inside raster (pp 265-272) which I think can help you. – Ignasi Mar 12 '16 at 18:33
• @Ignasi if I have to nest something I probaly won't need some inside raster -- a minipage and some strut will work. But the code would be cleaner if I could simply set the minimum height of the box. – Ulrike Fischer Mar 12 '16 at 22:30

With minimum for equal height group, a lower minimal height can be given to an equal height group. Inside a raster, the name of the current equal height group is generated automatically or can be set by raster equal height group.

In my proposed solution, I use \tcb@ehgid, the internal name of the current equal height group. The minimum for equal height group is called with this name and the width of the side text plus some additional space:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[many]{tcolorbox}
\begin{document}

\tcbset{enhanced,left=1cm}

\makeatletter
\tcbset{marktext/.style={%
overlay={\node[rotate=90,text=black,anchor=north east] at (frame.north west){#1};},
code={\setbox\z@=\color@hbox#1\color@endbox\tcbdimto\myheight{\wd\z@+3mm}},
minimum for equal height group=\tcb@ehgid:\myheight,
}}

\makeatother

\begin{tcbraster}[raster columns=3,raster equal height=rows]
\begin{tcolorbox}[marktext=shorter]
blbllb
\end{tcolorbox}
\makeatletter
\begin{tcolorbox}[marktext=somelonger text]
blbllb\\blblb\\blblb\\blblb
\end{tcolorbox}
\makeatother
\begin{tcolorbox}[marktext=short]
blbllb
\end{tcolorbox}
\begin{tcolorbox}[marktext=x]
blbllb
\end{tcolorbox}

\end{tcbraster}
\end{document}


This gives:

Note that this tweaked marktext will raise an error, if no equal height group is set.

• Perfect. I hadn't realized that tcolorbox will do "the right thing" if one use more than one "minimum for equal height group". And the trick with the internal id is neat. – Ulrike Fischer Mar 14 '16 at 11:22
• @UlrikeFischer For the last package update, I was considering a minimum for current equal height group option, which would have been helpful here... – Thomas F. Sturm Mar 14 '16 at 11:40

Probably not what you want but why not just use a strut of some description

\documentclass{article}
\usepackage[many]{tcolorbox}
\begin{document}

\tcbset{enhanced,left=1cm}
\tcbset{marktext/.style={overlay={\node[rotate=90,text=black,anchor=north east] at (frame.north west){#1};}}}
\begin{tcbraster}[raster columns=3,raster equal height=rows]
\begin{tcolorbox}[marktext=shorter]
blbllb
\end{tcolorbox}
\begin{tcolorbox}[%height from=3cm to 30cm,
marktext=somelonger text]
blbllb\\blblb\\blblb\\blblb\\
\rule{0pt}{3cm}
\end{tcolorbox}
\begin{tcolorbox}[marktext=short]
blbllb
\end{tcolorbox}
\begin{tcolorbox}[marktext=x]
blbllb
\end{tcolorbox}

\end{tcbraster}
\end{document}


• No this will give to large boxes. The requirement is that the side text (inserted with the overlay) is inside the box. So with short text content I need some space at the bottom. But if the texbody gets longer, the box should simply fit. – Ulrike Fischer Mar 12 '16 at 21:18