+
+
+void LaTeXFeatures::getFloatDefinitions(ostream & os) const
+{
+ FloatList const & floats = params.getLyXTextClass().floats();
+
+ // Here we will output the code to create the needed float styles.
+ // We will try to do this as minimal as possible.
+ // \floatstyle{ruled}
+ // \newfloat{algorithm}{htbp}{loa}
+ // \floatname{algorithm}{Algorithm}
+ UsedFloats::const_iterator cit = usedFloats.begin();
+ UsedFloats::const_iterator end = usedFloats.end();
+ // ostringstream floats;
+ for (; cit != end; ++cit) {
+ Floating const & fl = floats.getType((*cit));
+
+ // For builtin floats we do nothing.
+ if (fl.builtin()) continue;
+
+ // We have to special case "table" and "figure"
+ if (fl.type() == "tabular" || fl.type() == "figure") {
+ // Output code to modify "table" or "figure"
+ // but only if builtin == false
+ // and that have to be true at this point in the
+ // function.
+ string const type = fl.type();
+ string const placement = fl.placement();
+ string const style = fl.style();
+ if (!style.empty()) {
+ os << "\\floatstyle{" << style << "}\n"
+ << "\\restylefloat{" << type << "}\n";
+ }
+ if (!placement.empty()) {
+ os << "\\floatplacement{" << type << "}{"
+ << placement << "}\n";
+ }
+ } else {
+ // The other non builtin floats.
+
+ string const type = fl.type();
+ string const placement = fl.placement();
+ string const ext = fl.ext();
+ string const within = fl.within();
+ string const style = fl.style();
+ string const name = fl.name();
+ os << "\\floatstyle{" << style << "}\n"
+ << "\\newfloat{" << type << "}{" << placement
+ << "}{" << ext << '}';
+ if (!within.empty())
+ os << '[' << within << ']';
+ os << '\n'
+ << "\\floatname{" << type << "}{"
+ << name << "}\n";
+
+ // What missing here is to code to minimalize the code
+ // output so that the same floatstyle will not be
+ // used several times, when the same style is still in
+ // effect. (Lgb)
+ }
+ }
+}