views:

6392

answers:

4

I have a fairly large figure in a LaTeX document. This figure is too large for the left and right margin of the document. This results in the figure being placed flush with the left margin, and way beyond the right margin. What I want is to do, is center the figure on the page. Can I do this, e.g. by setting a different left margin for this figure?

+4  A: 

If the figure is an external graphics, then do like this:

\begin{figure}
  \begin{center}
   \includegraphics[width=\textwidth]{...}
  \end{center}
\end{figure}

\textwidth will stretch it to full text width. You can specify a coefficient like, for example, 0.75 of the text width:

\includegraphics[width=0.75\textwidth]{...}
zilupe
+7  A: 

If the figure is e.g. 3 inches too wide, add a negative space of half that before the figure:

\hspace*{-1.5in}
\includegraphics{...}
Jouni K. Seppänen
+1  A: 

-The above did not work for me as I wanted the figure wider than the caption. Also, I think there is a override by the endfloat package.

-This will leave the entire document intact and only alter the figure:

\begin{figure}

\advance\leftskip-4cm
\includegraphics[options]{location}

\end{figure}

-You could also use:

\advance\rightskip-2cm

kind regards,

Ian Gregory Sydney Uni, Maths.

Your code snippet worked just fine, thank you for the insight ! The hspace command above didn't work in my case.
Dr1Ku
A: 

Found a great simple solution to this problem!

\documentclass[a4paper,10pt]{article} \usepackage{graphicx} \begin{document} \begin{figure} \noindent\makebox[\textwidth]{% \includegraphics[width=1.4\textwidth]{mypic}} \end{figure} \end{document}

I found this solution here: http://texblog.net/latex-archive/layout/centering-figure-table/#comment-875

Mark