or
Skillmon
beamer
When using `beamer` I like to add a bit of stretch to lists to give a more balanced look if I don't have a complete frame's worth of contents. This works for a `frame` and with a small adjustment also for `minipage` (why does `beamer` use second order of infinity, it is supposed to use only first order...). But since one shouldn't use `minipage` but `beamer`'s `columns` (why again?) I'd like to make it also work inside those. But it doesn't.

MWE:

```tex
\documentclass[]{beamer}

\usepackage{xparse}

\ExplSyntaxOn
\makeatletter
\let\my@orig@listi   \@listi
\let\my@orig@listii  \@listii
\let\my@orig@listiii \@listiii
\NewDocumentCommand\ResetLists{}%>>=
  {%
    \let\@listi   \my@orig@listi
    \let\@listI   \@listi
    \let\@listii  \my@orig@listii
    \let\@listiii \my@orig@listiii
  }%=<<
\newcommand\my@StretchyLists[1]%>>=
  {%
    \def\@listi
      {%
        \leftmargin\leftmargini
        \topsep  3\p@ \@plus2\p@ \@minus2.5\p@
        \parsep  0\p@
        \itemsep 3\p@ \@plus#1   \@minus3\p@
      }%
    \let\@listI\@listi
    \def\@listii
      {%
        \leftmargin\leftmarginii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
    \def\@listiii
      {%
        \leftmargin\leftmarginiii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
  }%=<<
\NewDocumentCommand\StretchyLists{t! s O{0.3}}%>>=
  {%
    \IfBooleanTF{#1}
      {\my@StretchyLists{#3}}
      {%
        \IfBooleanTF{#2}
          {\my@StretchyLists{#3fil}}
          {\my@StretchyLists{#3fill}}%
      }%
  }%=<<
\makeatother
\ExplSyntaxOff

\StretchyLists

\begin{document}
\begin{frame}{}{}
  \begin{itemize}
    \item first item
    \item second item
    \item third item
  \end{itemize}
\end{frame}

\begin{frame}{}{}
  \begin{columns}[onlytextwidth]
    \begin{column}{.45\textwidth}
      \begin{itemize}
        \item first item
        \item second item
        \item third item
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}{}{}
  \begin{minipage}[c][\textheight][c]{.45\textwidth}
    \StretchyLists*
    \begin{itemize}
      \item first item
      \item second item
      \item third item
    \end{itemize}
  \end{minipage}
\end{frame}
\end{document}
```
Top Answer
samcarter
Beamer columns are basically just minipages with some `\hfill` between them to distribute them across the page (and a couple of extra features like making them overlay aware etc.). So I would not say "don't use minipages with beamer" but rather that is normally easier to use columns instead of minipages.

In your example, you don't get any extra stretch between your items because the minipages beamer uses for the columns don't have any fixed height, this means they will take the height of the content. Now if the surrounding box has the same height as the content, it will look the same if stretched from from top to bottom of this box or not.

As a proof of concept you could redefine the column environment to use minipages of fixed height and you will see that suddenly you can see the stretch you added. (I added `\vfill` above and below the list, because this is normally add by beamer to the normal frame content)

Caveat: for everybody not using your custom class but the ordinary beamer class, `\textheight` will be too height, especially in case there is also a frametitle


```
\documentclass[]{beamer}

\makeatletter
\renewenvironment<>{beamer@columnenv}[2][\beamer@colmode]{%
  \beamer@colclose\def\beamer@colclose{}%
  \begin{actionenv}#3%
    \setkeys{beamer@col}{#1}%
    \begin{minipage}[\beamer@colalign][.99\textheight][c]{#2}%
      \leavevmode\raggedright\beamer@colheadskip\ignorespaces}
    {\end{minipage}\hfill\end{actionenv}\@ignoretrue}
\makeatother

\usepackage{xparse}

\ExplSyntaxOn
\makeatletter
\let\my@orig@listi   \@listi
\let\my@orig@listii  \@listii
\let\my@orig@listiii \@listiii
\NewDocumentCommand\ResetLists{}%>>=
  {%
    \let\@listi   \my@orig@listi
    \let\@listI   \@listi
    \let\@listii  \my@orig@listii
    \let\@listiii \my@orig@listiii
  }%=<<
\newcommand\my@StretchyLists[1]%>>=
  {%
    \def\@listi
      {%
        \leftmargin\leftmargini
        \topsep  3\p@ \@plus2\p@ \@minus2.5\p@
        \parsep  0\p@
        \itemsep 3\p@ \@plus#1   \@minus3\p@
      }%
    \let\@listI\@listi
    \def\@listii
      {%
        \leftmargin\leftmarginii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
    \def\@listiii
      {%
        \leftmargin\leftmarginiii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
  }%=<<
\NewDocumentCommand\StretchyLists{t! s O{0.3}}%>>=
  {%
    \IfBooleanTF{#1}
      {\my@StretchyLists{#3}}
      {%
        \IfBooleanTF{#2}
          {\my@StretchyLists{#3fil}}
          {\my@StretchyLists{#3fill}}%
      }%
  }%=<<
\makeatother
\ExplSyntaxOff

\StretchyLists

\begin{document}
\begin{frame}{}{}
  \begin{itemize}
    \item first item
    \item second item
    \item third item
  \end{itemize}
\end{frame}

\begin{frame}{}{}
  \begin{columns}[onlytextwidth]
    \begin{column}{.45\textwidth}
      \begin{itemize}
        \vfill
        \item first item
        \item second item
        \item third item
        \vfill
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\end{document}
```
Beamer, add stretch to lists
Skillmon
This does work as intended:  
  
