Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I currently have a graph that uses subfigures as follows:

\begin{figure}[!htbp]        
        \centering
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure1.eps}
                \caption{}
        \end{subfigure}%
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure2.eps}
                \caption{}
        \end{subfigure}%       
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure3.eps}
                \caption{}
        \end{subfigure}%
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure4.eps}
                \caption{}
        \end{subfigure}%
        \FigureCaptionOpt{caption}{captionCopy}
\end{figure}

As you probably noticed, it overflows the text, since each of the images is 0.3\textwidth and there are 4 images. Now, the whole thing is not centered, instead, it is aligned with the left margin and it overflows the right margin. Essentially, I want to shift it to the left, so that it overflows both margins by the same amount, while maintaining the sizes I specified in the command above.

share|improve this question
    
Welcome to TeX.SX. –  Claudio Fiandrino Jan 30 '13 at 16:03
add comment

3 Answers

You can just the adjustwidth environment from the changepage package

 \begin{adjustwidth}{<left margin offset>}{<right margin offset>}     

I've demonstrated in the MWE below:

screenshot

I loaded the geometry package with showframe=true just for demonstration, and the demo option for the graphicx package because I don't have your images- remove for the actual document.

\documentclass{article}

\usepackage[showframe=true]{geometry}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{changepage}

\begin{document}
\begin{figure}[!htbp] 
            \begin{adjustwidth}{-1cm}{1cm}     
        \centering
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure1.eps}
                \caption{}
        \end{subfigure}%
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure2.eps}
                \caption{}
        \end{subfigure}%       
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure3.eps}
                \caption{}
        \end{subfigure}%
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure4.eps}
                \caption{}
        \end{subfigure}%
        \end{adjustwidth}
        \caption{My caption}
\end{figure}

\end{document}
share|improve this answer
add comment

I've had good success with the subfig package. I use it as follows:

\begin{figure}[htbp]
    \centering
    \subfloat[][Caption a\label{fig:subfiga}]{\includegraphics[width=FOO]{imagea.eps}}
    \qquad
    \subfloat[][Caption b\label{fig:subfigb}]{\includegraphics[width=FOO]{imageb.eps}}
    \\
    \subfloat[][Caption c\label{fig:subfigc}]{\includegraphics[width=FOO]{imagec.eps}}
    \qquad
    \subfloat[][Caption d\label{fig:subfigd}]{\includegraphics[width=FOO]{imaged.eps}}
    \caption{Main Caption}
    \label{fig:MainLabel}
\end{figure}

Note I use \qquad for separation and \\ for forced line breaks. You can play with how you space and break the images up, but this should give you a good start. Note that each line is centered, so in this case, "image \qquad image" is centered.

Hope this helps!

share|improve this answer
add comment

Without any extra package, you can use \makebox to cheat latex:

\makebox[0pt][c]{<content>}

Code:

\documentclass{article}

\usepackage[showframe=true]{geometry}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
%\usepackage{changepage}

\begin{document}

\begin{figure}[!htbp] 
%            \begin{adjustwidth}{-1cm}{1cm}     
        \centering
\makebox[0pt][c]{%
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure1.eps}
                \caption{}
        \end{subfigure}%
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure2.eps}
                \caption{}
        \end{subfigure}%       
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure3.eps}
                \caption{}
        \end{subfigure}%
        \begin{subfigure}[b]{0.3\textwidth}
                \centering
                \includegraphics[width=3.5cm]{figure4.eps}
                \caption{}
        \end{subfigure}%
        }
%        \end{adjustwidth}
        \caption{My caption}
\end{figure}


\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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