LyXHow to make a picture center

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
parmenides
Posts: 5
Joined: Sun Aug 22, 2010 4:37 am

How to make a picture center

Post by parmenides »

Hi,

In lyx, I have inserted a picture by calling menu "insert -> graphics". By default, the picture aligns left. I wonder how to make it aligning center. Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to make a picture center

Post by gmedina »

Hi,

in LaTeX you can use the \centering command inside the figure environment, before including the figure. I have no idea how that can be done in LyX, however, since I've never used it.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: How to make a picture center

Post by meho_r »

"Insert > Graphics" will put a picture inside the document as a non-float. To center it all you need to do is to change paragraph properties for the line the picture is in. Place the cursor before or after the picture > right click > Paragraph Settings... (or from menu: Edit > Paragraph Settings...), then set "Alignment" to "Center".
parmenides
Posts: 5
Joined: Sun Aug 22, 2010 4:37 am

Re: How to make a picture center

Post by parmenides »

Thank you very much.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to make a picture center

Post by gmedina »

meho_r wrote:"Insert > Graphics" will put a picture inside the document as a non-float. To center it all you need to do is to change paragraph properties for the line the picture is in. Place the cursor before or after the picture > right click > Paragraph Settings... (or from menu: Edit > Paragraph Settings...), then set "Alignment" to "Center".
Correct me if I wrong, but I read somewhere that using paragraph settings, as you suggested, tantamounts to using a center environment, thus introducing additional (and, in most cases, undesired) vertical space. On the other hand, the \centering command that I recommended doesn't produce the additional spacing; there should be some way to achieve this effect using LyX.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

How to make a picture center

Post by meho_r »

gmedina wrote:
meho_r wrote:"Insert > Graphics" will put a picture inside the document as a non-float. To center it all you need to do is to change paragraph properties for the line the picture is in. Place the cursor before or after the picture > right click > Paragraph Settings... (or from menu: Edit > Paragraph Settings...), then set "Alignment" to "Center".
Correct me if I wrong, but I read somewhere that using paragraph settings, as you suggested, tantamounts to using a center environment, thus introducing additional (and, in most cases, undesired) vertical space. On the other hand, the \centering command that I recommended doesn't produce the additional spacing; there should be some way to achieve this effect using LyX.
Yes, you are right, it is using center environment and using \centering command is a better solution. However, for that one must enter the command as a LaTeX code and pay attention to limit the command to the picture only and... that's LyX ;) In their manual, when explaining graphic stuff, they put an image in a centered paragraph as an example. Nah, just one of many shortcomings of LyX, I guess...
Post Reply