```tex  
\documentclass[]{beamer}

\makeatletter
\renewenvironment<>{beamer@columnenv}[2][\beamer@colmode]
  {%
    \beamer@colclose\def\beamer@colclose{}%
    \begin{actionenv}#3%
      \setkeys{beamer@col}{#1}%
      \begin{minipage}[\beamer@colalign][.99\textheight][c]{#2}%
        \leavevmode\raggedright\beamer@colheadskip
        \if c\beamer@colalign\relax\vfill\fi
        \if b\beamer@colalign\relax\vfill\vfill\fi
        \ignorespaces
  }
  {%
        \if c\beamer@colalign\relax\vfill\fi
        \if t\beamer@colalign\relax\vfill\vfill\fi
        \null
      \end{minipage}%
    \hfill
    \end{actionenv}%
    \@ignoretrue
  }
\let\endcolumn\endbeamer@columnenv
\makeatother

\usepackage{xparse}

\ExplSyntaxOn
\makeatletter
\let\my@orig@listi   \@listi
\let\my@orig@listii  \@listii
\let\my@orig@listiii \@listiii
\NewDocumentCommand\ResetLists{}%>>=
  {%
    \let\@listi   \my@orig@listi
    \let\@listI   \@listi
    \let\@listii  \my@orig@listii
    \let\@listiii \my@orig@listiii
  }%=<<
\newcommand\my@StretchyLists[1]%>>=
  {%
    \def\@listi
      {%
        \leftmargin\leftmargini
        \topsep  3\p@ \@plus2\p@ \@minus2.5\p@
        \parsep  0\p@
        \itemsep 3\p@ \@plus#1   \@minus3\p@
      }%
    \let\@listI\@listi
    \def\@listii
      {%
        \leftmargin\leftmarginii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
    \def\@listiii
      {%
        \leftmargin\leftmarginiii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
  }%=<<
\NewDocumentCommand\StretchyLists{t! s O{0.3}}%>>=
  {%
    \IfBooleanTF{#1}
      {\my@StretchyLists{#3}}
      {%
        \IfBooleanTF{#2}
          {\my@StretchyLists{#3fil}}
          {\my@StretchyLists{#3fill}}%
      }%
  }%=<<
\makeatother
\ExplSyntaxOff

\StretchyLists

\begin{document}
\begin{frame}{}{}
  \begin{itemize}
    \item first item
    \item second item
    \item third item
  \end{itemize}
\end{frame}

\begin{frame}{}{}
  \begin{columns}[onlytextwidth]
    \begin{column}{.45\textwidth}
      \begin{itemize}
        \item first item
        \item second item
        \item third item
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\end{document}
```
Skillmon
Ok, `beamer` uses `\endcolumn` directly and ignores the contents of `\endbeamer@columnenv`.
Skillmon replying to samcarter
This was my idea:  
  
```tex  
\makeatletter
\renewenvironment<>{beamer@columnenv}[2][\beamer@colmode]
  {%
    \beamer@colclose\def\beamer@colclose{}%
    \begin{actionenv}#3%
      \setkeys{beamer@col}{#1}%
      \begin{minipage}[\beamer@colalign][.99\textheight][c]{#2}%
        \leavevmode\raggedright\beamer@colheadskip
        \if c\beamer@colalign\relax\vfill\fi
        \if b\beamer@colalign\relax\vfill\vfill\fi
        \ignorespaces
  }
  {%
        \show\beamer@colalign
        \if c\beamer@colalign\relax\vfill\fi
        \if t\beamer@colalign\relax\vfill\vfill\fi
        \null
      \end{minipage}%
    \hfill
    \end{actionenv}%
    \@ignoretrue
  }
\makeatother
```  
  
But this doesn't work as the end block is never used. You can as well use the following without errors being thrown:  
  
```tex  
\makeatletter
\renewenvironment<>{beamer@columnenv}[2][\beamer@colmode]
  {%
    \beamer@colclose\def\beamer@colclose{}%
    \begin{actionenv}#3%
      \setkeys{beamer@col}{#1}%
      \begin{minipage}[\beamer@colalign][.99\textheight][c]{#2}%
        \leavevmode\raggedright\beamer@colheadskip
        \if c\beamer@colalign\relax\vfill\fi
        \if b\beamer@colalign\relax\vfill\vfill\fi
        \ignorespaces
  }
  {}%
\makeatother
```
Skillmon replying to samcarter
`beamer` keeps surprising me with its inner ~~weirdness~~workings.
Skillmon replying to samcarter
ok, that doesn't work, because the code in the end block is never executed...
samcarter replying to Skillmon
I'm not sure I understand your proposal. Could you please show the whole code block where you want to add this?
Skillmon replying to samcarter
thank you very much. Sorry if stupid, but would it be possible to include the `\vfill`s inside the `beamer@columnenv` code based on the current `\beamer@colalign`? Currently the contents of the `minipage` will be centred and there are `\vfill` manually added, I think what would be more sensible (if this was forwarded to users) would be `\leavevmode\raggedright\beamer@colheadskip\if c\beamer@colalign\relax\vfill\fi\if b\beamer@colalign\relax\vfill\fi\ignorespaces` and then before `\end{minipage}` put `\if c\beamer@colalign\relax\vfill\fi\if t\beamer@colalign\relax\vfill\fi`. Would that break anything (I didn't run tests)?
samcarter replying to Skillmon
I tried to summarise some things, but honestly, I would probably simply use your minipage with fixed height
samcarter replying to Skillmon
Ah :)
Skillmon replying to samcarter
well David is longer in the business...
Skillmon replying to samcarter
interesting one, thanks.
Skillmon replying to samcarter
I guessed so, but don't have the time to dig, if you need to dig, don't answer, it's not that pressing.
Skillmon replying to samcarter
not in my custom class building upon `beamer` :)
samcarter
To get the real available height for the minipage you could use this little trick:
```
\documentclass{beamer}


\usepackage{xparse}

\ExplSyntaxOn
\makeatletter
\let\my@orig@listi   \@listi
\let\my@orig@listii  \@listii
\let\my@orig@listiii \@listiii
\NewDocumentCommand\ResetLists{}%>>=
  {%
    \let\@listi   \my@orig@listi
    \let\@listI   \@listi
    \let\@listii  \my@orig@listii
    \let\@listiii \my@orig@listiii
  }%=<<
\newcommand\my@StretchyLists[1]%>>=
  {%
    \def\@listi
      {%
        \leftmargin\leftmargini
        \topsep  3\p@ \@plus2\p@ \@minus2.5\p@
        \parsep  0\p@
        \itemsep 3\p@ \@plus#1   \@minus3\p@
      }%
    \let\@listI\@listi
    \def\@listii
      {%
        \leftmargin\leftmarginii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
    \def\@listiii
      {%
        \leftmargin\leftmarginiii
        \topsep  2\p@ \@plus#1  \@minus2\p@
        \parsep  0\p@ \@plus\p@
        \itemsep 0\p@ \@plus#1
      }%
  }%=<<
\NewDocumentCommand\StretchyLists{t! s O{0.3}}%>>=
  {%
    \IfBooleanTF{#1}
      {\my@StretchyLists{#3}}
      {%
        \IfBooleanTF{#2}
          {\my@StretchyLists{#3fil}}
          {\my@StretchyLists{#3fill}}%
      }%
  }%=<<
\makeatother
\ExplSyntaxOff

\StretchyLists

\begin{document}

\begin{frame}{}{}
  \begin{itemize}
    \item first item
    \item second item
    \item third item
  \end{itemize}
\end{frame}

\begin{frame}{}{}
  \begin{columns}[onlytextwidth]
    \begin{column}{.45\textwidth}
      \begin{itemize}
        \item first item
        \item second item
        \item third item
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}
  \begin{minipage}[c][\textheight][c]{.45\textwidth}
    \StretchyLists*
    \begin{itemize}
      \item first item
      \item second item
      \item third item
    \end{itemize}
  \end{minipage}
\end{frame}

\makeatletter
\begin{frame}
  \frametitle{Frametitle}
  \global\beamer@shrinktrue
  \gdef\beamer@shrinkframebox{%
    \setbox\beamer@framebox=\vbox to\beamer@frametextheight{%
      \begin{minipage}[c][\beamer@frametextheight][c]{.45\textwidth}
        \StretchyLists*
        \begin{itemize}
          \item first item
          \item second item
          \item third item
        \end{itemize}
      \end{minipage}
      \hfill
      \begin{minipage}[c][\beamer@frametextheight][c]{.45\textwidth}
        \StretchyLists*
        \begin{itemize}
          \item first item
          \item second item
          \item third item
        \end{itemize}
      \end{minipage}      
    }
  }
\end{frame}
\makeatother


\end{document}
```
samcarter
For beamer columns your approach does not work because under the hood beamer columns use minipages without fixed height, e.g. the minipage will automatically adapt to the height of the content which means that the stretch won't be visible.
samcarter
For your minipage approach with fixed height: please keep in mind that for frames with a frametitle `\textheight` will be too height. 
samcarter
"one shouldn't use `minipage`" is not really true. Beamers columns are basically just minipages with a bit of a bit of extra functionality, like being overlay aware and automatically distributing the columns across the page.  
samcarter replying to Skillmon
That's more than David can say :)
Skillmon
Ok, I did it, I asked a question.