From 9ba76e6c40738f9bd0d45d4cdb00a9842d47feec Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sun, 23 Oct 2016 18:04:13 +0200 Subject: [PATCH] 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 file changed, 4 insertions(+) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 67d4b3dc38..df3ae9fb35 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'); + // output the parent macros MacroSet::iterator it = parentMacros.begin(); MacroSet::iterator end = parentMacros.end();