[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Question about reftex mode in org-mode
From: |
Rasmus |
Subject: |
Re: [O] Question about reftex mode in org-mode |
Date: |
Sat, 06 Apr 2013 23:55:19 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
"Robert P. Goldman" <address@hidden> writes:
> Quite some time ago, I incorporated reftex into my use of org mode, per
> a suggestion on Worg:
>
> ;;;---------------------------------------------------------------------------
> ;;; Use reftex with org-mode, per Worg
> ;;;---------------------------------------------------------------------------
>
> (autoload 'turn-on-reftx "reftex" "Turn on RefTeX mode." t)
> (defun org-mode-reftex-setup ()
> (turn-on-reftex))
> (add-hook 'org-mode-hook 'org-mode-reftex-setup)
>
> Now I find that this has a bad behavior at least with Aquamacs: it can
> cause attempts to use the menu bar to be interrupted by a cryptic popup
> file selector that says "Master file:"
>
> This seems to be reftex trying to set a value for TeX-master.
>
> So maybe reftex is unhappy when it's not invoked inside of AucTeX (where
> TeX-master is defined and set).
>
> Anyone else seen this? Have a solution (e.g., have org files assume
> that TeX-master is t)?
I haven't seen it. This is my setup:
#+begin_src emacs-lisp
(setq reftex-default-bibliography
(quote ("~/documents/literature/lit.bib")))
(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 . "[[citepos:%l]]")
(?a . "[[citeauthor:%l]]")
(?y . "[[citeyear:%l]]")
(?n . "%l")
;; the following depends on
org-link-search-must-match-exact-headline
(?o .
"[[file:~/documents/literature/lit.org::*%t][%2a (%y). %T]]"))))))
#+end_src
--
A page of history is worth a volume of logic