Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latex: text should automatically fill the frame in Beamer slides

Tags:

latex

beamer

In beamer frames I want the contents to be spread out evenly across the frame.

Using option \documentclass[slidestop]{beamer} I can easily specify the contents to be top/center aligned but when I have only few bullets on a slide they get clustered together at the top, I want beamer to decide the spacing between them automatically to spread them evenly.

Is this possible without putting vspace by trial and error?

like image 380
thequark Avatar asked Jan 22 '23 18:01

thequark


1 Answers

I think using \vfill would reduce the trial and error part. One \vfill between each bullet should guarantee even spacing. Try \vfill before and/or after bullets to get separation from preceding text or from bottom of page. I don't use or know Beamer, but I suspect there's a way to put the \vfill commands into the Beamer template.

\documentclass{article}
\begin{document}
\begin{itemize}
\vfill\item This is text of first item
\vfill\item This is text of second item
\vfill\item This is text of third item
\end{itemize}
\end{document}

Per your comment, here's one way you could define vfill to be automatically used in main list items but have no vfill in subitems. THis way lets you use same \item command regardless of whether you're in main list or in nested list, but requires you to define or redefine environments, and to be aware of when you're adding a main (i.e, vfilled) list and when you're adding a non-vfilled (i.e, nested) list:

\documentclass{article}

\newenvironment{novfillenum}{\begin{enumerate}\let\item\olditem}%
{\end{enumerate}}
\newenvironment{vfilleditems}{\begin{itemize} \let\olditem\item \renewcommand\item{\vfill\olditem}}%
{\end{itemize}}

\begin{document}
\begin{vfilleditems}
\item Item One 
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\item Item Two 
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\item item three
   \begin{novfillenum}
        \item subitem1
        \item s2
        \item s3
    \end{novfillenum}
\end{vfilleditems}

\end{document}
like image 157
Herbert Sitz Avatar answered Feb 27 '23 02:02

Herbert Sitz