1

I'm trying to write my first LaTeX document, but I'm getting a wired error message with regards to using Texmaker to use biblatex. Whenever I try to compile my code the log highlights my \begin{document} line and states the following:

! Package biblatex Error: file "'Document name".bbl' not created by biblatex.

Where "Document name" is the name of my LaTeX file.

Here's my preamble:

\documentclass[11pt, twoside]{article}
\usepackage[margin = 2.5cm]{geometry}
\usepackage{amsfonts,mathtools,amssymb, amsthm}
\numberwithin{equation}{subsection}

\usepackage[none]{hyphenat}
\usepackage{gensymb}
\usepackage{changepage}
\usepackage{xcolor}
\usepackage{xfrac}
\usepackage{tabu}
\usepackage{booktabs,caption}
\usepackage[flushleft]{threeparttable}
\usepackage{graphicx}
\usepackage{float}
\usepackage{tabularx}

\usepackage[
    backend=biber,
    style = authoryear
    ]{biblatex}
\addbibresource{citations.bib}

Strangely, my test document for biblatex does work, which has the source code:

\documentclass[11pt]{article}

\usepackage[backend = biber,
    style = authoryear
]{biblatex}
\addbibresource{RFCN-citations.bib}

\begin{document}
This is a text for bibLaTeX. \cite{HistOfMaths}

\printbibliography
\end{document}

I'm using Texmaker v5.0.2 and Windows 10 as my environment. I've made sure to configure Texmaker, as per the following screencaps:

Texmaker configuration, Commands

Texmaker configuration, Quick Build

Texmaker configuration, Editor

I've been trying for 3 days now to get some sort of automated references within my document via some LaTeX package, and it's really starting to drive me insane.

moewe
  • 175,683
  • 3
    Delete the .bbl file. This was generated with another programme (probably BibTeX). If you delete it, it will be recreated by Biblatex on the next run. – cfr Jul 19 '18 at 03:25
  • Off-topic: best steer clear of tabu. – cfr Jul 19 '18 at 03:26
  • @cfr I can't believe that actually worked. I just stunned as to how Texmaker or LaTeX would be stupid enough to generate a file that breaks it. Thanks a bunch cfr! – Harrison O Jul 19 '18 at 03:40
  • You ran bibtex on the file. Or you told TeXmaker to run it. Nothing to do with LaTeX. Probably bibtex is default. You likely changed it to Biber. But then you're left with the file generated by BibTeX. – cfr Jul 19 '18 at 03:43
  • Just to make sure that the link to https://tex.stackexchange.com/q/154751/35864 is here. – moewe Jul 19 '18 at 04:59
  • @cfr Do you want to type up an answer, or should be close this as solved by deleting aux files? – moewe Jul 19 '18 at 04:59
  • An error or warning is no sign of stupidity. LaTeX (or packages) run sanity tests, so you don't make stupid mistakes by accident. Everytime you see a warning or error (in any program) somebody was thinking about possible situations and how to handle them. Alternative to errors: Files get deleted, overwritten, the program or computer stops working out of nothing. Errors and warnings are great. Do you really want to delete this file? is also a warning. – Johannes_B Jul 19 '18 at 05:26
  • @moewe Is there a good duplicate? This is quite a common issue, so I think it is worth having an answer. But I'm guessing there's a good answer already. If not, I can type one, sure. – cfr Jul 19 '18 at 22:32
  • @cfr I could not find something good, though I assume there must be a duplicate out there. So it would help if you could write up something here. – moewe Jul 20 '18 at 05:14
  • @moewe We have the generic delete all aux files and start over and the how to use biber with editor question. This one would fit both. – Johannes_B Jul 20 '18 at 05:57
  • @Johannes_B OK, I would be fine with a delete all aux files here, but I couoldn't find it. Can you add a link? The Biber editor question is relevant (especially given the title), so I already linked it here, but it does not solve the OP's problem. – moewe Jul 20 '18 at 06:02
  • @Johannes_B But it is the .bbl specifically which needs to be deleted. I don't know what 'delete all aux files' means. Should it be 'delete all generated files'? – cfr Jul 20 '18 at 23:53
  • @moewe You could surely write a better answer, but, for what it is worth, I had an inelegant go. – cfr Jul 21 '18 at 00:11

1 Answers1

3

When you first compile your .tex file, you produce some other files with information about the bibliography. You then run another tool to produce a .bbl file. That file is then read back when you recompile your document to produce the bibliography and citations.

But the format of the .bbl file depends on the tools you're using to generate the bibliography.

  • If you use BibTeX, the .bbl has a pretty straightforward format, which looks pretty much as your bibliography would look if you entered it by hand using the thebibliography environment.

  • If you use Biblatex and Biber, the .bbl has a very different format, which looks nothing like code for your bibliography would look if you entered it manually. This is because Biblatex parses this file in a much more sophisticated way.

The upshot of this is that whether you use Biblatex/Biber or BibTeX, the .bbl is read in when you recompile the document but, the format of that file has to match the tools you're using.

So, if you initially run bibtex <filename> to produce a .bbl and then try to recompile the document with a \usepackage{biblatex} line, Biblatex will find that the .bbl has the 'wrong' format. This can happen because you explicitly run bibtex or it can happen because your editor is configured to run bibtex automatically whenever you compile a document.

Whatever the cause, Biblatex will find that the .bbl format is the old-style format which looks like code for your bibliography, rather than the new-style format which doesn't and which Biblatex expects.

Hence, Biblatex will give you an error because it is faced with a .bbl which it knows is designed for a different bibliographic tool-set.

The point is that Biblatex will not overwrite or remove a file which you might not want it to, because that might be pretty bad. Instead, it tells you about the problem so that you can decide what to do.

What you typically want to do is to simply delete the .bbl file, recompile the document and run biber to generate a .bbl with the correct format. Then, when you recompile again, Biblatex will find a .bbl in the format it expects.

cfr
  • 198,882
  • +1) Question mark or bold citation key instead of citation number also has a very good explanation about the general workflow with bibliography backends. If you wanted, biblatex could delete .bbls not created for it automatically: https://tex.stackexchange.com/q/440473/35864 (that question is about .bbls in the wrong version, but the same strategy could be applied here). But letting biblatex delete auxiliary files on a whim is a bit too dangerous for my liking. – moewe Jul 21 '18 at 06:29