Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

PlacingFiguresAndProducingLegends

<< | Page list | >>

How to treat long legends and big figures with the nonfloat package.

Large figures and long legends

The usual way to produce a figure with a legend is described in the tutorial. Shortly, one creates a float, imports the figure (best works encapsulated postscript) and describes this figure above or below it.

There are several problems for a beginner when doing that

  • producing a encapsulated postscript is not that easy as it sounds, especially when coming from the windows world.
  • using a float works great when the figures are small and the legend does not contain a longer text. But if the figure is large and the text long, the result is less than desirable: the legend just ignore the margins und overlaps the page number.

To circumvent these problems, one possibility is to use the following approach:

Use a good program to create the figures. Microcal Origin (tm), as an example for scientific software , produce extremly bad .eps. xmgrace works far better. Anyway, most of the .eps issues (mainly bounding box) from Origin (and other programs) can be fixed when using the tool fixbb.sh (available from http://www.gnuplot.info/scripts/index.html). When very big figures (as used in biological sciences and human sciences) with a long legend are used, it works better not to use a float, but install the package "nonfloat" and use some latex code.

  1. Get and install "nonfloat" (search it on the MiKTex Package Manager (Admin), you probably have it already installed for you)
  2. write \usepackage{nonfloat} in latex preamble (Document --> Settings... -> Latex preamble
  3. Place the figure where you want to have it (Insert --> Graphics)
  4. Use the following latex code, placed in an ERT enviroment (insert TeX code or CTRL-L)
  5. Write

\figcaption[short title for the index]{description for your figures}

That's it. You will notice that latex will do a page break to correctly place the legends. Formatting the legends is done via the package "caption2".

When using latex code, one has to be carefull not to use accidentally latex special characters. For example using "%" does not work in ERT, place \% to prevent latex to read it as a control sequence.

EDIT (01/02/2009): After the graphics' insertion, things didn't work out as expected. One of the pictures I inserted was on one page and the caption (legend for the picture) appeared on the other page. Also, I usually insert citations on the descriptions or labels to reference them. If I use TeX code, I only can place them one line after the graphics' description. Which leaves me no choice, I can't use this method.

Instead of inserting Graphics, I use Insert --> Float --> Figure (or Figure Wrap Float). When searching for the solution to eliminate the floating of my figures, I have noticed that if you right click on the Grey rectangle after inserting the Graphic ("float: Figure" or "wrap:Figure"), a pop-up menu appears where you can go to Settings and define the placement of your Figure on the page. This is the best way to handle figures. Not hard-coded and simple. float figures still

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2010-01-02 19:58 UTC