commit cc9932ac69cae3d2a34f799c81c87a9f70cf3d7a
Author: Juergen Spitzmueller <[email protected]>
Date: Sat Jul 26 18:11:45 2025 +0200
Fix detection of preamble error
---
src/LaTeX.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 30f1ab0d62..3121af8fbc 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -1042,12 +1042,16 @@ int LaTeX::scanLogFile(TeXErrors & terr)
// Just get the error description:
string desc;
+ bool preamble_error = false;
if (prefixIs(token, "! "))
desc = string(token, 2);
else if (fle_style)
desc = sub.str();
- if (contains(token, "LaTeX Error:"))
+ if (contains(token, "LaTeX Error:")) {
retval |= LATEX_ERROR;
+ if (contains(token, "Missing
\\begin{document}"))
+ preamble_error = true;
+ }
if (prefixIs(token, "! File ended while scanning")) {
if (prefixIs(token, "! File ended while
scanning use of \\Hy@setref@link.")){
@@ -1126,7 +1130,6 @@ int LaTeX::scanLogFile(TeXErrors & terr)
sscanf(tmp.c_str(), "l.%d", &line);
// get the rest of the message:
string errstr(tmp, tmp.find(' '));
- bool preamble_error = false;
if (suffixIs(errstr, "\\begin{document}")) {
// this is an error in preamble
// the real error is in the
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs