0

I have a bib file, say by the name of "mybib", for which I have cited hundreds of times in this document. However, it was brought to my attention that I need to change the style to Chicago, so I attempted to do so in an ill-informed manner.

I changed the bibliography style below (which was originally just set as natbib) to biblatex-chicago. I then undid that change and am now receiving issues from compiling my bibfile stating that it finds no \citation commands, no \bibdata command and no \bibstyle command. In my original document I have the following:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{bm}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{float}
\usepackage{breqn}
\usepackage{bbm}
\usepackage{cleveref}
\usepackage[authoryear]{natbib}
\begin{document}

blah blah blah...

\newpage
\nocite{*}
\bibliographystyle{plainnat}
\bibliography{mybib}


\end{document}
yungmist
  • 3
  • 2
  • 2
    Remove all temporary files (.aux, .bbl, .bcf, ...) and recompile from scratch with LaTeX, BibTeX, LaTeX, LaTeX (here "LaTeX" can be replaced with your favourite flavour of LaTeX: pdfLaTeX, LuaLaTeX, XeLaTeX, ...). The code as shown should in principle work. – moewe May 25 '20 at 19:56
  • Thank you @moewe, that worked! Where can I read up more to understand your solution? – yungmist May 25 '20 at 20:31
  • I'd have expected that most introductory tutorials would at least mention auxiliary and temporary files briefly. Essentially those files contain information LaTeX needs to keep in mind between LaTeX runs. Multiple runs are often necessary because LaTeX can't "look into the future", so for example \refs to \labels are resolved via the .aux file to make sure you can \ref a \label everywhere and not only after it was set. With BibTeX/biblatex the .bbl file contains the bibliography data in LaTeX-readable format. – moewe May 26 '20 at 05:14
  • https://tex.stackexchange.com/q/7770/35864 lists a number of different auxiliary files and briefly explain what they do. https://tex.stackexchange.com/q/111280/35864 explains the basics of \label and \ref and also touches the role of the .aux file there. https://tex.stackexchange.com/q/63852/35864 explains the basics of bibliographies with BibTeX/biblatex and mentions .bbl files. – moewe May 26 '20 at 05:17

1 Answers1

1

If you switch between biblatex and BibTeX-based bibliography solutions (natbib, cite, jurabib, ...) you should delete the auxiliary files before you recompile. In particular you should remove the .aux, .bbl and .bcf files (if present).

The .aux file may contain biblatex-specific commands that are undefined when biblatex is not loaded and may thus throw errors about undefined control sequences. Furthermore, the .aux file generated with biblatex will not contain (the correct) commands for BibTeX to run.

The .bbl file generated for biblatex usually contains a check if biblatex is loaded. That means that the files will throw an error if biblatex is not loaded.

Since these auxiliary files are temporary in nature, they can safely be deleted and will be regenerated as needed on the next LaTeX run(s). You will have to compile your document with LaTeX, BibTeX, LaTeX, LaTeX (where "LaTeX" can be your favourite flavour of LaTeX: pdfLaTeX, LuaLaTeX, XeLaTeX, ...), see also Question mark or bold citation key instead of citation number.


The temporary files usually hold data that other programs generate for LaTeX (the .bbl is generated by BibTeX or Biber for LaTeX and contains the data of the requested .bib entries in LaTeX-understandable format) or that LaTeX itself needs to keep in mind between LaTeX runs (.aux, .toc, .lof, .lot, ..., LaTeX can't look into the future, so in order to be able to refer to objects that come later in the source code LaTeX uses a two-pass system that writes the object data to a temporary file and reads the temporary file at the beginning of the next LaTeX run: then all data is available directly from the start).

moewe
  • 175,683