Jean-Pierre Chrétien wrote:
> So to come back to the previous thread, if Enrico's patch is not applied,
> which one of the "}\n" strings in output_latex.cpp should be modified ?

See attachment.

The new bool is introduced because pending_newline is used multiple times.

Jürgen
Index: src/output_latex.cpp
===================================================================
--- src/output_latex.cpp	(Revision 38989)
+++ src/output_latex.cpp	(Arbeitskopie)
@@ -720,6 +720,7 @@
 	}
 
 	bool pending_newline = false;
+	bool unskip_newline = false;
 	switch (style.latextype) {
 	case LATEX_ITEM_ENVIRONMENT:
 	case LATEX_LIST_ENVIRONMENT:
@@ -793,6 +794,7 @@
 						"$$lang",
 						current_lang));
 					pending_newline = true;
+					unskip_newline = true;
 				}
 			} else if (!par_lang.empty()) {
 				os << from_ascii(subst(
@@ -800,14 +802,19 @@
 					"$$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)

Reply via email to