4

I would like my description list to automatically fill the vertical space of a beamer slide. I have found solutions for this here, but it only applies to itemize and enumerate.

I tried to modify the examples in the list for a description list and it gives the desired effect for vertical spacing. However, the horizontal alignment alignment is incorrect. I cannot see the full description item because it is cut off on the left as shown in the image below.

I have provided the code for what I have tried so far below. Honestly, I get a little lost when I see \makeatletter.

\documentclass{beamer}

\makeatletter
\renewcommand{\description}[1][]{%
    \beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
    \ifnum \@itemdepth >2\relax\@toodeep\else
    \advance\@itemdepth\@ne
    \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
    \usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
    \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
    \list
    {\usebeamertemplate{itemize \beameritemnestingprefix item}}
    {\def\makelabel##1{%
            {%
                \hss\llap{{%
                        \usebeamerfont*{itemize \beameritemnestingprefix item}%
                        \usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
            }%
        }%
    }
    \fi%
    \setlength\itemsep{\fill}
    \ifnum \@itemdepth >1
    \vfill
    \fi%  
    \beamer@cramped%
    \raggedright%
    \beamer@firstlineitemizeunskip%
}
\def\enditemize{\ifhmode\unskip\fi\endlist%
    \usebeamertemplate{itemize/enumerate \beameritemnestingprefix body end}
    \ifnum \@itemdepth >1
    \vfil
    \fi%  
}
\makeatother


\begin{document}

\begin{frame}{Vertical Spacing}

    \begin{description}
        \item[description] details
        \item[description] vertical spacing is working
        \item[description] but descriptions are cut off  
    \end{description}

\end{frame}

\end{document}

enter image description here

1

1 Answer 1

5

You can use the same technique as in https://topanswers.xyz/tex?q=832#a2071

\documentclass{beamer}

\makeatletter
\define@key{beamerframe}{s}[true]{% stretch
  \beamer@frametopskip=0pt\relax%
  \beamer@framebottomskip=0pt\relax%
  \beamer@frametopskipautobreak=\beamer@frametopskip\relax%
  \beamer@framebottomskipautobreak=\beamer@framebottomskip\relax%
}
\makeatother

\begin{document}

\begin{frame}[s]
\frametitle{Vertical Spacing}

    \begin{description}
        \item[description] details
        \item[description] vertical spacing is working
        \item[description] but descriptions are cut off  
    \end{description}

\end{frame}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.