0

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?

  • 2
    If you use the mnras document class you are strongly advised to use natbib. It is unlikely that a submission with biblatex can be processed properly (see tex.stackexchange.com/q/12175/35864). biblatex and natbib are incompatible, so you can't load biblatex. Zotero is just a reference manager that produces .bib files. You should be able to use those .bib files (with a few modifications that Zotero should be able to do automatically) with natbib. – moewe Jun 26 '18 at 10:33
  • 1
    Are you planning to submit your paper for MNRAS? – moewe Jun 26 '18 at 10:34
  • Okay so I can get rid of the backend comment I wrote in the last paragraph and alter the .bib file to work with the template? Yes I'm using the latest MNRAS template in the above example and intending to publish..do you think using Zotero .bib files are unwise for this? – user8188120 Jun 26 '18 at 10:39
  • 1
    No Zotero .bib files should be fine as long as the file plays nicely with the style used by the MNRAS template. There a subtle differences in best practices between a .bib file prepared for biblatex and those for other .bst files (note that there is no uniform data model for all BibTeX styles, just a framework). You will probably have to tell Zotero to export for BibTeX and not for biblatex. Ideally that should be it. – moewe Jun 26 '18 at 10:42
  • Ah okay that's good then, it doesn't look like it's playing well with the document as I have \addbibresource giving an undefined control sequence error, maybe I need to use a packege to handle that command. – user8188120 Jun 26 '18 at 10:45
2

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).

  • That worked beautifully it was the \bibliographystyle{mnras} \bibliography{biblatex-examples} ...part that I was missing in trying to get it to work. Thanks so much! – user8188120 Jun 26 '18 at 11:53

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.