LyXFormatting legends

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

Formatting legends

Post by sulaj »

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!!

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

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Formatting legends

Post by cgnieder »

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:

Code: Select all

\usepackage{caption}
\captionsetup{font=footnotesize}
Then you will get captions with a font size corresponding to footnotes.

Regards
site moderator & package author
sulaj
Posts: 5
Joined: Wed Dec 05, 2012 1:32 pm

Formatting legends

Post by sulaj »

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: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Formatting legends

Post by cgnieder »

That's easily possible by changing the lines to

Code: Select all

\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
site moderator & package author
sulaj
Posts: 5
Joined: Wed Dec 05, 2012 1:32 pm

Formatting legends

Post by sulaj »

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
Post Reply