1

I am currently typesetting my Ph.D. thesis with AucTeX and RefTeX and I would like to be able to interact with my citations in a way that is similar to what happens in org-modewith org-refe.g. being able to open the correponding PDF file or annotations right from the in-text citekey.

Currently I can bypass the problem by searchig the publication in helm-bibtex through its citekey, but I would be interested in knowing if a more direct solution is possible.

0

2 Answers 2

1

One strategy that is very simple is to define a function, and bind it to a convenient key. Here is one example. You just type C-o on a key, this function finds the key, then uses bibtex-completion to open it.

(require 'bibtex-completion)

(defun open-key-at-point ()
  (interactive)
  (let (start end key)
    (save-excursion
      (setq start (progn (re-search-backward "{\\|,") (match-end 0))
        end (progn (re-search-forward "}\\|,") (match-beginning 0))
        key (buffer-substring-no-properties start end)))
    
    (bibtex-completion-show-entry (list key))
    (bibtex-beginning-of-entry)))

(define-key tex-mode-map (kbd "C-o") #'open-key-at-point)

To get org-ref open on click behavior, you need to use font-lock to add properties to the citations. There is some code at https://github.com/jkitchin/org-ref/blob/org-ref-3/org-ref-latex.el that might work for you. It is not heavily tested. this version will eventually replace what is in the master branch.

0

The package bibtex-utils provides the function bu-jump-to-doc which takes you from a bibtex citation in a document to the pdf of that document. You'll need to bind it to a convenient key. For more details, and some related functions for dealing with Bibtex databases, see the home page for the package linked above.

If you use bibtex keys in different modes (i.e., markdown, org, latex), you might want to bind this to a key in the global map:

(global-set-key [f9] 'bu-jump-to-doc)

Otherwise, you can bind it to a key in whichever mode you want to access it from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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