## LaTeX forum ⇒ LyX ⇒ Formatting 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

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.

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 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:

`\usepackage{caption}\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
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

cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm
That's easily possible by changing the lines to

`\usepackage{caption}\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
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