7

I'm trying to do exactly what's explained here:

Figure with two side-by-side subfigures that is wider than textwidth

However, I'm working with a large document and already have many subfigures using \usepackage[hang]{subfigure}. If I change to the subcaption package, I would have to change all my other figures and that's too much work. How do I use the lipsum package and \makebox command in conjunction with the subfigure package?

6

The techniques explained at the linked answer work with subfigure package also.

\documentclass{article}
\usepackage{graphicx,showframe}   %% remove showframe
\usepackage[hang]{subfigure}
\begin{document}

\begin{figure*}
\makebox[\linewidth][c]{%
\centering
\subfigure[Caption]{\label{fig:a}\includegraphics[width=0.35\textwidth]{example-image-a}}%
\subfigure[Caption]{\label{fig:b}\includegraphics[width=0.35\textwidth]{example-image-b}}%
\subfigure[Caption]{\label{fig:c}\includegraphics[width=0.35\textwidth]{example-image-c}}%
}
\caption{my caption}
\end{figure*}
\end{document}

enter image description here

You can also use adjustbox package.

\documentclass{article}
\usepackage{graphicx,showframe}
\usepackage{subfigure}
\usepackage{adjustbox}
\begin{document}

\begin{figure*}
\begin{adjustbox}{max width=1.2\linewidth,center}
\centering
\subfigure[Caption]{\label{fig:a}\includegraphics[width=0.35\textwidth]{example-image-a}}%
\subfigure[Caption]{\label{fig:b}\includegraphics[width=0.35\textwidth]{example-image-b}}%
\subfigure[Caption]{\label{fig:c}\includegraphics[width=0.35\textwidth]{example-image-c}}%
\end{adjustbox}
\caption{my caption}
\end{figure*}
\end{document}

Here the content will be resized only if it exceeds 1.2\linewidth. adjustbox also provides many other goodies. For details, refer to its documentation.

PS. subfigure is deprecated and it is better to change over to subcation or subfig.

  • Is it also possible to add line breaks (\\ ) between the subfigures inside an adjustbox? – Karlo Jan 23 '17 at 11:57

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.