12

I have a 2x2 array of subfigures and the ideal size I'd like them at is a bit wider than the textwidth. I saw this solution for a single figure (Custom margin settings for figure in LaTeX) but am not sure how to adapt it for subfigures.

edit: a 1x2 example of the way I'm building my subfigures

\begin{figure}[ht!]
\centering
\begin{subfigure}[b]{6cm}
    \centering
    \includegraphics[width=6cm]{...}
\end{subfigure}
\quad
\begin{subfigure}[b]{6cm}
    \centering
    \includegraphics[width=6cm]{...}
\end{subfigure}
\end{figure}
22

You can use a \makebox for each row of subfigures (change the lengths to suit your needs):

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{lipsum}

\begin{document}

\lipsum[2]
\begin{figure}
\makebox[\linewidth][c]{%
\begin{subfigure}[b]{.6\textwidth}
\centering
\includegraphics[width=.95\textwidth]{image1}
\caption{a test subfigure}
\end{subfigure}%
\begin{subfigure}[b]{.6\textwidth}
\centering
\includegraphics[width=.95\textwidth]{image2}
\caption{a test subfigure}
\end{subfigure}%
}\\
\makebox[\linewidth][c]{%
\begin{subfigure}[b]{.6\textwidth}
\centering
\includegraphics[width=.95\textwidth]{image3}
\caption{a test subfigure}
\end{subfigure}%
\begin{subfigure}[b]{.6\textwidth}
\centering
\includegraphics[width=.95\textwidth]{image4}
\caption{a test subfigure}
\end{subfigure}%
}
\caption{A figure with four subfigures}
\end{figure}

\end{document}

enter image description here

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.

  • This also works for forcing subfigures into a certain row of the figure. – dinosaur Nov 18 '16 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.