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

Autocompletion for BibTeX entries not stripping line breaks in BibTeX fields such as "author" #1559

Open
t-jager opened this issue May 19, 2022 · 2 comments

Comments

@t-jager
Copy link

t-jager commented May 19, 2022

In my user LaTeXTools.sublime-settings file I have set

"cite_panel_format": ["{keyword}: {author} - {title} ({year})",""],

and

"cite_autocomplete_format": "{keyword}: {author} - {title} ({year})",

When entering \cite{, then the auto completion menu is triggered. However, only the first author is shown (plus the word "and" that separates multiple authors), and one can only search for the first author's name.

Here is an example:

screenshot

It seems to be an issue with a certain set of BibTeX files that are not parsed correctly. Concretely, with the BibTeX files from here

https://cryptobib.di.ens.fr/

I can reproduce the issue reliably (it yields the above screenshot).

However, when I use BibTeX entries from DBLP, which does not use line breaks in the author field, then it works fine:

DBLP

My best guess for the root of this issue is that the files from https://cryptobib.di.ens.fr/ contain a line break after each "and" between authors, like this:

author = "Yan Huang and
Fangguo Zhang and
Zhi Hu and
Zhijie Liu",

And it seems that LaTeXTools does not strip these line breaks, but stops reading the field after the first line break. In contrast, DBLP BibTeX entries don’t contain line breaks and work fine.

Since BibTeX allows for line breaks in the authors field, it seems that LaTeXTools does not yet parse these fields correctly, as it seems to stop reading the contents of the field at a line break.

@t-jager t-jager changed the title Autocompletion for Bibtex entries shows only first authors plus "and" Autocompletion for BibTeX entries not stripping line breaks in BibTeX fields such as "author" May 21, 2022
@t-jager
Copy link
Author

t-jager commented May 21, 2022

UPDATE:

Indeed, the root of the issue is that LaTeXTools (or maybe the underlying BibTeX parser, which seems to be external?) stops reading an author field at the first line break.

@t-jager
Copy link
Author

t-jager commented May 31, 2022

UPDATE 2:

The issue seems not to appear on Windows. However, I can reliably reproduce it with Sublime Text Build 4126, Stable Channel, with recent installs of LaTeXTools and LaTeXYZ, running on MacOS 12.3.1 Monterey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant