hesstobi / atom-autocomplete-latex-cite

Autocomplete+ Support for Bibtex References in Latex
MIT License
4 stars 8 forks source link

adding option to exclude all Notes.bib files from search #22

Closed walkloud closed 4 years ago

walkloud commented 4 years ago

At least on macOS, the bibtex step generates a <your_paper>Notes.bib file. This bib file is not one that autocomplete-latex-cite knows how to parse, so every time one recompiles, it triggers lots of annoying warnings you have to close about an ill formatted bib file. I added an option, defaulted to false, to exclude any *Notes.bib files from the addFilesFromFolder, removeGlobalBibFiles and handleWatcherEvents functions. I have tested this new feature, with the option set to true and false and have eliminated all errors I could think of/find. The optional feature shows up in the Settings of the autocomplete-latex-cite package underneath the options of adding global paths for bib files.

hesstobi commented 4 years ago

Thank you, but i'm not shure if this is the right approach. It would be better to make the parsing of the Notes.bib possible by the package. Can you post an example of the bib?

walkloud commented 4 years ago

OK, I have found that the Notes.bib file is produced by the revtex4 class (this is the American Physical Society journal style class). There is almost no information about this file on the web (after a reasonable search) but you can find one reference to it in the documentation for revtex4-1 found for example here

http://ctan.math.illinois.edu/obsolete/macros/latex/contrib/revtex4-1/doc/latex/revtex/source/revtex4-1.pdf

It is not a file that should be parsed as a bib file. It is used for handling of footnotes. If the user specifies the nofootinbib option when loading the class, here is a simple paperNotes.bib file generated while running the latex/bibtex of paper.tex (everything under the ---- is the file content:

#paperNotes.bib
-----------------------------------
@CONTROL{REVTEX41Control}
@CONTROL{apsrev41Control,author="00",editor="1",pages="1",title="0",year="0"}

If the user does not specify nofootinbib such that footnotes end up in the reference section, then this is what the paperNotes.bib file contains

#paperNotes.bib
-----------------------------------
@FOOTNOTE{Note1,key="Note1",note="Some footnote."}
@CONTROL{REVTEX41Control}
@CONTROL{apsrev41Control,author="00",editor="1",pages="1",title="0",year="0"}

As you can see, these are not items that should be parsed as bibitems that users are interested in searching with autocomplete-latex-cite, at least I suspect you will agree.

hesstobi commented 4 years ago

Ok i changed the parser to ignore @Footnote and @Control entries.