Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in detection of "Problems" from pdftex output #730

Closed
philipstarkey opened this issue Aug 3, 2018 · 6 comments
Closed

Bugs in detection of "Problems" from pdftex output #730

philipstarkey opened this issue Aug 3, 2018 · 6 comments
Assignees

Comments

@philipstarkey
Copy link

Description

The "Problems" tab in VSCode displays errors/warnings/info from the console output of pdfTex. I've discovered some situations where this is not correctly determined, which I assume is down to bugs in the regex expressions in /src/components/parser.ts (but I could be wrong!)

  1. The first issue is to do with LaTeX Package Warnings. These seem to be printed to the console with a double space between Package and Warning (as in: "Package  Warning") and do not show up at all in the "problems" tab. I believe this is a recent regression as they used to show up (but I'm not sure when it happened because I've been lax in updating my VSCode and Extensions).

  2. If an underfull/overfull warning ends with a "-", then it seems to ignore all other warnings/errors/info until the next page. I provide an example of some of the console output that causes this below.

Log messages

LaTeX Workshop Output
Overfull \hbox (4.13475pt too wide) in paragraph at lines 549--549
[]|\OT1/cmr/bx/n/6 Manufacturer| 

Underfull \hbox (badness 10000) in paragraph at lines 552--552
[]\OT1/cmr/m/n/6 (additional 2 software-

LaTeX Warning: This never shows up in the problems tab


LaTeX Warning: Neither does this
Developer Tools Console Nothing of importance

How to reproduce

I haven't produced a minimal working example to reproduce this and I'd rather not copy paste the contents of my LaTeX file as I don't want to share the content right now.

However, if this is not enough information for you to reproduce I can put the time in to produce a minimal working example.

Expected behavior

The two warnings that follow the underfull notice should show up in the problems tab

Actual behavior

The two warnings that follow the undefull notice do not show up in the problems tab.

Additional Information

I'm using pdfTex Version 3.14159265-2.6-1.40.19 (MikTeX 2.9.6630 64-bit) on Windows 10.
I'm using LaTeX Workshop v5.6.0
I'm using Visual Studio Code 1.23.1

@philipstarkey
Copy link
Author

An additional edge case:

  1. If a LaTeX Warning contains two dashes, without any spaces separating them, and the first dash is preceeded by something that is not a space, then the warning does not show up in the "Problems" tab. For example, any LaTeX Warning with the following text in it does not show up:
  • side-by-side
  • side-by- side

However, if it was formatted like the following, then it would show up:

  • side -by-side
  • side- by-side
  • side-by -side

@jlelong
Copy link
Collaborator

jlelong commented Aug 8, 2018

A minimal example would really help to analyze what is wrong with the parser and to test new regex. I do not think we can work on the problem without being able to reproduce it.

@philipstarkey
Copy link
Author

philipstarkey commented Aug 9, 2018

Ok, I've attached a .tex and .bib file that should demonstrate the issues. Some further insight I gained while producing the example:

  • Issue 1 happens when you don't specify a package name (which explains the double space). I guess that was my mistake...but I'd think it would be good to show them in the list of problems anyway

  • Issue 2: The warnings/etc. don't actually vanish like I thought, they just show up under a category in the problems tab with a filename that doesn't exist (the filename seems to have been drawn from an earlier log line, but corresponds to a part of the text).

  • Issue 3 happens due to the way the messages in the terminal are wrapped over multiple lines. I'm not sure what is doing the wrapping (LaTeX Workshop, pdftex or VS Code) and I don't know if it varies by platform (but probably not since it's 80 characters). This issue is triggered when a terminal line ends with a "-", and for some reason the whole message vanishes from the problems tab. Note that I've demonstrated this in the attached .tex file for a faked "LaTeX Warning" however I also confirmed the issue exists for package warnings that are the correct length such that the "-" is the last character on the line.

I hope that helps! Please let me know if you need further information.

Compilation command: pdflatex, bibtex, pdflatex, pdflatex
Terminal output from last step of compilation:

75 language(s) loaded.
(C:\Users\Phil\AppData\Roaming\MiKTeX\2.9\tex\latex\memoir\memoir.cls
Document Class: memoir 2018/04/04 v3.7g configurable book, report, article docu
ment class
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
(C:\Users\Phil\AppData\Roaming\MiKTeX\2.9\tex\latex\ifetex\ifetex.sty
(C:\Users\Phil\AppData\Roaming\MiKTeX\2.9\tex\plain\ifetex\ifetex.tex))
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty")
(C:\Users\Phil\AppData\Roaming\MiKTeX\2.9\tex\latex\memoir\mem10.clo))

LaTeX Warning: Unused global option(s):
    [10.5pt].

(main.aux)

Package Package Warning: This shows up in the list of problems on input line 9.



Package  Warning: This doesn't show up in the list of problems on input line 12
.


Underfull \hbox (badness 10000) in paragraph at lines 21--21
[]\OT1/cmr/m/n/6 (additional 2 blah-blah

Underfull \hbox (badness 10000) in paragraph at lines 22--22
[]\OT1/cmr/m/n/6 4-12 blah blah blah

Package Asd Warning: This shows up in the list of problems, but under a headnig
 for a file that doesn't exist on input line 28.


LaTeX Warning: TODO Note [This doesn't show up in the list of problems 33 side-
by-side blah blah blah] still in text on input line 31.


Package package Warning: This doesn't show up in the list of problems 344 side-
by-side blah blah blah on input line 32.

(main.bbl [1{C:/Users/Phil/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
[2]
bibitemlist
) [3] (main.aux) )
(see the transcript file for additional information)<C:/Program Files/MiKTeX 2.
9/fonts/type1/public/amsfonts/cm/cmbx12.pfb><C:/Program Files/MiKTeX 2.9/fonts/
type1/public/amsfonts/cm/cmr10.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/pub
lic/amsfonts/cm/cmr6.pfb>
Output written on main.pdf (3 pages, 42347 bytes).
SyncTeX written on main.synctex.gz.
Transcript written on main.log.

Example showing the warnings under an invalid file:
problems

minimal working example:
main.zip

@jlelong
Copy link
Collaborator

jlelong commented Aug 10, 2018

Thanks for the example. I will look into it.

@jlelong jlelong self-assigned this Aug 10, 2018
@James-Yu
Copy link
Owner

Sorry for an off-topic plugin. I have been busy working on my IRL job application and ddls in the past few months. May have to take an AFK for few weeks. Will turn back to the extension right after that! @jlelong

jlelong added a commit to jlelong/LaTeX-Workshop that referenced this issue Aug 29, 2018
jlelong added a commit to jlelong/LaTeX-Workshop that referenced this issue Aug 29, 2018
Consider log lines finishing in '-' as truncated lines.
So, wrap them up.

This is related James-Yu#730 (Issue 3).
jlelong added a commit to jlelong/LaTeX-Workshop that referenced this issue Aug 29, 2018
The first line after a box warning is just garbage. So, we drop it as it
may contain '(' or ')', which interfere with the computation of the
Latex files stack.

It is related to James-Yu#730 (Issue 2).
@jlelong
Copy link
Collaborator

jlelong commented Aug 29, 2018

The main problem in parsing (pdf)latex logs is that their standard output is hard wrapped to 80 characters, no matter the OS. This can be changed

  • by tweaking configuration files (see here)
  • by adding extra arguments to the command line but this approach varies with the OS (see the manual of latexmk and here)

Currently, LaTeX-Workshop tries to recover the unwrapped output. In cas there are future problems related to this, here is a summary of what i changed:

  • Lines ending in - are considered as hard wrapped lines.
  • A line following an overfull/underfull box warning is ignored as it is mainly garbage but interferes with the computation of the LaTeX files stack.

@jlelong jlelong closed this as completed Aug 29, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants