On Wednesday 03 March 2010 04:58:19 pm rgheck wrote:
> On 03/03/2010 04:48 PM, Manoj Rajagopalan wrote:
> > Hi lyx-devel,
> >
> > I am building a layout for the new REVTeX 4.1 document class and the
> > associated revtex4-1.cls defines a new float-type called video. It
> > therefore makes available the \listofvideos command which should list all
> > videos much like \listoftables and \listoffigures.
> >
> > I am attaching the .layout file where I have created a new video
> > float and have assigned ListName = "List of Videos". As expected, this
> > shows up in Insert -> List/TOC and clicking this also inserts the
> > expected inset. But the latex source shows "%% unknown builtin inset".
> > The failure is being caused in InsetFloatList::latex() which only checks
> > for float-inset type "table" and "figure".
>
> I'm not sure exactly how this is handled, but I'd check how the list of
> algorithms works. Isn't that done the same way, basically?
>
> rh
My bad: actually, lyx does in fact successfully parse the documentclass. Only,
during latex export, it doesn't allow any \listof<float>s except for table
and figure - at this point in InsetFloatList::latex(), these are the only two
builtin floats.
But the Customization manual describes the LaTeXBuiltin parameter for custom
floats to be true if the documentclass defines the float - if not, LyX will
emit latex code to define the new float.
Therefore, all floats defined by the documentclass should be allowed to emit
\listof<float>s as built-ins if this command is defined. Currently, LyX even
performs this check. I am attaching a patch that fixes this problem. Requires
only one additional line.
Patch created from within src/insets
I have tested this with my REVTeX 4.1 layout and it works fine: the
\listofvideos is properly emitted.
Thanks,
Manoj
Index: InsetFloatList.cpp
===================================================================
--- InsetFloatList.cpp (revision 33612)
+++ InsetFloatList.cpp (working copy)
@@ -128,6 +128,7 @@
os << "\\listoffigures\n";
} else {
os << "%% unknown builtin float\n";
+ os << "\\listof" << type.c_str() << "s\n";
}
} else {
os << "\\listof{" << getParam("type") << "}{"