org-roam / org-roam-bibtex

Org Roam integration with bibliography management software
GNU General Public License v3.0
568 stars 47 forks source link

Cannot read url properly #198

Closed quarkquartet closed 3 years ago

quarkquartet commented 3 years ago

Describe the bug I'm using orb to insert link and generate notes.

e.g. I have an entry as:

@article{Sikivie:2006ni,
    author = "Sikivie, Pierre",
    editor = "Kuster, Markus and Raffelt, Georg and Beltran, Berta",
    title = "{Axion Cosmology}",
    eprint = "astro-ph/0610440",
    archivePrefix = "arXiv",
    reportNumber = "UFIFT-HEP-06-16",
    doi = "10.1007/978-3-540-73518-2_2",
    url = "https://inspirehep.net/literature/729040"
    journal = "Lect. Notes Phys.",
    volume = "741",
    pages = "19--50",
    year = "2008"
}

Run orb-insert-link with the following template:

(use-package! org-roam-bibtex
  :after org-roam
  :config
  (require 'org-ref)
  (require 'ivy-bibtex)
  (setq orb-insert-interface 'ivy-bibtex)
  (setq orb-note-actions-interface 'ivy)
  (setq orb-preformat-keywords '("citekey" "author" "title" "url" "year"))
 (setq org-roam-capture-templates
       '(("r" "bibliography reference" plain
          ""
          :if-new
          (file+head "~/org/literature/${citekey}.org" "#+TITLE: ${title}\n #+AUTHOR: ${author}\n #+URL: ${url}\n #+YEAR: ${year}\n")
          :unnarrowed t)))
    )

What I get is:

:PROPERTIES:
:ID:       21fd7a84-dfa5-400a-8065-5fd0de1cab86
:ROAM_REFS: cite:Sikivie:2006ni
:END:
#+TITLE: Axion Cosmology
 #+AUTHOR: Sikivie, P.
 #+URL: https://inspirehep.net/literature/729040journalLect. Notes Phys.
 #+YEAR: 2008

Look at the url line in the captured result. It seems url cannot be correctly separated from the other keywords. I tried to move url to some other places in the entry. But wherever I put, the generated url is always attached with the next keywords.

To Reproduce Steps to reproduce the behavior:

  1. Run command 'orb-insert-link', with templates who contains url Then it appears.

ORB configuration

  1. How the package is loaded. Exactly the one about Doom emacs introduced in the document.
  2. ORB options set to non-default values (e.g. orb-templates) See above description.

Environment (please complete the following information):

Screenshots image

myshevchuk commented 3 years ago

Hi,

you have a syntactic error in your BibTeX entry. Every field-value pair should be delimited with comma ,:

@article{Sikivie:2006ni,
   ...
    doi = "10.1007/978-3-540-73518-2_2",
    url = "https://inspirehep.net/literature/729040"     <= comma is missing in your example
    journal = "Lect. Notes Phys.",
   ...
}