LyXsubfigures - large captions, small images

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
paradigm
Posts: 3
Joined: Thu May 29, 2008 8:33 pm

subfigures - large captions, small images

Post by paradigm »

Hi (again).

I've set up a float and have put a couple of subfigures with cross-reference labels in it as documented on the LyX wiki. The trouble is that one of the pictures is fairly small, but has a long associated caption. For some reason, it seems the default behaviour is to limit the width of the caption to the width of the picture, which means my caption takes up a lot of vertical space.

Is there an option to set the width of the caption to a specific width?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

subfigures - large captions, small images

Post by Stefan Kottwitz »

Hi,

perhaps the subfigure documentation gives the answer to your question.
By the way it is recommended to use the newer subfig package instead of subfigure.

Stefan
LaTeX.org admin
paradigm
Posts: 3
Joined: Thu May 29, 2008 8:33 pm

subfigures - large captions, small images

Post by paradigm »

Stefan_K wrote:perhaps the subfigure documentation gives the answer to your question.
It doesn't, I've flicked through it and there doesn't seem to be anything helpful in that respect.
Stefan_K wrote:By the way it is recommended to use the newer subfig package instead of subfigure.
As I said, I'm following the instructions on the LyX wiki, although if subfig supports what I want to do I'll happily switch to that, given that I'm doing subfigures in ERT anyway. Does it?

Also, is it possible to centre the caption for normal figures? \centering and \begin{center} \end{center} wrapped around the figure text don't seem to make any difference.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

subfigures - large captions, small images

Post by Stefan Kottwitz »

Hi,
paradigm wrote: Also, is it possible to centre the caption for normal figures? \centering and \begin{center} \end{center} wrapped around the figure text don't seem to make any difference.
That's easy with the caption package, it has a lot of features (including centering) and is very well documented.

Concerning subfigure and subfig I would have to read the documentation too. But not today, I have to go offline soon.

Stefan
LaTeX.org admin
paradigm
Posts: 3
Joined: Thu May 29, 2008 8:33 pm

subfigures - large captions, small images

Post by paradigm »

Thanks for the centering tip, that fixed centering figure captions for me nicely :)

I managed to get the functionality I wanted for subfigures with plenty of ERT - the trick was to use the subfigure environment defined in the package subcaption, rather than the subfigure package itself. This meant I could set the subfigures to have width \linewidth, so the captions spread the entire line.

\begin{subfigure}{\linewidth} \centering
<picture goes here>
\caption{ablah blah blah blah}
<label goes here>
\end{subfigure}

where the code in red is LyX ERT.
Post Reply