2

I have an image in the document the problem is that when I insert it I have 5cm on the left and 0 on the right (the border is 5cm) I would like to center it.

I tried

\begin{figure}[h]
\centering
\includegraphics{image.jpg}
\end{figure}

and I even tried

\hfill\includegraphics[width=200mm]{image.jpg}\hspace*{\fill}

and even \begin{center} but the picture is still not symmetric and I have a lot of space on the left but none on the right. I even tries \centerline{\includegraphics{foo}} but it gives me an error.

In other words I would like the image to ignore the margin.

Could you help me?

user25954
  • 155
  • Welcome to Tex.SE. How wide is the image, and how wide is the textblock? – Mico Jan 03 '17 at 15:08
  • The image is 200mm and textblock is 170mm – user25954 Jan 03 '17 at 15:09
  • 3
    http://tex.stackexchange.com/questions/16582/center-figure-that-is-wider-than-textwidth – Torbjørn T. Jan 03 '17 at 15:11
  • Yes, the box trick worked. Thanks a lot. However, it would be interesting to know if there are other solutions that do not require the box. – user25954 Jan 03 '17 at 15:14
  • Such as the adjustbox version? Or the second or third answer to that question? Or \hspace*{-1.5cm} right before your \includegraphics, for a bad solution. – Torbjørn T. Jan 03 '17 at 15:26
  • The problem is that with the box it happens that I find it in the wrong section – user25954 Jan 03 '17 at 16:25
  • That's a different thing altogether (and I'm surprised that \makebox changed the behaviour of the positioning). See http://tex.stackexchange.com/questions/279, or http://tex.stackexchange.com/questions/2275 or http://tex.stackexchange.com/questions/8625 for suggestions on enforcing float placement. – Torbjørn T. Jan 04 '17 at 21:34

0 Answers0