tcolorbox: raster of equal height and a minimum height
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.