James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.66k stars 530 forks source link

Some BibTeX error messages are not displayed #4197

Closed Yarakashi-Kikohshi closed 7 months ago

Yarakashi-Kikohshi commented 7 months ago

Pre-checks*

The Missed*

BibTeX has several variations, (but I'm not sure if this is really all there is to it...)

In LaTeX Workshop, errors related to BibTeX are displayed in the PROBLEMS panel, but errors related to BibTeX variations are not displayed.

demonstration

Configure tools and recipes as follows:

  "latex-workshop.latex.tools": [
    {
      "name": "pdflatex",
      "command": "pdflatex",
      "args": [
        "-interaction=nonstopmode",
        "-file-line-error",
        "%DOC%"
      ],
      "env": {}
    },
    {
      "name": "bibtex",
      //
      "command": "bibtex",
      // "command": "bibtex8",
      // "command": "bibtexu",
      // "command": "pbibtex",
      // "command": "upbibtex",
      "args": [
        "%DOCFILE%"
      ],
      "env": {}
    },
  ],
  "latex-workshop.latex.recipes": [
    {
      "name": "PDFLaTeX",
      "tools": [
        "pdflatex"
      ]
    },
    {
      "name": "BibTeX",
      "tools": [
        "bibtex"
      ]
    },
  ],

Prepare the TeX file and bib file. (No errors are issued for these files)

% test.tex
\documentclass{article}
\bibliographystyle{plain}
\begin{document}

\cite{test:bib}

\bibliography{test}

\end{document}
@comment{ test.bib }
@article{test:bib,
  author          = {A author},
  journal         = {Journal},
  number          = {2},
  title           = {This is the great article},
  volume          = {1},
  year            = {2024}
}

Execute it like below:

  1. Execute PDFLaTeX
  2. Execute BibTeX

BibTeX will issue an error if you specify a style file that does not exist or if a required field is missing.

OUTPUT panel when specifying a style file that does not exist Change TeX file as follows: ```diff - \bibliographystyle{plain} + \bibliographystyle{noexist} ``` ---------- BibTeX: ```log This is BibTeX, Version 0.99d (TeX Live 2023) The top-level auxiliary file: test.aux I couldn't open style file noexist.bst ---line 2 of file test.aux : \bibstyle{noexist : } I'm skipping whatever remains of this command I found no style file---while reading file test.aux (There were 2 error messages) ``` Two messages are displayed on PROBLEMS panel: - I couldn't open style file noexist.bst - I found no style file ---------- BibTeX8: ```log Reason: Input/output error The 8-bit codepage and sorting file: 88591lat.csf The top-level auxiliary file: test.aux I couldn't open style file noexist.bst ---line 2 of file test.aux : \bibstyle{noexist : } I'm skipping whatever remains of this command I found no style file---while reading file test.aux (There were 2 error messages) ``` No message will be displayed on PROBLEMS panel. ---------- BibTeXu: ```log Reason: Input/output error The top-level auxiliary file: test.aux I couldn't open style file noexist.bst ---line 2 of file test.aux : \bibstyle{noexist : } I'm skipping whatever remains of this command I found no style file---while reading file test.aux (There were 2 error messages) ``` No message will be displayed on PROBLEMS panel. ---------- upBibTeX: ```log This is upBibTeX, Version 0.99d-j0.36-u1.29 (utf8.uptex) (TeX Live 2023) The top-level auxiliary file: test.aux I couldn't open style file noexist.bst ---line 2 of file test.aux : \bibstyle{noexist : } I'm skipping whatever remains of this command I found no style file---while reading file test.aux (There were 2 error messages) ``` No message will be displayed on PROBLEMS panel.
OUTPUT panel when bib file without author field Change bib file as follows: ```diff - author = {A author}, + ``` ---------- BibTeX: ```log This is BibTeX, Version 0.99d (TeX Live 2023) The top-level auxiliary file: test.aux The style file: plain.bst Database file #1: test.bib Warning--to sort, need author or key in test:bib Warning--empty author in test:bib (There were 2 warnings) ``` Two messages are displayed on PROBLEMS panel: - to sort, need author or key - empty author ---------- BibTeX8: ```log The 8-bit codepage and sorting file: 88591lat.csf The top-level auxiliary file: test.aux The style file: plain.bst Database file #1: test.bib Warning--to sort, need author or key in test:bib Warning--empty author in test:bib (There were 2 warnings) ``` No message will be displayed on PROBLEMS panel. ---------- BibTeXu: ```log The top-level auxiliary file: test.aux The style file: plain.bst Database file #1: test.bib Warning--to sort, need author or key in test:bib Warning--empty author in test:bib (There were 2 warnings) ``` No message will be displayed on PROBLEMS panel. ---------- upBibTeX: ```log This is upBibTeX, Version 0.99d-j0.36-u1.29 (utf8.uptex) (TeX Live 2023) The top-level auxiliary file: test.aux I couldn't open style file noexist.bst ---line 2 of file test.aux : \bibstyle{noexist : } I'm skipping whatever remains of this command I found no style file---while reading file test.aux (There were 2 error messages) ``` No message will be displayed on PROBLEMS panel.

The Solution*

Even for BibTeX8, BibTeXu, pBibTeX, and upBibTeX other than BibTeX, I would like error messages to be displayed in the PROBLEMS panel in the same way as BibTeX.

Of course, there could be specific error messages that are not in BibTeX, but messages common to BibTeX should be displayed rather than no messages at all.

Version