joostkremers / ebib

A BibTeX database manager for Emacs.
https://joostkremers.github.io/ebib/
BSD 3-Clause "New" or "Revised" License
272 stars 37 forks source link

Org cite template during note creation (%C) is missing an @ #300

Closed ymherklotz closed 2 months ago

ymherklotz commented 2 months ago

Note: sorry I see now that it is inserting Org ref citations, maybe I could add a key for native Org citations? Otherwise this issue can be ignored, it's easy enough to extend it locally.


When creating a custom template and using the %C key to create an Org citation, I believe that the inserted citation is slightly malformed because of a missing @ in front of the key name. The Org documentation states that the format is the following:

[cite/style:common prefix ;prefix @key suffix; ... ; common suffix]

but the current implementation is missing the @ sign.

https://github.com/joostkremers/ebib/blob/2f2d39d1953fa10d7c3dad6a4611d8ec0d489aba/ebib-utils.el#L1645-L1647

The function I am using instead, which seems to introduce a working Org citation is just the following (I have also added square brackets for completeness):

(defun ebib-create-org-cite (key _db)
  "Return a citation for an Org mode note for KEY in DB."
  (format "[cite:@%s]" key))

If you prefer I submit that as a pull request just let me know.

joostkremers commented 2 months ago

Yes, ebib-create-org-cite is from before the time when Org gained full-fledged citation support. As a "citation processor", Ebib would be able to provide follow and insert support, but I don't have time right now to work on that...

ymherklotz commented 2 months ago

Ah thanks for the pointers to follow and insert, I'll have a look at that too and see if I can give it a shot.