};
// Keep the changes documented in the Customization manual.
-int const FORMAT = 21;
+int const FORMAT = 24;
bool layout2layout(FileName const & filename, FileName const & tempfile)
FT_WITHIN,
FT_STYLE,
FT_LISTNAME,
- FT_BUILTIN,
+ FT_NEEDSFLOAT,
FT_HTMLSTYLE,
FT_HTMLATTR,
FT_HTMLTAG,
+ FT_LISTCOMMAND,
FT_END
};
{ "htmlattr", FT_HTMLATTR },
{ "htmlstyle", FT_HTMLSTYLE },
{ "htmltag", FT_HTMLTAG },
- { "latexbuiltin", FT_BUILTIN },
+ { "listcommand", FT_LISTCOMMAND },
{ "listname", FT_LISTNAME },
+ { "needsfloatpkg", FT_NEEDSFLOAT },
{ "numberwithin", FT_WITHIN },
{ "placement", FT_PLACEMENT },
{ "style", FT_STYLE },
string htmlstyle;
string htmltag;
string listName;
+ string listCommand;
string name;
string placement;
string style;
string type;
string within;
- bool builtin = false;
+ bool needsfloat = true;
bool getout = false;
while (!getout && lexrc.isOK()) {
style = fl.style();
name = fl.name();
listName = fl.listName();
- builtin = fl.builtin();
+ needsfloat = fl.needsFloatPkg();
+ listCommand = fl.listCommand();
}
break;
case FT_NAME:
lexrc.next();
style = lexrc.getString();
break;
+ case FT_LISTCOMMAND:
+ lexrc.next();
+ listCommand = lexrc.getString();
+ break;
case FT_LISTNAME:
lexrc.next();
listName = lexrc.getString();
break;
- case FT_BUILTIN:
+ case FT_NEEDSFLOAT:
lexrc.next();
- builtin = lexrc.getBool();
+ needsfloat = lexrc.getBool();
break;
case FT_HTMLATTR:
lexrc.next();
}
}
- // Here if have a full float if getout == true
+ // Here we have a full float if getout == true
if (getout) {
+ if (!needsfloat && listCommand.empty())
+ LYXERR0("The layout does not provide a list command " <<
+ "for the builtin float `" << type << "'. LyX will " <<
+ "not be able to produce a float list.");
Floating fl(type, placement, ext, within, style, name,
- listName, htmltag, htmlattr, htmlstyle, builtin);
+ listName, listCommand, htmltag, htmlattr, htmlstyle,
+ needsfloat);
floatlist_.newFloat(fl);
// each float has its own counter
counters_.newCounter(from_ascii(type), from_ascii(within),
{
if (html_toc_section_.empty()) {
// we're going to look for the layout with the minimum toclevel
- // number > 0, because we don't want Part.
- // we'll take the first one, just because.
TextClass::LayoutList::const_iterator lit = begin();
TextClass::LayoutList::const_iterator const len = end();
int minlevel = 1000;
Layout const * lay = NULL;
for (; lit != len; ++lit) {
int const level = lit->toclevel;
- if (level > 0 && (level == Layout::NOT_IN_TOC || level >= minlevel))
+ // we don't want Part
+ if (level == Layout::NOT_IN_TOC || level < 0 || level >= minlevel)
continue;
lay = &*lit;
minlevel = level;