ShareLaTeX and biblatex

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)

-
With backend=bibtex it works. – m0nhawk Mar 14 '13 at 11:09
– Claudio Fiandrino Mar 14 '13 at 11:21
Thanks! Adding backend=bibtex worked great! – petur Mar 14 '13 at 11:31
If you haven't seen this already: sharelatex.com/help/discussions/suggestions/… – Torbjørn T. Mar 14 '13 at 15:10
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

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.

-
It looks like almost two years later, biber is still not supported by ShareLaTeX. Is that correct? – Christoph Jan 12 at 21:39
Total of humanity's hours lost due to this bug: +1 – jeffalstott Aug 8 at 17:20

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}

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.

-
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 8 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 8 at 14:30
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 8 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 8 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 at 6:56