Open jonschz opened 2 years ago
tex is notoriously bad for analysing errors in log as there is no well defined format for it. Tim basically gave up on this. You can provide the source code to provoke the error and we can hope that some one looks at it, but I will not. (without source code, we can directly close this issue.)
Alright, I can imagine that parsing log files without a well-defined format is a pain. Nevertheless, here is the LaTeX file together with the full log file (the problem appears in line 578):
TexStudio_log_parsing_error.zip
I put in some effort to make this minimal, but I still had to keep in quite a list of packages. I also included the version numbers of imported packages whenever applicable.
I have looked at the problem a little more closely and I have found some patterns:
pdflatex
log that start with an exclamation mark describe an error.pdflatex
returns with exit code 0.article.cls
, it seems that every logged error is preceded by an empty line.book.cls
, logged errors are either preceded by an empty line, or by an empty line followed by a line Chapter \d+\.
(where "Chapter" changes based on the language).I see the following easy remedies:
\n\n(.+\d+\.\n)?!
(with .
not matching line breaks).
pdflatex
terminates with exit code 0, discard all error-level log entries.
pdflatex
exits with an error and Approach 1) does not find a single error. In that case, just default to the old behaviour.
Any thoughts on this?
does anyone know a workaround? For example, do not recognize it as an error if it contains particular string or something.. It's been quite frustrating since the synctex does not work when this happens.
You could try to change the length of the command line output, see https://stackoverflow.com/q/1289680. This won't fix the issue for good, but it can decrease the odds and fix one particular instance of this error by moving the exclamation mark away from the beginning of the line.
Also, It'd be great if you could post a snippet of your log file. What the log file parser is missing (imo) is a collection of unit tests.
Awesome! I managed to change it to have 2048 line width, so I am pretty sure it's not likely to happen again.
Unfortunately, I have edited further and at some point I stopped getting the false error. At this point, I don't have '!' at all in my log. I'll see if I can recover it.
Environment
Expected behavior
My LaTeX file compiles without error ("process terminated normally") and produced a
Bad Box
with the following log entry:I would expect the row starting with
Loose \hbox [...]
to show up as aBad Box
under "Errors and Warnings".Actual behavior
The 7th row, starting with
! \OT1/lmr/m/n/10.95 [...]
, is detected as anError
and highlighted in red after compiling despitepdflatex
terminating normally. I suspect it has to do with the row starting with an exclamation mark.How to reproduce
I can provide a TeX file if needed.