[Tex/LaTex] Two images to fill one beamer frame: most appropriate method

beamergraphics

Suppose I have two images: one a solid blue square and another a yellow. What is the most appropriate way to divide and fill an entire beamer frame with these images? Horizontally (i.e., left half blue right half yellow)? Vertically? (i.e., top half blue bottom half yellow)

This post provides a method, but it involves low-level operations. Another post (can't find the link now) suggests using TikZ.

Is there a third that doesn't involve low-level operations or complicated external packages? I'm confused. I'd think this task wouldn't be all that difficult.

Best Answer

You can use the standard \includegraphics command setting the proper values for the width and height in terms of \paperwidth and \paperheight; a box (in this case \makebox) will prevent an overfull box; using plain for the frames will remove the headline, footline:

\documentclass{beamer}
\usepackage{graphicx}

\begin{document}

\begin{frame}[plain]
\makebox[\linewidth]{%
  \includegraphics[width=0.5\paperwidth,height=\paperheight]{cat1}%
  \includegraphics[width=0.5\paperwidth,height=\paperheight]{cat2}}
\end{frame}

\begin{frame}[plain]
\makebox[\linewidth]{%
  \includegraphics[width=\paperwidth,height=0.5\paperheight]{cat1}}\\\nointerlineskip
\makebox[\linewidth]{%
  \includegraphics[width=\paperwidth,height=0.5\paperheight]{cat2}
}
\end{frame}

\end{document}