Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

SubfiguresAndCrossReferences

Categories: Tips, Figures
<< | Page list | >>

Subfigures And Cross-references

Lyx 1.6 has built in support for subfigures by consecutively insert float figure.

Lyx 1.3 has limited support for subfigures and cross referencing of them. But it is doable with a little latex in the figure. This lets you use the normal cross reference mechanism in lyx, that is the "insert label" and "insert cross reference" menus.

There is also an example, uploads:/Tips/subfiguresAndCrossReferences/example.lyx, with accompanying figure, uploads:/Tips/subfiguresAndCrossReferences/platypus.eps.

Solution

Add \usepackage{subfigure} to the preamble and create a figure float. Insert all the graphics (or whatever) into the float, but don't check the subfigure checkbox. Instead, insert the following ERT before each graphic:

\subfigure[subfigurecaption]{

and after the graphic, insert this piece of ERT:

}

For each subfigure there will now be two ERT-insets, but feel free to merge adjacent ERT-insets when there are several, i.e.

}\subfigure[nextfigurecaption]{

Now for the labels. Simply Insert→label beside each graphic, that is between the \subfigure[caption]{ and the } insets. This will work because LaTeX knows what to do with a label inside a \subfigure, even if LyX doesn't.

Whenever you need a cross reference, simply do insert→cross reference%.

Another advantage of this approach is that it works with subfigures that aren't graphics, such as subfigures made up of math symbols, plain text, a table, external inset or anything.

Note: Be sure to insert the subfigures above the "Figure #:" line. To do this, hit Enter with the cursor immediately after "Figure #:". This will jump the cursor to the line above (This is non-obvious and non-intuitive). If the figure numbers generated by cross references are one too high, you've probably inserted the subfigures after the "Figure #:" line.

Tips Figures

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2009-01-29 13:33 UTC