tmalsburg/helm-bibtex

Addition of journal or journaltitle to filename template in helm-bibtex

Phil2740 opened this issue · 5 comments

Hi,
I'm not sure that this is the correct forum to raise this issue, but here goes.

I have many entries in my Bibtex files that are references to newspaper articles, which typically don't have either an author or an editor. If I try to create a note from such an entry I get an error message and the note doesn't get a title.

My question is: How could I add in the option of a journal or a journaltitle field in the the variable bibtex-completion-notes-template-multiple-files?

I have only a dim understanding of Emacs Lisp; I tried:

(setq bibtex-completion-notes-template-multiple-files     
    '("#+TITLE: Notes on: ${author-or-editor-or-journaltitle} (${year}): ${title}

      ")) 

in my init file, but that did not work.

I suppose I could add an author field to the newspaper entries, but I'd rather not do that; I've got thousands of entries.

Thanks for writing helm-bibtex, it's a great package, and thanks in advance for any help you can give me on this issue.

Hi. What you'd like to do is unfortunately not possible. But you could try this:

(setq bibtex-completion-notes-template-multiple-files     
    '("#+TITLE: Notes on: ${author-or-editor} ${journaltitle} (${year}): ${title}

      "))

This didn't work previously due to a bug that I discovered thanks to your request. The solution above is not super pretty but perhaps good enough?

Yes, in order to make the proposed template work, you need the latest version. For install instructions, please see the documentation here.

journaltitle isn't read by default because it's not a standard bibtex field. You need to add it to bibtex-completion-addition-search-fields (see here). I think there is also a mistake in the code that I provided above. It should be this (I think):

(setq bibtex-completion-notes-template-multiple-files     
    "#+TITLE: Notes on: ${author-or-editor} ${journaltitle} (${year}): ${title}

      ")