8

I'm writing my thesis with my friend but I'm having serious problems getting biblatex to work with ShareLaTeX, it apparently has support (according to this blog: http://www.clarusft.com/sharelatex/).

However, I can't get it to work properly, or at all to be honest.

I have included this in the top.

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber]{biblatex} % I try to use biber.
\bibliography{ref} % the ref.bib file
\begin{document}

Hi there, Stackoverflowers\cite{lol}
\printbibliography 
\end{document}

And here is my ref.bib file:

@article
{lol,
author = "Anders Ekholm",
title = "Den ljusnande framtid är vård",
year = "2010" 
}

This doesn't work.

I get the errors:

main.tex:55 Citation 'lol' on page 1 undefined. 
main.tex:274 Empty bibliography. 
undefined:undefined There were undefined references.
undefined:undefined [biblatex] Please (re)run Biber on the file: output and rerun LaTeX afterwards. (page 23)
petur
  • 181
  • 1
  • 1
  • 4
  • 3
    With backend=bibtex it works. – m0nhawk Mar 14 '13 at 11:09
  • If you haven't seen this already: http://www.sharelatex.com/help/discussions/suggestions/40-biber-support-in-sharelatex – Torbjørn T. Mar 14 '13 at 15:10
  • 3
    James from ShareLaTeX here. Sorry that we're a bit behind the times with our lack of biber support. Bibtex should work though. I've bumped this up our todo list since I think it's catching people out. Feel free to drop us a support query directly if you ever have similar problems again. – jpallen Mar 15 '13 at 10:43
  • Thanks a lot James, I feel really great about your direct support here, and I will try to use the support thingy. However, Stackexchange works really well with being placed on google search results, since they are so often relevant, so maybe I'll try to post on both places. – petur Mar 19 '13 at 10:11
  • @jpallen I am experiencing exactly the same problem. However, I cannot make it work even with backend=bibtex. I copy/pasted the code and used a sample *.bib file. I think there is a major bug here. – deps_stats Feb 25 '14 at 19:32
  • 2
    As of today, the biber backend works in sharelatex. – Evpok Jun 06 '14 at 09:06
  • we now have some bibliography templates, including a basic Bibtex example, which you can look at to help things https://www.sharelatex.com/templates/bibliographies – henry.oswald May 03 '13 at 09:00

3 Answers3

4

Luckily, this answer is outdated, ShareLaTeX now supports biber. See the other answers if you still have problems.


jpallen wrote in the comment:

James from ShareLaTeX here. Sorry that we're a bit behind the times with our lack of Biber support. BibTeX should work though. I've bumped this up our todo list since I think it's catching people out. Feel free to drop us a support query directly if you ever have similar problems again.

Marco Daniel
  • 95,681
2

I've just managed ShareLaTeX (and Overleaf) to work with biber backend. I've found two ways:

  1. Include the content of your .bib file into the main file

    \usepackage{filecontents}
    \begin{filecontents}{bib}
    your bib file contents goes here
    }
    \end{filecontents}
    
    \usepackage[backend=biber]{biblatex}
    \addbibresource{bib}
    
  2. use the path specifier when adding your .bib file

    \addbibresource{./ref.bib}
    

By the way, you should use command \addbibresource{} in BibLaTeX, and not \bibliography{ref}

Here's the link to ShareLaTeX project with your MWE, and here's the same repeated on Overleaf.

  • 1
    I don't think the first item is a requirement. In ShareLaTeX you can upload a file to form part of your project. The second option also seems superfluous given that you don't use that notation in the first. The main problem seems to be that the OP used \bibliography instead of \addbibresource. – Werner Oct 08 '15 at 14:24
  • I've made a project on ShareLaTeX to illustrate the second option. The same .bib resource is added with and without dot slash. You can try to comment/uncomment the corresponding lines and see what happens. – Oleg Soloviev Oct 08 '15 at 14:30
  • 1
    What I'm trying to point out is that your answer is not consistent. The first option doesn't use ./ while the second does. – Werner Oct 08 '15 at 14:32
  • yes, you're true. And I don't know why. And I have just checked once again, to make it work on ShareLatex, I've actually used \bibliography{./ref}. and with \addbibresource{} option 2 seems not to work anyway. I'm puzzled now... – Oleg Soloviev Oct 08 '15 at 14:37
  • Mhhh, I just played around with sharelatex and everything worked fine even if I didn't include the ./ part. Even in your example there was no trouble with \addbibresource{ref.bib}. \bibliography{ref} worked as well (even though it is officially deprecated in biblatex) – moewe Oct 12 '15 at 06:56
1

As @Evpoc wrote in the comments, Sharelatex supports biber for quite some time now. However, I several times still received that error message.

I found that changing \addbibresource{ref.bib} to \addbibresource{ref}, compiling, changing it back and compiling again resolves the problem.

I suspect it is caused by some temporary files of biber that Sharelatex does not remove upon clear cached files.

jan-glx
  • 750
  • 1
  • 7
  • 12