major mode functions - emacs-citar/citar GitHub Wiki

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))))