]> git.lyx.org Git - lyx.git/blobdiff - src/output_latex.cpp
* sk.po
[lyx.git] / src / output_latex.cpp
index c2ec939d7ed6ef4ddc32fb7915ef13195d7d604c..b29e7fde60fc20632d8443603f085806ad335979 100644 (file)
@@ -25,7 +25,6 @@
 #include "ParagraphParameters.h"
 #include "TextClass.h"
 #include "TexRow.h"
-#include "VSpace.h"
 
 #include "insets/InsetBibitem.h"
 #include "insets/InsetArgument.h"
@@ -719,6 +718,7 @@ void TeXOnePar(Buffer const & buf,
        }
 
        bool pending_newline = false;
+       bool unskip_newline = false;
        switch (style.latextype) {
        case LATEX_ITEM_ENVIRONMENT:
        case LATEX_LIST_ENVIRONMENT:
@@ -792,6 +792,7 @@ void TeXOnePar(Buffer const & buf,
                                                "$$lang",
                                                current_lang));
                                        pending_newline = true;
+                                       unskip_newline = true;
                                }
                        } else if (!par_lang.empty()) {
                                os << from_ascii(subst(
@@ -799,14 +800,19 @@ void TeXOnePar(Buffer const & buf,
                                        "$$lang",
                                        par_lang));
                                pending_newline = true;
+                               unskip_newline = true;
                        }
                }
        }
        if (closing_rtl_ltr_environment)
                os << "}";
 
-       if (pending_newline)
+       if (pending_newline) {
+               if (unskip_newline)
+                       // prevent unwanted whitespace
+                       os << '%';
                os << '\n';
+       }
 
        // if this is a CJK-paragraph and the next isn't, close CJK
        // also if the next paragraph is a multilingual environment (because of nesting)