]> git.lyx.org Git - features.git/commitdiff
fix the problem with endfloat
authorDekel Tsur <dekelts@tau.ac.il>
Sun, 5 May 2002 15:15:51 +0000 (15:15 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Sun, 5 May 2002 15:15:51 +0000 (15:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4131 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetfloat.C

index b47c3f7277636430040710f94efaefb4ccfd68d4..889a0a0a395032ab08af07e648c709a4d1d8490f 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-05  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * insetfloat.C (latex): More sensible latex output
+       (fix the problem with endfloat).
+
 2002-05-02  José Matos  <jamatos@fep.up.pt>
 
        * insetgraphics.C (validate): acess params as everyone else.
index 862647426aeb725ed58fb89e0274ba245c087f3f..94e27396aaa048159506f252e2afc86c157fb162 100644 (file)
@@ -239,16 +239,21 @@ int InsetFloat::latex(Buffer const * buf,
                placement = buf_placement;
        }
 
-       os << "\\begin{" << tmptype << "}";
+       // 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.
        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{<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 + 2;
 }