From: Dekel Tsur Date: Sun, 5 May 2002 15:15:51 +0000 (+0000) Subject: fix the problem with endfloat X-Git-Tag: 1.6.10~19277 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=fab4e282c5e5b3aa80f931cc99d91e7f3697c232;p=features.git fix the problem with endfloat git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4131 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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; }