1

I want two figures to appear side by side in a beamer block. Can it be done? I have tried minipage and subfigure, but it all appears vertically. Here is a sample of what I have done (the scale was put randomly to try things out.)

\documentclass{beamer}
\usetheme{Boadilla}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{frame}{1}

    \begin{block}
    1
\begin{figure}
    \begin{minipage}{.5\textwidth}
    \centering
        \includegraphics[width=0.3\linewidth]{ej3.png}
        \caption{1}
    \end{minipage}
    \begin{minipage}{.5\textwidth}
    \centering
        \includegraphics[width=0.3\linewidth]{ej3.png}
        \caption{1}
    \end{minipage}
\end{figure}

\end{block}

\end{frame}
\end{document}

1
  • 2
    You are adding a space between the two minipages and there isn't enough room. Use \end{minipage}% or \end{minipage}\hfill. Commented Dec 12, 2022 at 3:06

1 Answer 1

0

I have noticed this problem (?) in beamer with minipage. If you reduce the width of the pages to be less than 1, it will work.

\documentclass{beamer}
\usetheme{Boadilla}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{frame}{1}

\begin{block}
    1
\begin{figure}
    \begin{minipage}{.45\textwidth}
    \centering
        \includegraphics[width=0.5\linewidth]{example-image-a}
        \caption{1}
    \end{minipage}
    \begin{minipage}{.45\textwidth}
    \centering
        \includegraphics[width=0.5\linewidth]{example-image-b}
        \caption{1}
    \end{minipage}
\end{figure}

\end{block}

\end{frame}
\end{document}

The output looks like this:

enter image description here

Not the answer you're looking for? Browse other questions tagged .