Vertical align of minipage tcolorbox
See the update for a special tcolorbox
for such environments at the end of the answer.
Use tcbraster
to align the box -- this provides a much cleaner interface for many setups with tcolorbox
.
Say \begin{tcbraster}[raster columns=2,box valign=top]...\end{tcbraster}
, for example
Please note that only tcolorbox
environments may appear in a raster.
\documentclass{article}
\usepackage[x11names,svgnames,dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcbraster}[raster columns=2, raster valign=top]
\begin{tcolorbox}[colback=white!70!yellow,colframe=white!20!black,title=Boundary layer]
\footnotesize 0, no boundary-layer
1, YSU scheme
2, Mellor-Yamada-Janjic TKE
3, NCEP Global Forecast System
\end{tcolorbox}
\begin{tcolorbox}[colback=white!70!yellow,colframe=white!20!black,title=Surface physics]
\footnotesize 0, no surface temp prediction
1, thermal diffusion scheme
2, Unified Noah land-surface model
1, thermal diffusion scheme
2, Unified Noah land-surface model
1, thermal diffusion scheme
2, Unified Noah land-surface model
3, RUC land-surface model
\end{tcolorbox}
\end{tcbraster}
\end{document}
Update with special tcolorbox
for this.
\documentclass{article}
\usepackage[x11names,svgnames,dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
\newtcolorbox{somebox}[1][]{%
colback=white!70!yellow,
colframe=white!20!black,
#1%
}
\begin{document}
\begin{tcbraster}[raster columns=2, raster valign=top,fontupper=\footnotesize]
\begin{somebox}[title=Boundary layer]
0, no boundary-layer
1, YSU scheme
2, Mellor-Yamada-Janjic TKE
3, NCEP Global Forecast System
\end{somebox}
\begin{somebox}[title=Surface physics]
0, no surface temp prediction
1, thermal diffusion scheme
2, Unified Noah land-surface model
1, thermal diffusion scheme
2, Unified Noah land-surface model
1, thermal diffusion scheme
2, Unified Noah land-surface model
3, RUC land-surface model
\end{somebox}
\end{tcbraster}
\end{document}
Here, I used the \belowbaseline
feature of stackengine
to place each minipage
a value of -\ht\strutbox
below the baseline, so that it acts like a [t]
aligned box. I added, as a test, "See baseline" text before the first box, so as to discern the rendered alignment.
\documentclass{article}
\usepackage{tcolorbox,xcolor,stackengine}
\begin{document}
See baseline\belowbaseline[-\ht\strutbox]{\begin{minipage}{0.5\textwidth}
\begin{tcolorbox}[colback=red!3,colframe=yellow!20!black,title=Boundary layer]
\footnotesize{0, no boundary-layer\\
1, YSU scheme\\
2, Mellor-Yamada-Janjic TKE\\
3, NCEP Global Forecast System}
\end{tcolorbox}
\end{minipage}}
\belowbaseline[-\ht\strutbox]{\begin{minipage}{0.5\textwidth}
\begin{tcolorbox}[colback=red!3,colframe=yellow!20!black,title=Surface physics]
\footnotesize{0, no surface temp prediction\\
1, thermal diffusion scheme\\
2, Unified Noah land-surface model\\
1, thermal diffusion scheme\\
2, Unified Noah land-surface model\\
1, thermal diffusion scheme\\
2, Unified Noah land-surface model\\
3, RUC land-surface model}
\end{tcolorbox}
\end{minipage}}
\end{document}