29

It seems like this question gets asked a lot but with everything I have come across I was not able to figure out how to solve me problem. I have 3 figures side by side in a tabular environment and I want to be able to shift all 3 figures to the left in order to fit them on the page (right now the figures go off the page to the right). I am using the article format so there is plenty of white space to the left of the figures that I would like to utilize. here is my latex code

\begin{figure}[htbp]
  \centering
  \begin{tabular}{ccc}                                                            
   \includegraphics[scale=0.35]{MEAInitialProb1.pdf}&                
    \includegraphics[scale=0.35]{MEA10Prob1.pdf}&             
    \includegraphics[scale=0.35]{MEA20Prob1.pdf}                               
  \end{tabular}
  \caption{Caption}
  \label{fig:Prob1:MEA}
\end{figure}
user6291
  • 454
  • 2
  • 5
  • 9
  • 1
    The set of figures inside the tabular is wider than \textwidth, I presume. As such, they get shifted to the right. Centering them when in such an instance is covered in Center figure that is wider than \textwidth. The solution is to place the entire tabular inside a \makebox[\textwidth]{...} construction. – Werner Jun 11 '14 at 22:20
  • Instead of \centering try \hss, and add another \hss\par after \end{tabular}. However, it would be preferable to reduce the size of the figures, since what happens is that they don't fit in the margins. – JLDiaz Jun 11 '14 at 22:21
  • @JLDiaz I get this error: ! Infinite glue shrinkage found in a paragraph. – user6291 Jun 11 '14 at 22:23
  • @Werner your solution using \makebox[\textwidth]{...} worked! – user6291 Jun 11 '14 at 22:25
  • @JLDiaz \hss is not legal in a paragraph, just in an \hbox. – egreg Jun 11 '14 at 22:25
  • @egreg, StatMan Woops. This is what happens when answering with untested code :-} – JLDiaz Jun 11 '14 at 22:26
  • @StatMan: The solution I proposed is completely covered in the linked question, making this a duplicate, so I'm voting to close it as such. It's good to keep this question here are a signpost for future visitors. – Werner Jun 11 '14 at 22:34

1 Answers1

50

the table environment isn't really doing anything other than add a bit of space, you could use

 \hspace*{-2cm}\begin{tabular}....

But I would just do

    \begin{figure}[htbp]
\hspace*{-2cm}                                                           
   \includegraphics[scale=0.35]{MEAInitialProb1.pdf}%
\hspace{2mm}%                
    \includegraphics[scale=0.35]{MEA10Prob1.pdf}% 
\hspace{2mm}%             
    \includegraphics[scale=0.35]{MEA20Prob1.pdf}                               

  \caption{Caption}
  \label{fig:Prob1:MEA}
\end{figure}

adjusting the widths to suit.

David Carlisle
  • 757,742
  • 2
    I wouldn't do that... I'll use \makebox[\textwidth]{...}, as suggested in the linked duplicate. – Werner Jun 11 '14 at 22:32
  • 4
    @Werner it's free world make another answer and let the OP choose:-) Trouble with makebox..is that it centres perfectly mathematically but if you are stealing space from the margin you might want to take judgement depending on size of each margin and relative blackness of the images and .... – David Carlisle Jun 11 '14 at 22:44
  • @DavidCarlisle, I am new to Latex, could you please explain what does [htbp] mean? And what package is required to implement this code ? – Student Jun 16 '16 at 14:11
  • How would you move an image down? – David G Mar 18 '22 at 20:23
  • 1
    @DavidG please don't ask questions as comments on old answers, but use vspace instead of hspace – David Carlisle Mar 18 '22 at 21:06