+int InsetFloat::latex(Buffer const & buf, ostream & os,
+ OutputParams const & runparams) const
+{
+ FloatList const & floats = buf.params().getLyXTextClass().floats();
+ string tmptype = (params_.wide ? params_.type + "*" : params_.type);
+ if (params_.sideways) {
+ if (params_.type == "table")
+ tmptype = "sidewaystable";
+ else if (params_.type == "figure")
+ tmptype = "sidewaysfigure";
+ }
+ // Figure out the float placement to use.
+ // From lowest to highest:
+ // - float default placement
+ // - document wide default placement
+ // - specific float placement
+ string placement;
+ string const buf_placement = buf.params().float_placement;
+ string const def_placement = floats.defaultPlacement(params_.type);
+ if (!params_.placement.empty()
+ && params_.placement != def_placement) {
+ placement = params_.placement;
+ } else if (params_.placement.empty()
+ && !buf_placement.empty()
+ && buf_placement != def_placement) {
+ placement = buf_placement;
+ }
+
+ // The \n is used to force \begin{<floatname>} to appear in a new line.
+ // The % is needed to prevent two consecutive \n chars in the case
+ // when the current output line is empty.
+ os << "%\n\\begin{" << tmptype << '}';
+ // We only output placement if different from the def_placement.
+ // sidewaysfloats always use their own page
+ if (!placement.empty() && !params_.sideways) {
+ os << '[' << placement << ']';
+ }
+ os << '\n';
+
+ int const i = InsetText::latex(buf, os, runparams);
+
+ // The \n is used to force \end{<floatname>} to appear in a new line.
+ // In this case, we do not case if the current output line is empty.
+ os << "\n\\end{" << tmptype << "}\n";
+
+ return i + 4;
+}
+
+
+int InsetFloat::linuxdoc(Buffer const & buf, ostream & os,
+ OutputParams const & runparams) const