0

I am struggling with LaTeX on Overleaf. I am trying to produce a bibliography and I can, however, only if I select the article class. If I switch to RevTex4-1, it still produces the output I want, but also 14 errors... preventing me to export the project. my code is:

\documentclass{article} %I do not want this one
%\documentclass[preprint,superscriptaddress]{revtex4-2} I want this one, but is does not work!

\usepackage[backend=biber,style=numeric,citestyle=nature]{biblatex}

\addbibresource{BIB_test.bib} %Imports bibliography file

\begin{document}

First cite this guy\cite{hallo}, next this one\cite{world}.

\printbibliography
\end{document}

the bibfile is:

@article{hello,
author = {Cao, G. and McCall, S. and Crow, J. E. and Guertin, R. P.},
journal = {Physical Review Letters},
number = {9},
pages = {1751--1754},
title = {{Observation of a metallic antiferromagnetic phase and metal to nonmetal transition in Ca$_3$Ru$_2$O$_7$}},
volume = {78},
year = {1997}
}

@article{world,
author = {Alexander, C. S. and Cao, G. and Dobrosavljevic, V. and {Mc Call}, S. and Crow, J. E. and Lochner, E. and Guertin, R. P.},
doi = {10.1103/PhysRevB.60.R8422},
journal = {Phys. Rev. B},
number = {12},
pages = {R8422--R8425},
title = {{Destruction of the Mott insulating ground state of Ca$_2$RuO$_4$ by a structural transition}},
volume = {60},
year = {1999}
}

The main error I receive is that I should put \end{document} in the preamble. That cannot be true right?

6
  • Note that revtex4-1 is marked obsolete, you should probably move to revtex4-2 in any case. Also please provide a sample bib file such that others can easily test your code, and please cite the errors you get in overleaf. (you might want to mark your question with the overleaf tag) – daleif Dec 17 '20 at 9:16
  • Hi thanks for the comments. I added some information but I get 10 errors on overleaf. That might be too much for a forum? – RFermin Dec 17 '20 at 9:26
  • 3
    revtex requires natbib and this is incompatible with biblatex. If you want to use biblatex you should use another class. – Ulrike Fischer Dec 17 '20 at 9:32
  • Hi there, Tom from Overleaf Support here. It's nothing to do with Overleaf in particular. As Ulrike says, revtex and biblatex are incompatible, that's the issue. – yo' Dec 17 '20 at 9:39
  • In the end I solved it by adding \bibliographystyle{naturemag} at the end of the code, which does work with Revtex. @yo' Tom, interestingly I had to start a new Overleaf project in order to have it work. My code is equal but starting a new code is a prerequisite. Again thanks for the help! – RFermin Dec 18 '20 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.