LaTeX forum ⇒ LyXFormatting legends Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
sulaj
Posts: 5
Joined: Wed Dec 05, 2012 1:32 pm

Formatting legends

Postby sulaj » Wed Dec 05, 2012 1:57 pm

Hi

I have some formatting issues with my report: I would like that the legends text is smaller than the "normal" text. If I highlight my legend text, chose text style/personalised and make it smaller, it works, but the legend name ("figure x.y") still stays the big size. How can I make the figure name smaller too??

In addition, I wonder if it's possible to make bigger margins for the legend, so that the legend would appear for example 1 cm further in the middle than the normal text.

Hope you understand what I mean, my English is not perfect.

Thank's for your help!!

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

Postby cgnieder » Wed Dec 05, 2012 11:42 pm

What you mean with “legend” is called “caption”. I do not know if LyX has a built-in way to change the caption layout but you can use the caption package for this. Go to Document -> Settings... -> LaTeX Preamble and add the following lines there:

  1. \usepackage{caption}
  2. \captionsetup{font=footnotesize}


Then you will get captions with a font size corresponding to footnotes.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

sulaj
Posts: 5
Joined: Wed Dec 05, 2012 1:32 pm

Postby sulaj » Thu Dec 06, 2012 10:12 am

Great, this worked very well – caption font size problem solved. Thank's a lot!!

Remains the 2nd problem: does anyone one know if it's possible to move the caption further into the document, for example:

text text text text text text text text text text text text text text text

text text text text text text text text text text text text text text text

    My graph

    caption caption caption caption caption caption caption
    caption caption caption caption caption caption caption

text text text text text text text text text text text text text text text

text text text text text text text text text text text text text text text


Thank's for your help!

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

Postby cgnieder » Thu Dec 06, 2012 12:36 pm

That's easily possible by changing the lines to

  1. \usepackage{caption}
  2. \captionsetup{font=footnotesize,margin={.25\textwidth,0pt}}


This would set the captions width to 75 % of the textwidth shifted to the right. For more customization possibilities you should read the caption manual.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

sulaj
Posts: 5
Joined: Wed Dec 05, 2012 1:32 pm

Postby sulaj » Thu Dec 06, 2012 5:37 pm

Great, thank's a lot! With the command
\usepackage[margin=30pt, font=normal, labelfont=bf, labelsep=endash]{caption}
I was able to make my caption look like I wanted.

Greetings


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 2 guests