I have a large LaTex project, which I organized into several .tex files and use \input{} in a single file to include the content of the other files. However, when editing this project from spacemacs, I run into some trouble, because spacemacs cannot find cross references from the other .tex files nor can it find citations from my .bib file at all.

Autocomplete only works for labels defined in the same .tex file when I use \ref{}, while autocomplete doesn't work at all when using \cite{}, I receive the following error when trying to use autocomplete in a cite command:

cite: info not available, use ‘M-RET r v’ to get it.

Then if I push M-RET r v, I receive a new error:

reftex-view-cr-cite: Cannot display crossref

Calling reftex-citation results in the following error:

reftex-offer-bib-menu: No valid bibliography in this document, and no default available

My project structure is the following: I have a makefile in the root directory in my project and all .tex files along with the bib file is located in a subdirectory. I include the bibliography in my main .tex file using \bibliography{Texfiles/references.bib}.

These are the layers I have in my .spacemacs file:

     ;; ----------------------------------------------------------------
     ;; Example of useful layers you may want to use right away.
     ;; Uncomment some layer names and press <SPC f e R> (Vim style) or
     ;; <M-m f e R> (Emacs style) to install them.
     ;; ----------------------------------------------------------------
     ;; better-defaults
     ;; (shell :variables
     ;;        shell-default-height 30
     ;;        shell-default-position 'bottom)
     ;; version-control

I also call

;; 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 dotspacemacs/user-config ().

Does anyone know how could I get cross references and citations to work?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.