# Define an additional InsetLayout for captions

I want to insert figures in the page margins in my book.

In order to have two figures one above the other, with each one having its own
caption and label, I want to create inside lyx the following latex code:

\usepackge{sidenotes,subcaption} % (<- in the preamble)

\begin{marginfigure}
\centering
\subcaptionbox{caption for upper figure \label{upperfig}}
{\includegraphics[width=\marginparwidth]{image1.png}}

\subcaptionbox{caption for lower figure \label{lowerfig}}
{\includegraphics[width=\marginparwidth]{image1.png}}

\caption{Big Caption for two figures}
\label{fig:physicsfig}
\end{marginfigure}

I copied to my layout the Float Style from tufte-book.layout. It defines a
marginfigure environment.

I am now struggling a bit with the \subcaptionbox command:

1. I can define a new Caption which is based on "InsetLayout Caption:Standard"
found in the stdinsets.inc file. But I can't see it in the Insert menu, not
even inside Custom Insets.

2. Let's say I overcome this issue, is it possible to make it "sensible" only
inside the marginfigure environment?

3. If I don't want captions for the subfigures, then I don't need the
\subcaption command. And then the include graphics doesn't have to be wrapped
with {}. But if I change my mind and want a caption, then I do need the {}
around the figure. Any idea how to handle it nicely?

Thanks very much!
--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users