From: Scott Kostyshak Date: Sat, 21 Feb 2015 05:00:51 +0000 (-0500) Subject: Improve log scanner to correctly report error X-Git-Tag: 2.2.0alpha1~1130 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0a6120cb7f940bc010efa9f2873afaeee6381a9e;p=features.git Improve log scanner to correctly report error When scanning the LaTeX log, previously we only looked ahead 10 lines after a "!" line and if we did not find a line number we did not count an error. This lead to the problem that templates/ACM-sigplan.lyx was showing a successful export and the PDF was shown (it is still created despite the error). Now that the exit code of the latex command is checked (as of the previous commit), an error is correctly given, but by parsing the log better with this commit, a more informative error is given. Increasing the look-ahead to 15 lines leads to correct parsing of the ACM-sigplan log. The excerpt in the log file where there are more than 10 lines in-between the "!" line and the line number is below: ! Undefined control sequence. \@toappear ...ent http://dx.doi.org/10.1145/\@doi ...n is removed.]\par \else \@toappear \fi \if \@reprint \noinden... \@begin@tempboxa ...mpboxa #1{\color@begingroup #2 \color@endgroup }\def \wid... \@iiiparbox ...tempdima \@parboxrestore #5\@@par } \ifx \relax #2\else \setle... \@copyrightspace ...planconf@finalpage}.\par \fi } }\end@float \maketitle ... \@copyrightwanted \@copyrightspace \fi l.34 \maketitle Another example is posted here: http://tex.stackexchange.com/questions/231655/lyx-cannot-output-to-pdflatex-for-a-specific-file --- diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 588ca522e4..e4f8b4b490 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -825,7 +825,10 @@ int LaTeX::scanLogFile(TeXErrors & terr) if (!getline(ifs, tmp)) break; tmp = rtrim(tmp, "\r"); - if (++count > 10) + // 15 is somewhat arbitrarily chosen, based on practice. + // We used 10 for 14 years and increased it to 15 when we + // saw one case. + if (++count > 15) break; } while (!prefixIs(tmp, "l.")); if (prefixIs(tmp, "l.")) {