[Tex/LaTex] Adjust vertical space before enumerated list in Beamer

#enumeratebeameritemizespacing

In Beamer, I can easily set the desired vertical space between items in an enumerated list with itemsep. But how do I set the vertical space between the line that introduces the enumerated list and the first item in this list? Ideally I would like it to be identical to the space between the items in the list. In the MWE below, I want more space after the itemized line "Here are two interesting things:"

\documentclass{beamer}
\usepackage{lmodern}

\begin{document}
    \begin{frame}
        \begin{itemize}
            \item Here are two interesting things:
            \begin{enumerate} \itemsep2ex
                \item This is number one.
                \item And this is number two.
            \end{enumerate}
        \end{itemize}
    \end{frame}
\end{document}

enter image description here

Best Answer

Simply setting \topsep as is usual does not work in the beamer case. Instead you can redefine \@listii as follows:

Sample outptu

\documentclass{beamer}
\usepackage{lmodern}

\makeatletter
\def\@listii{\leftmargin\leftmarginii
              \topsep    2ex
              \parsep    0\p@   \@plus\p@
              \itemsep   \parsep}
\makeatother

\begin{document}
    \begin{frame}
        \begin{itemize}
            \item Here are two interesting things:
            \begin{enumerate} \itemsep2ex
                \item This is number one.
                \item And this is number two.
            \end{enumerate}
        \end{itemize}
    \end{frame}
\end{document}

See the file beamerbaselocalstructure.sty where you will find the formatting variables \@listi, \@listii and \@listiii for formatting of lists at depths one, two and three, respectively.

You can define macro that will set \topsep, \itemsep to the same value (#2) for lists of a given level as in the example below. This is particularly useful you want to scope the change of definition for just a single frame.

\documentclass{beamer}
\usepackage{lmodern}

\makeatletter
\newcommand{\setlistspacing}[2]{\def\@ld{#1}\expandafter\def\csname
@list\romannumeral\@ld \endcsname{\leftmargin\csname
leftmargin\romannumeral\@ld \endcsname
              \topsep    #2
              \parsep    0\p@   \@plus\p@
              \itemsep   #2}}
\makeatother

\begin{document}
{\setlistspacing{2}{2ex}
\begin{frame}
  \begin{itemize}
  \item Here are two interesting things:
    \begin{enumerate}
    \item This is number one.
    \item And this is number two.
    \end{enumerate}
  \item Here are no interesting things.
  \item Here are two interesting things:
    \begin{enumerate}
    \item This is number one.
    \item And this is number two.
    \end{enumerate}
  \end{itemize}
\end{frame}
}

{\setlistspacing{1}{4ex}
\begin{frame}
  \begin{itemize}
  \item Here are two interesting things:
    \begin{enumerate}
    \item This is number one.
    \item And this is number two.
    \end{enumerate}
  \item Here are no interesting things.
  \item Here are two interesting things.
    \begin{enumerate}
    \item This is number one.
    \item And this is number two.
    \end{enumerate}
  \end{itemize}
\end{frame}
}

\begin{frame}
  \begin{itemize}
  \item Here are two interesting things:
    \begin{enumerate}
    \item This is number one.
    \item And this is number two.
    \end{enumerate}
  \end{itemize}
\end{frame}

\end{document

}

Sample output