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.

3 Answers 3

  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.

  • 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, 2011 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, 2011 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.


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).

You must log in to answer this question.