how to cite using emacs+auctex+reftex
Like for any other macro you want to insert in AUCTeX, you should use C-c RET cite
RET (or C-c C-m cite
RET; for more information about autocompletion in AUCTeX see the quick start or Completion section of the manual). This works also for all other citation macros provided by natbib
, biblatex
, ect... (\citep
, \citealt
, \parencite
, \textcite
, etc...)
For the particular case of bibliography commands, you may want to take advantage of the great package RefTeX. AUCTeX has a basic support for bibliographic commands also without RefTeX, but this package provides a far superior completion.
In order to automatically start RefTeX when you open a LaTeX file add the following code to your init file
;; Turn on RefTeX in AUCTeX
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;; Activate nice interface between RefTeX and AUCTeX
(setq reftex-plug-into-AUCTeX t)
In this way, you can still insert a \cite
command with C-c RET cite
RET, but you can also use the key-binding C-c [. RefTeX overtakes the task to provide completion of bibliographic entries, but you can continue using the usual AUCTeX-way to insert macros.
The command you need here is reftex-citation
, which is bound to C-c [
by default. There is more info in the manual
Alternatively, you can use helm-bibtex in place of reftex. Helm-bibtex is more powerful, but it lacks a few features that reftex has, such as allowing you to search your records on different fields.