LaTeX forum ⇒ LyXFigure alignment

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
chriskue
Posts: 1
Joined: Wed Oct 16, 2013 10:23 am

Figure alignment

Postby chriskue » Wed Oct 16, 2013 10:31 am

I am having trouble with align figures to the center of a page. I want to have them slightly broader than the text, i.e. an overhang to both sides of the page. I have tried using wrap figure-float, but this always puts some text next to the picture, which is not desired and looks senseless.
I also tried to increase the width to 120% textwidth. This works fine, but the overhang is only on the left side of the page, even when setting the Paragraph Style to center.
I am using the book class. Is it possible that this causes problems?

Tags:

scottkosty
Site Moderator
Posts: 531
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Wed Oct 16, 2013 7:14 pm

One way is to use ERT to wrap your figure in \centerline{}
To do this, make an ERT before your figure with \centerline{
and then another ERT after your figure with }

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Fri Oct 18, 2013 6:24 pm

[quote="scottkosty"]One way is to use ERT to wrap your figure in \centerline{}.

\centerline is not a recommended LaTeX command... The alternatives usually are putting \centering inside the {figure} environment (which I assume LyX's center option does?) or if the figure is non-floating (i.e. no {figure} putting the whole thing in a {center} environment.

Both should work and if they don't a Infominimal working example (MWE) is needed to see what happens...

I often encountered the case that people thought their images weren't centered when in fact they were but had uneven white margins on the different sides... No way to know without MWE.
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

scottkosty
Site Moderator
Posts: 531
Joined: Sat Sep 01, 2012 6:38 am

Postby scottkosty » Fri Oct 18, 2013 6:57 pm

cgnieder wrote:
scottkosty wrote:One way is to use ERT to wrap your figure in \centerline{}.


\centerline is not a recommended LaTeX command... The alternatives usually are putting \centering inside the {figure} environment (which I assume LyX's center option does?) or if the figure is non-floating (i.e. no {figure} putting the whole thing in a {center} environment.


Good to know. It's nice to have LaTeX experts around here to correct my sloppy habits.

cgnieder wrote:I often encountered the case that people thought their images weren't centered when in fact they were but had uneven white margins on the different sides... No way to know without MWE.


This is indeed what I think is the case here. But yes, an MWE is always useful.


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 5 guests