# What do you think about org-ref V3?

**URL:** <https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133>\
**Category:** Development\
**Created:** [October 18, 2021, 7:13pm UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133 "2021-10-18T19:13:49Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bruce](https://org-roam.discourse.group/u/bruce)\
**Post date:** [October 20, 2021, 1:36pm UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/21 "2021-10-20T13:36:14Z")

</div>

@maikol is using this for the basic citation stuff, with the vertico module.

> <https://github.com/hlissner/doom-emacs/pull/5290>
>
> Sorry; because of the massive recent merges, and my shaky git skills, I had to r…edo #5212 to get the git correct. 
> 
> \## Summary
> 
> This adds support for native org-mode \`org-cite\` citations. Specifically it:
> 
> 1. configures the native \`org-cite\` processors
> 2. adds the \`oc-bibtex-actions\` processor for the vertico module, with "follow", "activate", and "insert" capabilities
> 3. ~adds and configures the new \`org-ref\` OC rewrite: https://github.com/jkitchin/org-ref-cite~ (removed for now because of unclear future)
> 3. installs \[citeproc-el\](https://github.com/andras-simonyi/citeproc-el), which is required for the \`oc-csl\` export processor, and will be needed also for forthcoming preview functionality
> 
> \_Should bump org along with this\_, as this depends on a recent change in org (namely that now loads oc-basic, while it didn't initially; so I removed that \`use-package!\` statement).
> 
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=745f0913fc153322f5abb11aba377415106bd97a
> 
> \## Issues and Questions
> 
> \### What to do with #2888?
> 
> 1. Drop \`org-ref\` from there (can revisit in the future).
> 2. Merge this.
> 3. That can rebase on this and just focus on \`org-roam-bibtex\`.
> 
> \### Keybindings?
> 
> This is tricky. 
> 
> We need to bind \*\*\`org-cite-insert\`\*\* and \*\*\`org-open-at-point\`\*\*, as these are the two entry points for the org-cite module. 
> 
> But how, and where? 
> 
> For now, I have added a binding for \`org-cite-insert\`.
> 
> But \`org-open-at-point\` is also more general, so probably should be in more than one place. 
> 
> A biblio submenu would also be helpful given the above, and that \`bibtex-actions\` (for \`vertico\`) has multiple entry points, and a keymap to access them (which is also used by \`embark\`).

FWIW, this is what I was referring to earlier, to only load the org-ref cross-reference support. I don’t know how it compares to the full package though; these two files gives you the cross-reference link types and font-locking and insertion for them.

```auto
(package! org-ref :recipe (:host github
                           :repo "jkitchin/org-ref"
                           :files ("org-ref-ref-links.el" "org-ref-refproc.el")))

```

I’ve also had in parallel been [experimenting](https://gist.github.com/bdarcus/1cebcff17fca762a363f89138214848d) with what it might take to add this sort of capability to org itself.

---

<div class="post-metadata">

**Author:** ![maikol](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@maikol](https://org-roam.discourse.group/u/maikol)\
**Post date:** [October 20, 2021, 3:06pm UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/22 "2021-10-20T15:06:52Z")

</div>

> [@prashantnag93](#):
>
> @maikol can I get your ` .doom.d` configuration so that I can also setup the same in my doom emacs.

Sure. The only relevant part of my `doom.d` for citations is

```auto
(after! org
  (require 'oc)

  (setq org-cite-export-processors
        '((latex biblatex)
          (t csl))))

(use-package! oc-bibtex-actions
  :when (featurep! :completion vertico)
  :after oc
  :demand t
  :config

  (setq org-cite-global-bibliography '("~/Dropbox/home/documents/org/roam/_library.bib"))
  (setq bibtex-actions-bibliography org-cite-global-bibliography)
  (setq bibtex-completion-bibliography org-cite-global-bibliography)
  (setq bibtex-actions-notes-paths '("~/Dropbox/home/documents/org/roam/literature"))
  (setq org-cite-insert-processor 'oc-bibtex-actions
        org-cite-follow-processor 'oc-bibtex-actions
        org-cite-activate-processor 'oc-bibtex-actions
        ;; The activate processor relies on shift-select, so we set to t.
        org-support-shift-select t)

  (setq bibtex-actions-default-action 'bibtex-actions-open-notes)
  (setq bibtex-completion-pdf-extension '(".pdf" ".djvu")
        bibtex-completion-pdf-field "file")

  (setq orb-note-actions-interface 'ivy)

  (map! :map org-mode-map
        "C-c [" 'org-cite-insert)

  ;; Use consult-completing-read for enhanced interface.
  (advice-add #'completing-read-multiple :override #'consult-completing-read-multiple))

```

These are just fragments from this PR and the manual of `bibtex-actions`

> <https://github.com/doomemacs/doomemacs/pull/5290>
>
> Sorry; because of the massive recent merges, and my shaky git skills, I had to r…edo #5212 to get the git correct. 
> 
> \## Summary
> 
> This adds support for native org-mode \`org-cite\` citations. Specifically it:
> 
> 1. configures the native \`org-cite\` processors
> 2. adds the \`oc-bibtex-actions\` processor for the vertico module, with "follow", "activate", and "insert" capabilities
> 3. ~adds and configures the new \`org-ref\` OC rewrite: https://github.com/jkitchin/org-ref-cite~ (removed for now because of unclear future)
> 3. installs \[citeproc-el\](https://github.com/andras-simonyi/citeproc-el), which is required for the \`oc-csl\` export processor, and will be needed also for forthcoming preview functionality
> 
> \_Should bump org along with this\_, as this depends on a recent change in org (namely that now loads oc-basic, while it didn't initially; so I removed that \`use-package!\` statement).
> 
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=745f0913fc153322f5abb11aba377415106bd97a
> 
> \## Issues and Questions
> 
> \### What to do with #2888?
> 
> 1. Drop \`org-ref\` from there (can revisit in the future).
> 2. Merge this.
> 3. That can rebase on this and just focus on \`org-roam-bibtex\` (though TBH I'm not clear if it's needed with org-cite).
> 
> On \`org-ref\` specifically:
> 
> It's status has evolved quite a bit over the last few months.
> 
> Its author initially published a development repo for an org-ref-cite package, which would have fit beautifully here, and which I initially added.
> 
> But since then he basically dropped that and in effect reimplemented aspects of org-cite in an incompatible syntax in org-ref v3.
> 
> In the process he removed some of the problematic dependencies and such, and it is possible to use org-cite (for citations) with org-ref (for its other functionality).
> 
> It's also possible to use org-ref for all of this, and ignore org-cite.
> 
> IMO this was a bad move from the broader org POV, and puts developers, users, and projects like Doom in an awkward position. \[An explanation\](https://github.com/jkitchin/org-ref#what-about-org-cite) is included in the README, the first part I agree with, the second which I think is just personal opinion that many will not agree with.
> 
> I personally don't think we should support it and focus instead on native org citations. But others may have reasonable differences of opinion.
> 
> \### Keybindings?
> 
> This is tricky. 
> 
> We need to bind \*\*\`org-cite-insert\`\*\* and \*\*\`org-open-at-point\`\*\*, as these are the two entry points for the org-cite module. 
> 
> But how, and where? 
> 
> For now, I have added a binding for \`org-cite-insert\`.
> 
> But \`org-open-at-point\` is also more general, so probably should be in more than one place. 
> 
> A biblio submenu would also be helpful given the above, and that \`bibtex-actions\` (for \`vertico\`) has multiple entry points, and a keymap to access them (which is also used by \`embark\`).

> **[GitHub - emacs-citar/citar: Emacs package to quickly find and act on...](https://github.com/emacs-citar/citar)**
>
> Emacs package to quickly find and act on bibliographic references, and edit org, markdown, and latex academic documents. - GitHub - emacs-citar/citar: Emacs package to quickly find and act on bibli...

---

<div class="post-metadata">

**Author:** ![prashantnag93](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@prashantnag93](https://org-roam.discourse.group/u/prashantnag93)\
**Post date:** [October 20, 2021, 3:11pm UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/23 "2021-10-20T15:11:42Z")

</div>

Thank you so much…

---

<div class="post-metadata">

**Author:** ![maikol](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@maikol](https://org-roam.discourse.group/u/maikol)\
**Post date:** [October 20, 2021, 3:12pm UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/24 "2021-10-20T15:12:46Z")

</div>

> [@bruce](#):
>
> these two files gives you the cross-reference link types and font-locking and insertion for them.

Thanks I will update my config with this.

> [@bruce](#):
>
> I’ve also had in parallel been [experimenting](https://gist.github.com/bdarcus/1cebcff17fca762a363f89138214848d) with what it might take to add this sort of capability to org itself.

Awesome! It will be ideal to have `org-mode` as a complete typesetting system for academic (or not) documents with only built-in functions.

---

<div class="post-metadata">

**Author:** ![FilTower](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@FilTower](https://org-roam.discourse.group/u/FilTower)\
**Post date:** [November 21, 2021, 1:40pm UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/25 "2021-11-21T13:40:31Z")

</div>

Hi everyone. I’m using Org Roam v2 and ORB v0.6 with Org Ref. The other day I switched to Org Ref V3, everything seems to work OK except for one thing.

When I run the command `helm-bibtex`, all my bib entries appear without the note symbol (✎) even if some of them do have notes. Fortunately (but strangely), selecting one of those entries and clicking on `Edit notes` correctly opens the corresponding note. Also, I can access the note from a file that cites that entry, and in that case hovering with the cursor on the citation (cite:Blabla2007) displays the correct information _with_ the note symbol (if the entry has a note).

By looking at the code, I can see that `bibtex-completion-find-note-functions` includes `orb-find-note-file`, and the latter evaluates correctly on a scratch buffer with a CITEKEY that has a note. So, I’m not sure if this is a problem caused by Helm Bibtex, ORB, Org Ref v3, or by a mistaken configuration file (I followed the new instructions on the Org Ref v3 website).

Any suggestion on what I should try to do next would be much appreciated. 🙂

---

<div class="post-metadata">

**Author:** ![FilTower](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@FilTower](https://org-roam.discourse.group/u/FilTower)\
**Post date:** [November 21, 2021, 5:44pm UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/26 "2021-11-21T17:44:13Z")

</div>

After a few hours looking at elisp code and at my config file, I had a hunch about what might have been the problem. The hunch turned out to be correct. This is what I was doing:

- start Emacs;
- immediately open an org file which prompts `bibtex-completion` to (re)load the bibliography;
- then activate `org-roam-bibtex-mode`.

This sequence of steps leads to the glitch I described in the previous post because, without `org-roam-bibtex-mode` on, `bibtex-completion` won’t use `orb-find-note-file`.

I guess that if I instruct Emacs to turn on `org-roam-bibtex-mode` immediately at startup, the glitch would be difficult to encounter.

Sorry to have cluttered this section with my predicament, this was the only thread on Org-ref v3 so I thought to post it here.

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [November 22, 2021, 7:46am UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/27 "2021-11-22T07:46:13Z")

</div>

Hi @FilTower, `org-roam-bibtex-mode` is just about that - tweaking some variables like `bibtex-completion-find-note-functions` and building its own cache to make Bibtex-completion aware of existing Org-roam literature notes. There is no way Bibtex-completion could work with Org-roam correctly without enabling `org-roam-bibtex-mode` first, unless you set all these things by hand of course.

You do not need to turn the mode _immediately_ at startup however. It may even be not advisable to do so if you have a complicated Org setup - loading things that require Org early may lead to various race conditions issues, e.g. loading an incorrect version of Org if you have several installed. Typically, you’d do something like

```auto
(with-eval-after-load 'org-roam (org-roam-bibtex-mode +1))

```

or

```auto
(use-package org-roam
...
:config
(org-roam-bibtex-mode +1)
...)

```

Alternatively, if Helm-bibtex is the “entry point” in your Emacs workflow, you could do something like

```auto
(use-package helm-bibtex
...
:config
(org-roam-bibtex-mode +1)
...)
```

---

<div class="post-metadata">

**Author:** ![FilTower](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@FilTower](https://org-roam.discourse.group/u/FilTower)\
**Post date:** [November 22, 2021, 8:44am UTC](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133/28 "2021-11-22T08:44:58Z")

</div>

Hi @mshevchuk , thanks for the explanation and advice, and for the helpful code snippets!

[Previous page](https://org-roam.discourse.group/t/what-do-you-think-about-org-ref-v3/2133.md?page=1)
