Jeffrey Spencer <[email protected]> writes:
> 1) I was wondering if anyone has got the reftex feature of easily
> recognizing the figures and equations to insert as a ref command to work in
> org-mode.
I haven't gotten this to work. It's doable, but requires some work.
For now I'd be happy if I could replace the \ref
> 2) Also I had seen on a website that you can use the command to get
> org-mode type citations. This seems to export to latex as a \ref command
> with citep in the middle (eg. \ref{citep}).
> (reftex-set-cite-format
> "[[citep][%l]]")
> This doesn't seem to work for me but maybe I'm doing something wrong.
Here's my setup which works decently:
#+begin_src emacs-lisp
(defun org-mode-reftex-setup ()
(load-library "reftex")
(and (buffer-file-name)
(file-exists-p (buffer-file-name))
(reftex-parse-all))
(make-local-variable 'reftex-cite-format)
(setq reftex-cite-format 'org)
(define-key org-mode-map (kbd "C-c )") 'reftex-citation))
(add-hook 'org-mode-hook 'org-mode-reftex-setup)
(eval-after-load 'reftex-vars
'(progn
(add-to-list 'reftex-cite-format-builtin
'(org "Org-mode citation"
((?\C-m . "[[cite:%l]]")
(?t . "[[textcite:%l]]")
(?p . "[[parencite:%l]]")
(?s . "[[posscite:%l]]")
(?a . "[[citeauthor:%l]]")
(?y . "[[citeyear:%l]]"))))))
#+end_src
I add nodes manually with C-l after inserting, if needed.
–Rasmus
--
⠠⠵