diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index b47c3f7277..889a0a0a39 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2002-05-05 Dekel Tsur + + * insetfloat.C (latex): More sensible latex output + (fix the problem with endfloat). + 2002-05-02 José Matos * insetgraphics.C (validate): acess params as everyone else. diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 862647426a..94e27396aa 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -239,16 +239,21 @@ int InsetFloat::latex(Buffer const * buf, placement = buf_placement; } - os << "\\begin{" << tmptype << "}"; + // The \n is used to force \begin{} 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. if (!placement.empty()) { os << "[" << placement << "]"; } - - os << "%\n"; + os << "\n"; int const i = inset.latex(buf, os, fragile, fp); - os << "\\end{" << tmptype << "}%\n"; + + // The \n is used to force \end{} 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 + 2; }