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

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

Open
Phil2740 opened this issue Apr 4, 2022 · 5 comments
Open

Comments

@Phil2740
Copy link

Phil2740 commented Apr 4, 2022

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.

@tmalsburg
Copy link
Owner

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?

@Phil2740
Copy link
Author

Phil2740 commented Apr 5, 2022 via email

@tmalsburg
Copy link
Owner

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

@Phil2740
Copy link
Author

Phil2740 commented Oct 11, 2022 via email

@tmalsburg
Copy link
Owner

tmalsburg commented Oct 11, 2022

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}

      ")

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

2 participants