TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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?

share|improve this question

migrated from stackoverflow.com May 29 '12 at 6:33

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Stefan Pinnow, Paul Gaborit, Romain Picot, Papiro, Zarko Apr 15 at 7:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner May 29 '12 at 12:12
up vote 56 down vote accepted

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

share|improve this answer

Does this without any hspace trickery.

share|improve this answer
Very clean code, and solves the need-more-width-for-my-graph problem, so worth a try! – nruth Dec 4 '11 at 2:22
Worked good for me - thanks ;) – Traxdata Apr 20 '12 at 12:04
Excellent, this solved a whole lot more for me! – dorien Jun 22 '13 at 22:31
Where have you been all my life. Why have I been struggling with this for years... – keyser Jan 31 '15 at 12:46
How can I do this in Lyx? – becko May 31 at 22:07

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


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

share|improve this answer

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:


You could also use:

share|improve this answer
Your code snippet worked just fine, thank you for the insight ! The hspace command above didn't work in my case. – Dr1Ku Jun 21 '10 at 20:21
This worked well for me in the case of multiple horizontally distributed \includegraphics in the same figure :) – JorgeGT Mar 8 at 13:27

Found a great simple solution to this problem!


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

share|improve this answer

If you are using the memoir class, the solution is to use


rather than


in your float. This will prevent you from having to manually set the negative horizontal spacing.

Maybe you're not using memoir. Fair enough. \centerfloat is defined thusly, so you can just make your own:

  \parindent \z@
  \leftskip \z@ \@plus 1fil \@minus \textwidth
  \parfillskip \z@skip}
share|improve this answer
\centerfloat works great in memoir class – entropy Mar 21 '13 at 12:02

The automated version of Ian's answer might look like this:


share|improve this answer