tmalsburg/helm-bibtex

helm-bibtex-additional-search-fields with repeated fields

rdiaz02 opened this issue · 2 comments

If one exports a bibtex file from Zotero one can have multiple annote fields per entry. If one has

(setq helm-bibtex-additional-search-field '(annote))`

only the contents of the last annote are searched. Is there a way to have it search in all annotes of every entry?

I have never seen a formal and complete definition of the BibTeX format, but my impression was that each field is expected to occur only once in an entry. Elsevier consistently deviate from that when they put each keyword in its own keywords field (despite that fact that the name "keywords" makes it very clear that all keywords should go in one field), but other than that I haven't seen BibTeX with multiple instances of the same field, and I would guess that most apps don't support it properly. I understand that this isn't a satisfying response and if Zotero generates multiple annotate fields, that alone might be reason enough to support it in helm-bibtex. Unfortunately, that's not completely trivial. There are two simple solutions: 1.) Merge the multiple fields into one. 2.) Keep several multiple fields in helm-bibtex' internal records. Both don't work, because multiple fields are already used internally but in this use it's important to show only the first instance. The specific use case for that are cross-references. For instance, when a conference paper links to the proceedings in which the paper was published, the two entries are concatenated and only the first instance of each field is used such that we see the title of the paper but not the title of the conference proceedings. I'll think about a solution but can't promise anything.

Thanks for your attention to this issue and your detailed comments. With Zotero it is very easy to have several "annote" fields in a single entry. For example, the "Notes" tab has a button that says "Add", and any click there will add a new note (though this is certainly under the user control, so instead of adding notes, one could just continue adding to a single note). If one also uses something like ZotFile to extract annotations from PDFs, any run of ZotFile generates a new "annote" field (so if one also has other notes, this is a least two annotes). But then, I understand these might be just a bunch of peculiar corner cases.

I already process the Zotero bibtex file for helm-bibtex for the multiple files per entry and path issues with a sed script, so it might just be a lot simpler to do it that way and expect only one instance of each field per entry. I'll post back when I fix it.