latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.51k stars 52 forks source link

Bibtex entry with unique double quotation mark causes error #809

Closed vandalt closed 1 year ago

vandalt commented 1 year ago

Hello,

I have a few bibtex entries with unique double quotation marks (") in the abstract or title (I included an example below in case it helps). They seem to cause an error: opening the .bib file shows the "Expecting a curly bracket" at the end and in the .tex file the autocomplete does not suggest anything after this entry. I don't know if they are supposed to be escaped technically, but I noticed that Overleaf and the LaTeX Workshop VSCode plugin worked fine with them not being escaped. The obvious fix is for me to fix them manually (which I did), but it can be annoying with large, automatically generated bib files (from Zotero, for example), and the error can be confusing so I thought it was still good to open an issue.

Thank you!

@article{doyon_jwst_2012,
  title = {The JWST Fine Guidance Sensor (FGS) and Near-Infrared Imager and Slitless Spectrograph (NIRISS)},
  author = {Doyon, Ren{\'e} and Hutchings, John B. and Beaulieu, Mathilde and Albert, Loic and Lafreni{\`e}re, David and Willott, Chris and Touahri, Driss and Rowlands, Neil and Maszkiewicz, Micheal and Fullerton, Alex W. and Volk, Kevin and Martel, Andr{\'e} R. and Chayer, Pierre and Sivaramakrishnan, Anand and Abraham, Roberto and Ferrarese, Laura and Jayawardhana, Ray and Johnstone, Doug and Meyer, Michael and Pipher, Judith L. and Sawicki, Marcin},
  year = {2012},
  month = sep,
  volume = {8442},
  pages = {84422R},
  doi = {10.1117/12.926578},
  abstract = {The Fine Guidance Sensor (FGS) is one of the four science instruments on board the James Webb Space Telescope (JWST). FGS features two modules: an infrared camera dedicated to fine guiding of the observatory and a science camera module, the Near-Infrared Imager and Slitless Spectrograph (NIRISS) covering the wavelength range between 0.7 and 5.0 {$\mu$}m with a field of view of 2.2' X 2.2'. NIRISS has four observing modes: 1) broadband imaging featuring seven of the eight NIRCam broadband filters, 2) wide-field slitless spectroscopy at a resolving power of rv150 between 1 and 2.5 {$\mu$}m, 3) single-object cross-dispersed slitless spectroscopy enabling simultaneous wavelength coverage between 0. 7 and 2.5 {$\mu$}m at Rrv660, a mode optimized for transit spectroscopy of relatively bright (J {$>$} 7) stars and, 4) sparse aperture interferometric imaging between 3.8 and 4.8 {$\mu$}m enabling high\- contrast ("' 10-4) imaging of M {$<$} 8 point sources at angular separations between 70 and 500 milliarcsec. This paper presents an overview of the FGS/NIRISS design with a focus on the scientific capabilities and performance offered by NIRISS.},
}
pfoerster commented 1 year ago

@vandalt Thanks for the report. There was indeed an error in the parser. Now, it should match the behavior of BibTeX (d3def46706fd2ff407b9bf58182c729737dfdc39).

vandalt commented 1 year ago

Thanks for the quick fix! It does work on the file I used to report the error now