overleaf / web

The web front end for Overleaf, a web-based collaborative LaTeX editor
GNU Affero General Public License v3.0
348 stars 169 forks source link

Parse and show logs from the .blg file as well as the LaTeX log #20

Closed jpallen closed 7 years ago

jpallen commented 10 years ago

Biblatex/biber log any errors and warnings to the .blg file. We could download and parse this (it's a much nicer syntax than the LaTeX logs), and show any errors and warnings in the log pane, just like we do with errors and warnings from the LaTeX log.

At the moment this can trip people up because errors in biblatex stop the bibliography from showing up correctly, but no obvious errors or warnings are shown.

jpallen commented 10 years ago

@appmathdoc This would be a great thing to get added.

I think the steps to get this added are:

1) Write a bibtex & biber log parser. This is the hardest part since bibtex doesn't really produce an easily machine readable log (just like LaTeX). biber produces a different log format which is much easier to parse. 2) Copy the code the that parses the LaTeX output.log in the editor and make it use the new bibtex parser on the .blg, then merge the errors and warnings in the output.

Currently, bibtex errors are not reported, which is an issue if you have large number of references. Downloading/Viewing .blg files repeatedly is tedious.

However, when Bibtex runs it returns a .blg log file. Best info is after an entry such as

Database file #1: references.bib

After that line, if no errors, it reports a message such as

You've used 1 entry, 2118 wiz_defined-function locations, 501 strings with 4064 characters, and the built_in function-call counts, 237 in all, are:

whereas if there are errors, it reports something like

I was expecting a ,' or a}'---line 1 of file references.bib : @book{adams1995

: hitchhiker, I'm skipping whatever remains of this entry Warning--I didn't find a database entry for "adams1995hitchhiker" You've used 1 entry, 2118 wiz_defined-function locations, 502 strings with 4050 characters, and the built_in function-call counts, 235 in all, are:

and then at the end of the .blg, it says

(There was 1 error message)

There's also a -quiet option for Bibtex that causes it to only return errors.

I would be willing to work on just getting an "orange message" onscreen if bibtex had any errors, but would be nice to know where to start (haven't downloaded or cloned yet).