2

I created a simple BibTeX file as well as a simple LaTeX file that references said BibTeX file. However, when I printed out the LaTex file in pdf format by running C-c C-a (which, according to the AUCTeX manual, runs BibTeX, amongst other things),the bibliography section didn't appear and the citations were broken.

Trying to debug the problem, I replaced the single C-c C-a command by a sequence of C-c C-c commands (since, according to the AUCTeX manual section linked to above, C-c C-a is an abbreviation for such a sequence), and noticed that the bibtex command was not executed.

A similar question was posted in the past, to which the solution was to add a couple lines to the initialization file, but these lines are already in my initialization file.

Bibliography.bib

@book{WEN08,
    Author = {Jochen Wengenroth},
    Date-Added = {2017-05-08 08:16:51 +0000},
    Date-Modified = {2017-05-08 08:19:24 +0000},
    Publisher = {de Gruyter},
    Title = {Wahrscheinlichkeitstheorie},
    Year = {2008}}

MyDoc.tex

\documentclass[11pt]{article}
\usepackage{cite}

\begin{document}

\title{My Article}
\author{Nobody Jr.}
\date{Today}
\maketitle

Blablabla said Nobody ~\cite{WEN08}. 

\bibliography{Bibliography}{}
\bibliographystyle{plain}
\end{document}

.emacs includes the following lines:

(setq TeX-auto-save t)
(setq TeX-parse-self t)

Resulting pdf file
Resulting pdf file with a blank bibliography and a broken citation


AUCTeX 11.90.0
Emacs 25.1.1
TeX Live 2016, v. 3.14159265
macOS Sierra, v. 10.12.4

Drew
  • 77,472
  • 10
  • 114
  • 243
Evan Aad
  • 1,541
  • 1
  • 14
  • 30
  • Did you restart Emacs after setting the init file? – giordano May 08 '17 at 10:24
  • @giordano: The init file had had these lines to begin with. – Evan Aad May 08 '17 at 10:26
  • I see. Unfortunately, I can't reproduce the issue. – giordano May 08 '17 at 10:27
  • Crosspost: https://tex.stackexchange.com/q/368708/31416 – giordano May 08 '17 at 10:28
  • @giordano: If you read the comments section in the crosspost you'll see that egreg was able to reproduce the issue, so it's not just me. – Evan Aad May 08 '17 at 10:29
  • 1
    What does C-h v LaTeX-bibliography-list RET return in MyDoc.tex buffer? – giordano May 08 '17 at 10:32
  • @giordano: 'Its value is nil' – Evan Aad May 08 '17 at 10:35
  • 3
    Then parsing isn't working correctly for you (don't know why). It should be (("Bibliography")) and it's so for me. Try issuing C-c C-n in MyDoc.tex buffer and then check again the value of the variable. – giordano May 08 '17 at 10:36
  • @giordano: Sorry for the late reply. I closed Emacs and reopened it, and then issued C-c C-n, as per your suggestion. Then I issued C-c C-a, and the resulting pdf file had the bibliography section as well as the citation. So all is well. Thank you! What does C-c C-n do? – Evan Aad May 08 '17 at 11:49

1 Answers1

5

For some reason, the file wasn't actually parsed, so AUCTeX didn't know about the bibliography file. This shouldn't usually happen if you set TeX-parse-self and TeX-auto-save to t, but you can easily trigger parsing with C-c C-n (TeX-normal-mode).

giordano
  • 3,255
  • 14
  • 19