X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput_latex.cpp;h=b29e7fde60fc20632d8443603f085806ad335979;hb=4a60f604c506684df838c9b95e3400c755d4cf08;hp=c2ec939d7ed6ef4ddc32fb7915ef13195d7d604c;hpb=f76d28c11803753bfc2f20bc2f51e3692a7e9f45;p=lyx.git diff --git a/src/output_latex.cpp b/src/output_latex.cpp index c2ec939d7e..b29e7fde60 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -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)