10

After a few days break I went back to working on a report. When I tried to compile I got the following warning:

Package biblatex Warning: Data encoding is 'utf8'.
(biblatex)                Use backend=biber.

I haven't changed a thing since last week, when it worked. I did open the file on someone else's laptop, but didn't touch the code. I am using ShareLaTeX. The relevant code is (I think):

\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {images/} }

\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}
\usepackage{float}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[backend=bibtex,style=authoryear,sorting=none]{biblatex}
\addbibresource{references.bib}

\printbibliography

References are in the form of:

@book{griffiths,
    author        = {D.J. Griffiths},
    title         = {Introduction to Quantum Mechanics},
    year          = {2005},
    publisher     = {Pearson Education Inc.},
    location      = {USA, New Jersey, Upper Saddle River}
}

EDIT: When I change the backend to biber, the file doesn't recognise any references, and the log says:

Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                output
(biblatex)                and rerun LaTeX afterwards.

I'm unsure how to do this in ShareLaTeX. Consider me a simple mortal, who is not knowledgeable about much outside of basic report writing.

Timsey
  • 327
  • Just change backend=bibtex to backend=biber. bibtex can only handle files in ascii encoding. – Guido Jun 09 '14 at 15:20
  • Right, I forgot to mention that doing that causes the file to not recognise any references. Sorry about that. – Timsey Jun 09 '14 at 15:29
  • 1
    Did you rerun biber and latex, as said in the .log? – Bernard Jun 09 '14 at 15:45
  • I'm unsure how I do that. ShareLaTeX only has this big 'Compile/Recompile' button, instead of separate ones for .bib and .tex files. Repeatedly pressing that did not fix the problem. Clearing the cache didn't help either. – Timsey Jun 09 '14 at 15:50
  • 1
    As far as I know, ShareLaTeX does not support Biber, so you are stuck with BibTeX. The original warning (it is not an error) suggests that your document (I suppose the .bib file) was recognised as being UTF8 encoded (probably due to an UTF8 character), biblatex suggests you use Biber as this back-end is able to deal with UTF8 while BibTeX is not. So you can either ignore the warning (but keep an eye open for mangled characters and other encoding issues) or make sure your .bib file at least is 100% ASCII (I'm not sure whether UTF8 in the .tex file also triggers the warning). – moewe Jun 09 '14 at 16:02
  • 2
    If you choose to make your .bib file ascii-encoded (or similar), but want your document to remain in utf8, you might have to use the bibencoding option, please refer to §2.4.3.4 Specifying Encodings, pp. 41-43 of the biblatex documentation. Also make sure you properly escape non ascii-chars (see How to write “ä” and other umlauts ... or refer to biblatex-examples.bib). – moewe Jun 09 '14 at 16:11
  • The line \usepackage[utf8]{inputenc} is the reason for that, right? I suppose I have no reason to use utf8 over ascii, at least for now. Removing that line fixed the problem, so thank you! – Timsey Jun 09 '14 at 16:22
  • That is one way to fix the problem, yes. In general, biblatex needs t know the encoding of both the .tex and the .bib file (it is good at guessing, but sometimes things can go wrong (see the section in the documentation I linked to above)). If biblatex suspects you want UTF8 and you use BibTeX you get a warning since BibTeX cannot support UTF8. So removing \usepackage[utf8]{inputenc} and thereby effectively reverting to acii gets rid of the warning. – moewe Jun 09 '14 at 16:28
  • @moewe sharelatex supports biber – Guido Jun 09 '14 at 17:00
  • @Guido Oh, OK, I thought I had in the back of my mind that sharelatex did not support Biber, when I googled it, it found this feature request from March 2013. Could you write up an answer for ShareLaTeX and biblatex on how to use Biber with shareLaTeX as obviously it did not seem to work here at first. – moewe Jun 09 '14 at 17:15
  • 2
    The warning is not related to the bib file or bibltex "knowing" something about the content of the bib file. It is triggered by the inputenc option. biblatex guesses that if your document uses utf8 then perhaps the bib-file and perhaps there are non-ascii chars and perhaps something could go wrong. If your bib-file has only english entries I wouldn't worry. And if you have non-ascii chars: Check their output. – Ulrike Fischer Jun 09 '14 at 17:16
  • @Guido Want to write an answer at ShareLaTeX and biblatex so we can close this as a duplicate? – Johannes_B Dec 06 '14 at 14:38

1 Answers1

12

The answer is in the comments, but since nobody wrote an complete answer, I will.

Bibtex requires ascii encoding. If your document is set to utf8 encoding, bibtex will assume the bib file also is utf8. Therefore, you have to be sure your bib file is ascii encoded, and you have to tell bibtex to consider it as ascii.

In your case, biblatex package should be loaded with the following options:

\usepackage[backend=bibtex,bibencoding=ascii,style=authoryear,sorting=none]{biblatex}

The other option is to use biber as backend. In that case, the bib file can be utf8 encoded.