0

The following code from org-ref defines a citation link:

(defun org-ref-define-citation-link (type &optional key)
  "Add a citation link of TYPE for `org-ref'.
With optional KEY, set the reftex binding.  For example:
\(org-ref-define-citation-link \"citez\" ?z) will create a new
citez link, with reftex key of z, and the completion function."
  (interactive "sCitation Type: \ncKey: ")

  ;; create the formatting function
  (eval `(org-ref-make-format-function ,type))

  (eval
   `(if (fboundp 'org-link-set-parameters)
    (org-link-set-parameters
     ,type
     :follow (lambda (_path) (funcall org-ref-cite-onclick-function nil))
     :export (quote ,(intern (format "org-ref-format-%s" type)))
     :complete (quote ,(intern (format "org-%s-complete-link" type)))
     :help-echo (lambda (window object position)
              (when org-ref-show-citation-on-enter
            (save-excursion
              (goto-char position)
              ;; Here we wrap the citation string to a reasonable size.
              (let ((s (org-ref-format-entry
                    (org-ref-get-bibtex-key-under-cursor))))
                (with-temp-buffer
                  (insert s)
                  (fill-paragraph)
                  (buffer-string))))))
     :face 'org-ref-cite-face
     :display 'full
     :keymap org-ref-cite-keymap)
      (org-add-link-type
       ,type
       (lambda (_path) (funcall org-ref-cite-onclick-function nil))
       (quote ,(intern (format "org-ref-format-%s" type)))))) 

Is there a non-intrusive way to modify only the :export part?

1

yes, but you have to do it for each link. Assuming you are using org 9, you can do it like this in an init file, or in an elisp src block in your org-file:

(org-link-set-parameters "cite" :export 'some-new-export-function)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.