Isaac Pante wrote:
Hello everybody!
I know you have already answered at this question, but all the answers
didn't worked for me. I'm trying to center a PDF image in my document.
I made a floatting box, and tried to change the "paragraph" alignement
setting to "center". But Lyx won't do it.
Lyx can center images within the margins, assuming you set up
the centering _inside_ that floating box. (Don't turn on
centering before making the float. Instead, put the cursor
next to the image inside the float and apply centering.)
What is very strange is the fact that the legend is perfectly
centered, but not the image. I also tried with a BMP image, but with
the same result. Here is what I get:
http://isaacpante.net/problem.png
As others have pointed out already, the image is too large. Therefore it
doesn't get centered. There is no space left, so it is aligned with the
left margin and breaks through the right one. (Centering is
done by distributing leftover space on both sides of the image,
in this case there were no leftover space.)
It is possible to use latex commands to achieve "centering" in such a
way that the image breaks equally much through the left and the right
margin. But do you really want that? It tends to be ugly.
What I do, is to resize such big images so they fit perfectly between
the margins. This is easy in lyx, click on the image to get the
graphichs dialog, and change the output width to 100 line%.
That way, the width of the image will be exactly the width of the line,
and it will be beautifully flush with both margins. No ugly breaking
through either margin, and perfectly centered too of course.
Helge Hafting