[Tex/LaTex] How to keep fixed height of mdframed in latex

mdframed

I am designing one page in which i need to write 3 mdframed side by side. but all three must be having same height.

  <mdframed1>   <mdframed2>  <mdframed3>

How can i implement this?

Best Answer

You can place each mdframed inside a minipage of the desired width (in this way, you can place sevearl mdframes side-by-side); inside each mdframed you can use a \parbox (or another minipage) of the predefined height. In the example below I implement this idea using a command with a mandatory argument (for the contents of the mdframed) and an optional argument to pass options to mdframed, but of course, you can implement the idea in any other way that suits your needs:

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}

\newcommand\FixedHt[2][]{%
  \begin{minipage}[t]{.30\textwidth}
  \begin{mdframed}[roundcorner=5pt,#1]
  \parbox[t][8cm][t]{\linewidth}{#2}
  \end{mdframed}%
  \end{minipage}%
}

\begin{document}

\noindent\FixedHt[backgroundcolor=cyan!20]{Some text}\hfill\FixedHt[backgroundcolor=orange!20]{Some text}\hfill\FixedHt[backgroundcolor=green!20]{Some text}\par

\end{document}

enter image description here

Related Question