2

I have three square images, i want to arrange in a particular pattern, centered onto a beamer-slide. One big image and two smaller images next to it, which are stacked onto each other, like such:

enter image description here

But, as you can see, they are off-center and i actually can not get it to work. I tried different arrangements of subfigures and added centeringin presumably any possible position.

So, is there something, i am missing? What would be the easiest way of centering this figure?

MWE:

\PassOptionsToPackage{draft}{graphicx}
\documentclass{beamer}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup{compatibility=false}

\begin{document}

\begin{frame}
\centering
\begin{figure}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{1.jpg}
    \end{subfigure}%
          \begin{subfigure}[b]{0.49\textwidth}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{2.jpg}
    \end{subfigure}\\
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{3.jpg}
    \end{subfigure}
        \end{subfigure}
    \caption{Pictures}    
\end{figure}
\end{frame}

\end{document}

1 Answer 1

3

You're missing the fact that you place two 0.49\textwidth wide boxes (subfigures) next to each other, and that the two inner boxes (subfigures) are half this width again, and placed flush left in the outer box. Make the second outer subfigure 0.245\textwidth instead, and the inner ones \textwidth.

That said, as long as you're not actually adding any subcaptions, I'd remove all the subfigure environments, and use single minipage for the two images on the right.

The \centering should go inside the figure environment.

\PassOptionsToPackage{draft}{graphicx}
\documentclass{beamer}

\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup{compatibility=false}

\begin{document}

\begin{frame}
\frametitle{To illustrate the problem}

\begin{figure}
\centering
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{1.jpg}
    \end{subfigure}%
          \fbox{\begin{subfigure}[b]{0.49\textwidth}
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{2.jpg}
    \end{subfigure}\\
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{3.jpg}
    \end{subfigure}
        \end{subfigure}}
    \caption{Pictures}    
\end{figure}
\end{frame}

\begin{frame}
\frametitle{One fix}

\begin{figure}
\centering
    \begin{subfigure}[b]{0.49\textwidth}
        \includegraphics[width=\textwidth]{1.jpg}
    \end{subfigure}%
          \begin{subfigure}[b]{0.245\textwidth}
    \begin{subfigure}[b]{\textwidth}
        \includegraphics[width=\textwidth]{2.jpg}
    \end{subfigure}\\
    \begin{subfigure}[b]{\textwidth}
        \includegraphics[width=\textwidth]{3.jpg}
    \end{subfigure}
        \end{subfigure}
    \caption{Pictures}    
\end{figure}
\end{frame}

\begin{frame}
\frametitle{Less environments}

\begin{figure}
\centering
\includegraphics[width=0.49\textwidth]{1.jpg}
\begin{minipage}[b]{0.245\textwidth}
        \includegraphics[width=\textwidth]{2.jpg}\\
        \includegraphics[width=\textwidth]{3.jpg}
\end{minipage}
\caption{Pictures}    
\end{figure}
\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

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