Re: Side Caption Insets for Memoir

2011-03-10 Thread Rob Oakes
Dear LyX Developers and Users,

> I'm trying to create custom insets and environments for the document class 
> features. One environment that has me stumped though, is how to create an 
> inset for the memoir "sidecaption" feature.
> 
> The sidecaption environment allows you to typeset the caption of your figure 
> in the margin (similar to the way that the Tufte handout and book classes 
> work), and the style guide for this class calls for their use. This is how an 
> example in LaTeX would work.

So I need to RTFM a little more often. After a bit of head scratching, I've 
been able to create a workable Side Caption style. You simply place it inside 
of the figure or table float and then use the Opt inset to add the caption. 
Very smooth and easy to use, and I'm quite happy.

Here's the definition I used:

Style Side_Caption
CategorySpecial_Commands
Margin  Static
LatexType   Environment
LatexName   sidecaption
NextNoIndent1
TopSep  0.5
ParSep  0.5
BottomSep   0.5
Align   Block
AlignPossible   Block, Left, Right, Center
LabelType   No_Label
HTMLTag sidecaption
HTMLItemp
RequiredArgs1
End

I've had a questions come up, though:

I'm not very happy telling a user to go to "Insert > Short Title" in order to 
add a caption. This seems confusing, from a usability standpoint. I would 
prefer to have a custom inset that they can add that says 
"Custom:Side_Caption". Is there any way to create a custom "opt" inset? Even 
after RTFMing, I was not able to find one.

Thoughts would be appreciated.

Cheers,

Rob

Side Caption Insets for Memoir

2011-03-09 Thread Rob Oakes
Dear LyX Developers and Users,

For the past couple of days, I've been working on a custom LaTeX document class 
for a non-profit. It is based on memoir, and while it is still a work in 
progress, I'd like to think that it is rather awesome.

Because the final goal is to use this document class in LyX (version 2.0, they 
have already downloaded and started using the release candidate), I'm trying to 
create custom insets and environments for the document class features. One 
environment that has me stumped though, is how to create an inset for the 
memoir "sidecaption" feature.

The sidecaption environment allows you to typeset the caption of your figure in 
the margin (similar to the way that the Tufte handout and book classes work), 
and the style guide for this class calls for their use. This is how an example 
in LaTeX would work.

\begin{figure}
\begin{sidecaption}{A typical learning center in Mexico City.}
\resizebox*{\textwidth}{!}{\includegraphics{learning1.jpg}}
\end{sidecaption}
\end{figure}

Does anyone have any ideas on how I could create an inset that captures all of 
this information? The tricky bit seems to be that the caption is specified in 
the \begin{sidecaption} statement, rather than as a \caption command. I know 
that LyX 2 now supports creating insets for optional arguments, but I'm not 
entirely sure how I could use that to solve this difficulty.

I'd greatly appreciate any thoughts. (Also, if it works, this would be a very 
nice addition to the memoir layout that currently ships with LyX 2. Would it be 
too late to incorporate it?)

Cheers,

Rob