\end_inset
, which must be all caps.
+\change_inserted -712698321 1565605014
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted -712698321 1565605014
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1565605014
+Requires
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1565605014
+string
+\end_layout
+
+\end_inset
+
+] As with paragraph styles, see
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:Paragraph-Styles"
+
+\end_inset
+
+.
+\change_unchanged
+
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
+\begin_layout Plain Layout
+Requires
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+] Wie bei Absatz-Layouts, siehe
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:Einzelne-Absatz-Layouts"
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex Code
+status collapsed
+
\begin_layout Plain Layout
Style
\end_layout
# This script will update a .layout file to current format
# The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 79
+currentFormat = 80
# Incremented to format 4, 6 April 2007, lasgouttes
# Incremented to format 79, 7 August 2019 by spitz
# New textclass tag PagesizeFormat
+# Incremented to format 80, 12 August 2019 by spitz
+# New float option Requires
+
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
i += 1
continue
- if format >= 65 and format <= 78:
+ if format >= 65 and format <= 79:
# nothing to do.
i += 1
continue
string const & listName, std::string const & listCmd,
string const & refPrefix, std::string const & allowedplacement,
string const & htmlTag, string const & htmlAttrib,
- docstring const & htmlStyle, bool usesfloat, bool ispredefined,
+ docstring const & htmlStyle, string const & requires,
+ bool usesfloat, bool ispredefined,
bool allowswide, bool allowssideways)
: floattype_(type), placement_(placement), ext_(ext), within_(within),
style_(style), name_(name), listname_(listName), listcommand_(listCmd),
- refprefix_(refPrefix), allowedplacement_(allowedplacement),
+ refprefix_(refPrefix), allowedplacement_(allowedplacement), requires_(requires),
usesfloatpkg_(usesfloat), ispredefined_(ispredefined),
allowswide_(allowswide), allowssideways_(allowssideways),
html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)
std::string const & listName, std::string const & listCmd,
std::string const & refPrefix, std::string const & allowedplacement,
std::string const & htmlType, std::string const & htmlClass,
- docstring const & htmlStyle, bool usesfloat, bool isprefined,
+ docstring const & htmlStyle, std::string const & requires,
+ bool usesfloat, bool isprefined,
bool allowswide, bool allowssideways);
///
std::string const & floattype() const { return floattype_; }
std::string const & allowedPlacement() const { return allowedplacement_; }
///
bool usesFloatPkg() const { return usesfloatpkg_; }
+ /// allowed placement options
+ std::string const & requires() const { return requires_; }
///
bool isPredefined() const { return ispredefined_; }
///
///
std::string allowedplacement_;
///
+ std::string requires_;
+ ///
bool usesfloatpkg_;
///
bool ispredefined_;
// use the "H" modifier. This includes modified table and
// figure floats. (Lgb)
Floating const & fl = params_.documentClass().floats().getType(name);
- if (!fl.floattype().empty() && fl.usesFloatPkg()) {
- require("float");
+ if (!fl.floattype().empty()) {
+ if (fl.usesFloatPkg())
+ require("float");
+ if (!fl.requires().empty()) {
+ vector<string> reqs = getVectorFromString(fl.requires());
+ for (auto const req : reqs)
+ require(req);
+ }
}
}
// You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files.
//
-int const LAYOUT_FORMAT = 79; // spitz: PagesizeFormat
+int const LAYOUT_FORMAT = 80; // spitz: Requires for floats
// Layout format for the current lyx file format. Controls which format is
FT_REFPREFIX,
FT_ALLOWED_PLACEMENT,
FT_ALLOWS_SIDEWAYS,
- FT_ALLOWS_WIDE,
+ FT_ALLOWS_WIDE,
+ FT_REQUIRES,
FT_END
};
{ "numberwithin", FT_WITHIN },
{ "placement", FT_PLACEMENT },
{ "refprefix", FT_REFPREFIX },
+ { "requires", FT_REQUIRES },
{ "style", FT_STYLE },
{ "type", FT_TYPE },
{ "usesfloatpkg", FT_USESFLOAT }
string style;
string type;
string within;
+ string requires;
bool usesfloat = true;
bool ispredefined = false;
bool allowswide = true;
lexrc.next();
usesfloat = lexrc.getBool();
break;
+ case FT_REQUIRES:
+ lexrc.next();
+ requires = lexrc.getString();
+ break;
case FT_PREDEFINED:
lexrc.next();
ispredefined = lexrc.getBool();
}
Floating fl(type, placement, ext, within, style, name,
listname, listcommand, refprefix, allowed_placement,
- htmltag, htmlattr, htmlstyle, usesfloat, ispredefined,
- allowswide, allowssideways);
+ htmltag, htmlattr, htmlstyle, requires, usesfloat,
+ ispredefined, allowswide, allowssideways);
floatlist_.newFloat(fl);
// each float has its own counter
counters_.newCounter(from_ascii(type), from_ascii(within),
FloatList::const_iterator end = floats.end();
for (; cit != end; ++cit) {
// normal float
+ if (cit->second.name().empty())
+ continue;
QString const label = qt_(cit->second.name());
addWithStatusCheck(MenuItem(MenuItem::Command, label,
FuncRequest(LFUN_FLOAT_INSERT,