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

I have 2 questions:

  1. I am trying to center a figure in LaTeX, but above a certain size it just starts at the left margin and goes beyond the right. How can I make it actually center, so the amount it goes over the left margin is the same as the right?

  2. Some short lines justify to fill the whole page width, which makes it look really bad. Is there a way I can fix these lines, or maybe set the width for justification to be considered?

Thanks in advance.

share|improve this question
up vote 41 down vote accepted
  1. \centerline{\includegraphics{foo}}

  2. Can you provide an example? You can use \raggedright or even ragged2e package to control the paragraph. However, I wonder how the short lines fill the whole page width.

share|improve this answer
Thank you, these both worked perfectly! The line in question was "when one interprets them.". I simply surrounded it in raggedright and it worked. Is there a more permanent solution, though? – Anonymous Jan 10 '11 at 5:44
It is hard to figure out what problem you're having with (2). It's completely unclear what "a more permanent solution" would be like. That's why Leo wanted an example. – frabjous Jan 10 '11 at 17:42

Re: 1.: I've been using this excellent tip by Stefan Kottwitz for very large figures in my PhD-Thesis. Essentially, it boils down to using a

  very wide figure or very wide table%

around your figure- or table-code.

share|improve this answer

Another possible solution is to use a picture environment and then \put the included graphic way left:

    \begin{picture}(1,0.5)%in case your image is twice as wide as it is high
                          %(otherwise change the 0.5 to your file's height/width).
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.