Skip to content

major mode functions

Bruce D'Arcus edited this page Dec 2, 2021 · 2 revisions

Using a different citation insert function

Here's an example using the org-ref v3 syntax:

(defun my/org-ref-insert (keys)
  "Format KEYS for org-ref v3 cite syntax."
  (format "[cite:%s]"
    (string-join (mapcar (lambda (k) (format "&%s" k)) keys) ";")))

Since you presumably only need this when using org-ref, we remove many of the functions here, and just include these:

 (setq citar-major-mode-functions
  '(((org-mode) .
     ((local-bib-files . citar-org-local-bib-files)
      (insert-citation . my/org-ref-insert))))
Clone this wiki locally