Page LayoutPlace environment at the bottom in a Beamer

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
mgmillani
Posts: 16
Joined: Fri Dec 20, 2013 7:26 pm

Place environment at the bottom in a Beamer

Post by mgmillani »

I'm trying to place a block inside a frame in such a way that it remains exactly on the same position, regardless of what comes before, so that when I change slides, it doesn't move around. I also want it to be at the bottom. I tried using a \vfill before, but this doesn't work at all. Attempting to use a figure with [b!] also doesn't.

Example code:

Code: Select all

\documentclass{beamer}
\usepackage[utf8]{inputenc}

\begin{document}

	\begin{frame}
		\begin{itemize}
			\item something
		\end{itemize}
		\vfill
		\begin{block}
			Remember
		\end{block}
	\end{frame}
	
		\begin{frame}
		\begin{itemize}
			\item something
			\item another thing
			\item yet another thing
		\end{itemize}
		\vfill
		\begin{block}
			Remember
		\end{block}
	\end{frame}

\end{document}
Is there anything I can do, besides using \vspace with a manually calculated value every frame?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Place environment at the bottom in a Beamer

Post by Johannes_B »

You can use the b option for the frames, so
everything will be aligned at the bottom. Or you put everything
at a fixed position on the page using a package like
textpos.

For your example i would rather use overlays, which are provided
by beamer itself. There are much more options to tweak the
appearance. A look inside the beamer documentation might give
some helpful knowledge.

Code: Select all

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usetheme{Rochester}%JB: Just to better see the block
\begin{document}

\begin{frame}[b]
	\begin{itemize}
		\item something
	\end{itemize}
	\begin{block}{}
	%JB: blocks need a title, which can be empty
		Remember
	\end{block}
\end{frame}

\begin{frame}[b]
	\begin{itemize}
		\item something
		\item another thing
		\item yet another thing
	\end{itemize}
	\begin{block}{}%JB: blocks need a title
		Remember
	\end{block}
\end{frame}

\begin{frame}{using overlays}
	\begin{itemize}[<+->]
		\item something
		\item another thing
		\item yet another thing
	\end{itemize}
	\begin{block}{}%JB: blocks need a title
		Remember
	\end{block}
\end{frame}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
mgmillani
Posts: 16
Joined: Fri Dec 20, 2013 7:26 pm

Place environment at the bottom in a Beamer

Post by mgmillani »

Using \begin{frame}[b] looks really ugly, so I decided to use textpos.
My current solution is:

Code: Select all

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[absolute, overlay]{textpos}

\setlength{\TPHorizModule}{\paperwidth}\setlength{\TPVertModule}{\paperheight}
\begin{document}

	\newcommand{\remember}
	{%
		\begin{textblock}{1.0}(0.1 , 0.7)
			\begin{block}{Remember}
				Whatever
			\end{block}
		\end{textblock}
	}

	\begin{frame}{}
		\remember
	\end{frame}

	\begin{frame}
		\begin{enumerate}
			\item one
		\end{enumerate}
		\remember
	\end{frame}
	
		\begin{frame}
		\begin{itemize}
			\item something
			\item another thing
			\item yet another thing
		\end{itemize}
		\remember
	\end{frame}

\end{document}
Unfortunately, this requires manually adjusting the position so that the block won't go over the margins. I tried to see if there is any way to get the size of the margins in a Beamer, but I had no success. On beamer.sty, there are lines like \newdimen\beamer@leftmargin, but \beamer@leftmargin cannot be used inside documents. The geometry package may have something for that, but I guess it will be a lot of trouble doing this nicely. If I figure out how to do arithmetics with the lengths, maybe I can fix this.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Place environment at the bottom in a Beamer

Post by Johannes_B »

If you do not want to use overlays, an alternative to textpos might be Tikz (see section 17.13.2 Referencing the current page node). You can do lots of cool stuff with Tikz, have a look at TeXample.net.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply