Le 23/10/2016 à 18:17, Enrico Forestieri a écrit :
commit 9ba76e6c40738f9bd0d45d4cdb00a9842d47feec
Author: Enrico Forestieri <for...@lyx.org>
Date: Sun Oct 23 18:04:13 2016 +0200
On export, mark the start of the first paragraph
No newline is written after \begin{document}, such that
the afterParbreak method would return false. This misleads
the code that outputs a display math in an ulem command
to emit a newline command instead of \noindent, causing
latex errors. This occurs only if the math is at the very
start of a document, without anything before it.
---
src/Buffer.cpp | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 67d4b3d..df3ae9f 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1891,6 +1891,10 @@ void Buffer::writeLaTeXSource(otexstream & os,
os.texrow().start(TexRow::beginDocument());
os << "\\begin{document}\n";
+ // mark the start of a new paragraph by simulating a newline,
+ // so that os.afterParbreak() returns true at document start
+ os.lastChar('\n');
+
I do not understand. Is os.lastChar('\n') not already called at the end
of os << "\\begin{document}\n" ?