Customizing the description of links

Hi! I am using org-roam as I start researching my dissertation. Thus I have quite a mix of literature notes and (much more slowly) permanent notes for the “slip box.”

Taking lots of literature notes has resulted in a convoluted set of references between the various works I am reading. Book A cites B C and D. C and D also Cite B. E cites A and C etc. Because I am keeping track of the important interpretations that other scholars have of each-other’s work (so I can say something like “A understands B to say… but C shows that B really argued for…”) I want to show those linkages off in my org-roam-graph.

This has become a messy task. I start by opening helm-bibtex and selecting the relevant citation. I then select edit notes which creates or opens a file named for the key in my bibtex file. In there of course it inserts the #+TITLE and #+ROAM_KEY. When I then use C-c n i to activate org-roam-insert it inserts a link to the file by title. So if the title of the book is 15 words long as academic books are the page gets rather messy.

I see two possible ways forward:

  1. Some way to override the functionality of org-roam-insert so that if their is a #+ROAM_KEY with cite: it inserts the bibtex key to the link description. (Even better overriding it to allow an author-year link description.)
  2. Allow cite: links to be part of the org-roam graph so I can see which authors are talking about eachother.

Is either of those easily feasible? I know only enough emacs-lisp to write the most basic configuration files. Is there another direction I should be considering?


Just to clarify, are you using org-ref or accessing your bibtex file directly with helm-bibtex?

I open helm-bibtex directly. I had a hard time figuring out how to open it via org-ref. Is there a way to do that I couldn’t find? (Short of C-c ] org-ref-helm-insert-cite-link)

I wanted to follow up on my previous post with more (hopefully relevant) information.

I am not sure if this is an issue of org-roam, org-ref, or helm-bibtex. I’ll include my config files for all three below so that you can confirm I’m not setting anything up weirdly.

What I expect to happen when I tell helm-bibtex (opened either through the helm-bibtex command or org-ref-helm-insert-cite-link) when I hell it to edit the note for that citation is that it would open or create the relevant file in ~/Documents/Academic-Writing/bibliography/helm-notes/. However what happens instead is a file with a #+TITLE: and #+ROAM_KEY cite:citationkeyhere is created or opened in my org-Roam directory (~/Documents/MindMap/)

Above I was OK with that, but the more I get into it the more confusing this gets. I’m getting too many files that aren’t truly “permanent” notes in my Roam directory. To clean this up I’d like to put all my notes into the ~/Academic-Writing/bibliography/helm-notes/ directory and then just reference them via citations.

So, I guess I’m changing the nature of the question, but I’d appreciate any help.

I don’t have any helm specific configs outside of my other configuration files.

Org-Ref is configured:

;; Setup for org-ref and reftex

;; Start org-ref
(require 'org-ref)

;;(setq org-ref-insert-cite-key "C-c )")
;;(define-key global-map "\C-c )" 'org-ref-insert-cite-key)

;;set the keybinding for adding a bibtex entry from a query
(global-set-key (kbd "C-c n q") 'doi-utils-add-entry-from-crossref-query)
(global-set-key (kbd "C-c n w") 'isbn-to-bibtex)

;; These aren't specific to org-Ref, but are helpful here anyway.
(global-set-key (kbd "C-c n e") 'helm-bibtex)
(global-set-key (kbd "C-c l") 'org-store-link)

;;Allow the org-ref order of actions in helm-bibtex
(setq org-ref-helm-bibtex-action-preference 'org-ref)

(setq reftex-default-bibliography '("~/Documents/Academic-Writing/bibliography/general.bib"))

;; see org-ref for use of these variables
(setq org-ref-notes-function 'org-ref-notes-function-many-files)
(setq org-ref-notes-directory '("~/Documents/Academic-Writing/bibliography/helm-notes/")
         ;;org-ref-bibliography-notes '("~/Documents/Academic-Writing/bibliography/") 
         org-ref-default-bibliography '("~/Documents/Academic-Writing/bibliography/general.bib")
        org-ref-pdf-directory '("~/Documents/Academic-Writing/PDFs/"))

(setq bibtex-completion-bibliography  "~/Documents/Academic-Writing/bibliography/general.bib"
         bibtex-completion-library-path "~/Documents/Academic-Writing/PDFs"
         bibtex-completion-notes-path "~/Documents/Academic-Writing/bibliography/helm-notes")

My org-roam config file:

;; For all my org-roam settings

(use-package org-roam
      (after-init . org-roam-mode)
      (org-roam-directory "~/Documents/MindMap/")
      (org-roam-graph-executable "/usr/bin/dot")
      :bind (:map org-roam-mode-map
              (("C-c n l" . org-roam)
               ("C-c n f" . org-roam-find-file)
               ("C-c n j" . org-roam-jump-to-index)
               ("C-c n b" . org-roam-switch-to-buffer)
               ("C-c n g" . org-roam-graph))
             :map org-mode-map
              (("C-c n i" . org-roam-insert)))
      (require 'org-roam-protocol)
      (setq org-roam-capture-ref-templates
        '(("r" "ref" plain (function org-roam--capture-get-point)
           :file-name "${slug}"
           :head "#+TITLE: ${title}
#+ROAM_KEY: ${ref}

- source :: ${ref}
- tags :: "
           :unnarrowed t)))
      (setq org-roam-capture-templates
	        '(("d" "default" plain (function org-roam--capture-get-point)
           :file-name "${slug}"
           :head "#+TITLE: ${title}\n

- tags :: "
           :unnarrowed t)))

Finally my org-roam-bibtex configuration:

;; Config for the org-roam-bibtex package

(use-package org-roam-bibtex
  :hook (org-roam-mode . org-roam-bibtex-mode)
  :bind (:map org-mode-map
         (("C-c n a" . orb-note-actions))))

Outside of those I also have basic configs for deft and org-journal, but I don’t think those should be interfering with the problem I’m having.

To reiterate: When I create a note for a bibtex entry I expect it to go to ~/Documents/Academic-Writing/bibliography/helm-notes/ but instead it is created in ~/Documents/MindMap/ with org-roam headers which I would like to not have happen in the end.

Thank you!