[Tex/LaTex] Stretch block to fill minipage vertically in beamer

beamerblockminipage

I have the following environment that is supposed to divide the beamer page in four equal parts:

\newcommand{\FourQuads}[4]{
\begin{minipage}[t][.5\textheight][t]{\textwidth}
    \begin{minipage}[t]{.47\textwidth}    
        \begin{block}{Second}
            #1
        \end{block}
    \end{minipage}
    \begin{minipage}[t]{.47\textwidth}
        \begin{block}{Second}
            #2
        \end{block}
    \end{minipage}
\end{minipage}
\begin{minipage}[t][.5\textheight][t]{\textwidth}
    \begin{minipage}[t]{.47\textwidth}
        \begin{block}{Third}
            #3
        \end{block}
    \end{minipage}
    \begin{minipage}[t]{.47\textwidth}
        \begin{block}{Fourth}
            #4
        \end{block}
    \end{minipage}
\end{minipage}
}

each of the four areas will present the text in a block environment: in particular, one may use it so:

\documentclass[t]{beamer}
\usecolortheme{rose}


\begin{document} 
\begin{frame}{A very important slide}
\FourQuads%
{first item\\
another first item}
{second item}
{third item}
{fourth item\\
another fourth item}
\end{frame}
\end{document}

which generates the following:

enter image description here

As you can see, according to the different lengths of the text in each area, the blocks stretch along: this means that whenever the lengths differ, the boxes might mismatch. I am looking for a way to somehow vertically stretch or fill the block environments, whether or not there is text in there (should there be no text, the block may just vertically fill the remaining space in the minipage environment).

It will most likely be some sort of combination of \vfill or \setlength, but I do not know where to exactly place those parameters to achieve the result. Of course, there might also be a better solution than using minipage four times (I have tried columns but it does not really give anything better).

Best Answer

Place the minipages inside the blocks to get a fixed height:

\documentclass[t]{beamer}
\usecolortheme{rose}

\newcommand{\FourQuads}[4]{
    \begin{columns}[onlytextwidth]
        \begin{column}{.45\textwidth}
            \begin{block}{First}
                \begin{minipage}[t][.25\textheight][t]{\textwidth}
                    #1
                \end{minipage}
            \end{block}
        \end{column}
        \begin{column}{.45\textwidth}
            \begin{block}{Second}
                \begin{minipage}[t][.25\textheight][t]{\textwidth}
                    #2
                \end{minipage}
            \end{block}
        \end{column}        
    \end{columns}
    \begin{columns}[onlytextwidth]
        \begin{column}{.45\textwidth}
            \begin{block}{Third}
                \begin{minipage}[t][.25\textheight][t]{\textwidth}
                    #3
                \end{minipage}
            \end{block}
        \end{column}
        \begin{column}{.45\textwidth}
            \begin{block}{Fourth}
                \begin{minipage}[t][.25\textheight][t]{\textwidth}
                    #4
                \end{minipage}
            \end{block}
        \end{column}        
    \end{columns}   
}




\begin{document} 
\begin{frame}{A very important slide}
\FourQuads%
{first item\\
another first item}
{second item}
{third item}
{fourth item\\
another fourth item}
\end{frame}
\end{document}

enter image description here

Related Question