[Tex/LaTex] how to cite using emacs+auctex+reftex

auctexcitingemacsreftex

I recently switched from TeXStudio to Emacs/AUCTEX. The problem is that I don't know how to cite a paper. Here is a MWE:

\documentclass{article}
\usepackage[backend=biber,style=apa,apabackref=true,uniquelist=false]{biblatex}
\DeclareLanguageMapping{english}{english-apa}
\bibliography{p-dbase.bib}

\begin{document}
\textcite{Here is where I want autosuggestion on my papers' list to be appeared}

\printbibliography

\end{document}

Best Answer

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.