void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
{
if (runparams_in.inFloat != OutputParams::NONFLOAT) {
+ if (!paragraphs().empty() && !runparams_in.nice)
+ // improve TexRow precision in non-nice mode
+ os << safebreakln;
+
if (runparams_in.moving_arg)
os << "\\protect";
os << "\\subfloat";
OutputParams rp = runparams_in;
rp.moving_arg = true;
- getCaption(os, rp);
+ os << getCaption(rp);
os << '{';
// The main argument is the contents of the float. This is not a moving argument.
- if (!paragraphs().empty())
- os.texrow().forceStart(paragraphs()[0].id(), 0);
rp.moving_arg = false;
rp.inFloat = OutputParams::SUBFLOAT;
InsetText::latex(os, rp);
}
-docstring InsetFloat::getCaption(OutputParams const & runparams) const
+TexString InsetFloat::getCaption(OutputParams const & runparams) const
{
- odocstringstream ods;
- otexstream os(ods);
- getCaption(os, runparams);
- return ods.str();
-}
-
-
-void InsetFloat::getCaption(otexstream & os,
- OutputParams const & runparams) const
-{
- if (paragraphs().empty())
- return;
-
InsetCaption const * ins = getCaptionInset();
if (ins == 0)
- return;
+ return TexString();
+ otexstringstream os;
ins->getArgs(os, runparams);
+ if (!runparams.nice)
+ // increase TexRow precision in non-nice mode
+ os << safebreakln;
os << '[';
otexstringstream os2;
ins->getArgument(os2, runparams);
arg = '{' + arg + '}';
os << move(ts);
os << ']';
+ if (!runparams.nice)
+ os << safebreakln;
+ return os.release();
}