[Tex/LaTex] Command \bibhang already defined with Zotero

biblatexcross-referencingnatbibtemplateszotero

I'm trying to use a Zotero .bib file for the citation backend in this template document setup below but I get the error:

/usr/share/texlive/texmf-dist/tex/latex/biblatex/biblatex.sty:462:
LaTeX Error:
 Command \bibhang already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.462 \newlength{\bibhang} 

Setup:

\documentclass[a4paper,fleqn,usenatbib]{mnras}
\usepackage{newtxtext,newtxmath}
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}
\usepackage{graphicx}   % Including figure files
\usepackage{amsmath}    % Advanced maths commands
\usepackage{amssymb}    % Extra maths symbols
\usepackage[backend=bibtex,style= authoryear,citestyle=authoryear]{biblatex}
\addbibresource{Zotero.bib}

Looking at other posts I believe this is a clash between biblatex and natbib but I can't seem to use the zotero backend without using \usepackage[backend=bibtex,style= authoryear,citestyle=authoryear]{biblatex} and it won't accept nanbib in the curly brackets.

Is there a way to fix this so that Zotero is recognised using natbib in this way?

Best Answer

If you are submitting your paper for MNRAS

If you are submitting a paper for MNRAS you should not be using biblatex. The mnras documentation mentions two ways to produce a bibliography

  1. The manual way with thebibliography and
  2. the automatic way with BibTeX and natbib.

biblatex and natbib are completely incompatible with each other (see bibtex vs. biber and biblatex vs. natbib for a short comparison) and it is unlikely that publishers can accept biblatex submissions (see Biblatex: submitting to a journal). So biblatex is out of the question.

Of the two ways the automatic way with natbib and BibTeX seems to be strongly preferred (p. 7 of the MNRAS documentation)

This is implemented in LaTeX via the natbib package, which in turn is included via the usenatbib package option (see section 4), which should be used in all papers.

and

It is possible to enter references manually using the usual LaTeX commands, but we strongly encourage authors to use BibTeX instead.

So you should dump biblatex and use natbib as advised instead. That means you need to follow What to do to switch to biblatex? in reverse so that your document looks roughly like

\documentclass[a4paper,fleqn,usenatbib]{mnras}
\usepackage[T1]{fontenc}

\begin{document}
\cite{sigfridsson}

\bibliographystyle{mnras}
\bibliography{biblatex-examples}
\end{document}

See also http://mirrors.ctan.org/macros/latex/contrib/mnras/mnras_template.tex

No mention of \addbibresource and \printbibliography can remain (the two are biblatex commands) instead you place \bibliography{<name of bib file without the .bib extension>} where you want the bibliography to appear.

You may be able to tell Zotero to prepare a .bib file for the BibTeX data model instead of biblatex. Even though the general structure of the file is the same for the two data models, there are subtle differences between best practices for biblatex and best practices for .bst files (note that while again the general structure of the .bib files should be the same for most .bst files there can be differences in the fields and types supported - some old styles don't have a url field while many new ones do). For the more common types @article, @book, @incollection it probably does not matter too much, but more fringe types may need special care.


If you are not planning on submitting your paper for MNRAS

If you are not planning to submit your document for the MNRAS you should probably not be using the mnras document class. This class is specifically tailored for MNRAS submissions. Publisher classes sometimes have idiosyncrasies and may be hard or impossible to customise (why should they be customisable after all? - they just need to enforce the house style and enable easy processing for the publisher).