Beamer 2×2 fields with graphics and text blocks

beamer

i have a sample code with which i'm trying to use the whole space of the slide for 1 image plus a text block (2 x 1 invisible table e.g.) or 2 images plus 2 text blocks (2 x 2). But for the latter i'm not able to make text blocks centered en their "cells". At the bottom i put an image of what i want. I did it in loimpress.

\documentclass[aspectratio=1610]{beamer}
%\usetheme{Warsaw}

\usepackage{graphicx}
\graphicspath{ {./} {../../items/} }

\begin{document}

\begin{frame}[c]
\begin{columns}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{apple.png}
  \column{0.5\textwidth}
  \center\huge apple \\
  pomme
\end{columns}
\end{frame}

\begin{frame}[c]
\begin{columns}
  \column{0.5\textwidth}
  \includegraphics[width=\textwidth]{banana.png}
  \includegraphics[width=\textwidth]{apple.png}

  \column{0.5\textwidth}
  \center\huge banana \\
  banane \\
  apple \\
  pomme
\end{columns}
\end{frame}
\end{document}

enter image description here

Best Answer

There are many possibilities to achieve what you want, including tikz. The above answers so far suffer a bit from limited control of the exact position. My favorite approach is to use a \textblock for the "rows" and then use a columns environment inside the textblock. Most of the time this seems to correspond to the way how slide content is used/composed (at least for me...).

Here is an example how you could achieve this:

\documentclass[aspectratio=1610]{beamer}

\usepackage{graphicx}
\graphicspath{ {./} {../../items/} }

% textpos allows to arbitrary position TeX code, e.g., by 
% \begin{textblock}{1}(0., -0.08) Some text \end{textblock}
\usepackage[absolute,overlay,showboxes]{textpos}  % delete "showboxes" to remove the outline of the text boxes
\TPGrid{1}{1} % defines the units


\begin{document}
    \begin{frame}[c]
        % ====================================================================================================
        % ======= Define the upper row with image on the left and text on the right.                     =====
        % ====================================================================================================
        \begin{textblock*}{0.9\pagewidth}(0.05\pagewidth, 0.01\pageheight)  % {size}(hpos, vpos)
            \begin{columns}
                % ------ the left "box" with the image ------------------
                \column{0.45\textwidth}
                    \color{blue}\fbox{\color{black} %  draw the blue box on the left        
                  % The minipage takes all the horizontal space of the column;
                  % the height (0.42\textwidth) can be changed and defines the height of the row
                        \begin{minipage}[c][0.42\textheight][c]{\textwidth}
                            \centering
                            \includegraphics[width=0.25\pagewidth]{apple}
                        \end{minipage}
                    }
                % -------- the right "box" with the text ----------------
                \column{0.45\textwidth}
                    \color{red}\fbox{\color{black}%  draw the red box on the right
                        \begin{minipage}[c][0.42\textheight][c]{0.95\textwidth}
                            \centering\huge apple\\
                            pomme 
                        \end{minipage}
                    }
            \end{columns}               
        \end{textblock*}        
        % ====================================================================================================
        
        
        % ====================================================================================================
        % ======= Define the lower row with image on the left and text on the right.                    ======
        % ======= This is independent of the upper "row" -- just specify the offset (vpos) of textblock ======
        % ====================================================================================================
        \begin{textblock*}{0.9\pagewidth}(0.05\pagewidth, 0.5\pageheight)  % {size}(hpos, vpos)
            \begin{columns}
                % ------ the left "box" with the image ------------------
                \column{0.45\textwidth} % width of the green box
                \color{green}\fbox{\color{black} %  draw the green box on the left      
                    \begin{minipage}[c][0.42\textheight][c]{\textwidth}
                        \centering
                        \includegraphics[width=0.25\pagewidth]{banana}
                    \end{minipage}
                }
                % -------- the right "box" with the text ----------------
                \column{0.45\textwidth}
                \centering
                \color{cyan}\fbox{\color{black}%  draw the cyan box on the right
                    \begin{minipage}[c][0.42\textheight][c]{0.95\textwidth}
                        \centering\huge banana\\
                        banane\\
                        banana
                    \end{minipage}
                }
            \end{columns}               
        \end{textblock*}    
        % ====================================================================================================
    \end{frame}

\end{document}

I added colored boxes to show which object is which (black: textblock, colored: minipages within colum environments): you can remove the boxes by deleting "showboxes" in the respective usepackage command and by deleting the lines containing fbox (including the closing "}").

The arguments of the textblock environment allow absolute positioning of content on the frame, the columns environment do what they do best ...

Finally, here's a screenshot: screenshot.

Last but not least, from my code it should be clear that you can also do this using only textblocks, not using the colums environment at all. But that might be a matter of taste ;)

I hope that this is useful for someone!