[Tex/LaTex] How to arrange the text and image in one beamer frame

beamergraphics

I want to arrange my text and images as the following in one frame in the beamer.

enter image description here

Is it possible to place more images under the text, such as three images or even more?

enter image description here

Best Answer

This is not the easiest way, but this adapts the width of the image boxes according to the number of boxes (set the counter \numofboxes accordingly)

\documentclass[demo]{beamer}


\usepackage{calc}
\usepackage{blindtext}

\newcounter{numofboxes}
\newcounter{numofgaps}

\newlength{\textsectionwidth}

\newlength{\truetextsectionwidth}
\newlength{\gapwidth}
\newlength{\boxwidth}

\setlength{\gapwidth}{2\tabcolsep}




\setlength{\textsectionwidth}{\textwidth}



\begin{document}

% Set the number of boxes
\setcounter{numofboxes}{2}
\setcounter{numofgaps}{\numexpr\number\value{numofboxes}-1}

% Calculate the boxlengths
\setlength{\truetextsectionwidth}{\textsectionwidth-\number\value{numofgaps}\gapwidth}

\setlength{\boxwidth}{\truetextsectionwidth/\number\value{numofboxes}}


\begin{frame}{A frame with two images}
  \begin{tabular}{*{\number\value{numofboxes}}c}
    \multicolumn{\number\value{numofboxes}}{p{\textsectionwidth}}{%
      \small\blindtext
    }\tabularnewline
   \includegraphics[scale=1,width=\boxwidth]{fig1} &        \includegraphics[scale=0.2,width=\boxwidth]{fig2} \tabularnewline 
  \end{tabular}
\end{frame}


\setcounter{numofboxes}{4}
\setcounter{numofgaps}{\numexpr\number\value{numofboxes}-1}

\setlength{\truetextsectionwidth}{\textsectionwidth-\number\value{numofgaps}\gapwidth}

\setlength{\boxwidth}{\truetextsectionwidth/\number\value{numofboxes}}


\begin{frame}{A frame with four images}
  \begin{tabular}{*{\number\value{numofboxes}}c}
    \multicolumn{\number\value{numofboxes}}{p{\textsectionwidth}}{%
      \small\blindtext
    }\tabularnewline
   \includegraphics[scale=1,width=\boxwidth]{fig1} &        \includegraphics[scale=0.2,width=\boxwidth]{fig2} &  \includegraphics[scale=0.2,width=\boxwidth]{fig3} & \includegraphics[scale=0.2,width=\boxwidth]{fig4}  \tabularnewline
  \end{tabular}
\end{frame}


\end{document}

enter image description here