emacs - AUCTeX: insert reference / citation without macro -
is there way add reference / citation format inserts reference / citation label directly buffer without enclosing macro?
to clear: when hit c-c )
auctex
prompts reference format, when hit return
it'll insert ~\ref{label}
buffer [after selecting appropriate reference in next buffer]. add reference format bound \?s
(space) inserts label
part.
that say: hit c-c )
, <space>
, select reference and... tadaa there's label
in buffer.
[edit:] have tried
(eval-after-load "latex" '(progn (add-to-list 'reftex-ref-style-alist '("default" t (("" ?\s))))))
however encloses label in curly braces , prepends ~
if there's word before point.
i have created solution adding around-advice
reftex-reference
, however, it's not pretty solution. i'll put answer i'm still hoping better solution.
(eval-after-load "latex" '(progn (add-to-list 'reftex-ref-style-alist '("default" t (("label only" ?\s)))) (defadvice reftex-format-special (around reftex-format-special-labely-only activate) "advice `reftex-format-special' such if refstyle \"label only\" insert reference's label." (if (string= (ad-get-arg 2) "label only") (setq ad-return-value (format "%s" (ad-get-arg 0))) ad-do-it))))
Comments
Post a Comment