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?
|
migrated from stackoverflow.com May 29 '12 at 6:33
|
If the figure is e.g. 3 inches too wide, add a negative space of half that before the figure:
|
|||
|
|
Does this without any hspace trickery. |
|||||
|
|
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:
|
|||
|
|
|
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 This will leave the entire document intact and only alter the figure:
You could also use:
|
|||
|
|
Found a great simple solution to this problem!
I found this solution here: http://texblog.net/latex-archive/layout/centering-figure-table/#comment-875 |
|||
|
|
|
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.
|
||||
|
|
|
The automated version of Ian's answer might look like this:
|
|||
|
|