4

I am trying to convert my document from bibtex to biblatex to use some of the new features there.

I get this error:

! LaTeX Error: Command \bibhang already defined.

I assume that this is caused by a conflict between biblatex and one of my other packages but I have not been able to find it.

This is an example with the packages I am using:

\documentclass[journal=jacsat,manuscript=article]{achemso}
\setkeys{acs}{usetitle=true}
\usepackage[T1]{fontenc}         
\usepackage{dcolumn}    
\usepackage{subfigure}    
\usepackage{amsmath}    
\usepackage{xr}    
\usepackage{placeins}    
\usepackage{setspace}    
\usepackage[table,xcdraw]{xcolor}

\usepackage[backend=biber,style=chem-acs,maxbibnames=100]{biblatex}
\addbibresource{refs.bib}

\externaldocument{supporting-info}

\title{Title of my paper}

\author{Name}    
\affiliation{University}

\date{\today}

\begin{document}

text text text

\printbibliography

\end{document}

I tried to delete the lines referring to natbib from the achemso.sty file, but that did not resolve the issue.

From achemso.sty:

    %%\AtBeginDocument{
%%  \def\nmv@natbib@detect{%
%%    \ifNAT@super
%%      \expandafter\acs@nmv@activate
%%   \else
%%      \expandafter\acs@autonote
%%    \fi
%%  }
%%}

\ifacs@super
  %%\RequirePackage[sort&compress,numbers,super]{natbib}
\else
  %%\RequirePackage[sort&compress,numbers,round]{natbib}
  \def\citenumfont{\textit}
\fi

Edit: I should note that the program does produce a PDF but it gives me an error that I am trying to remove.

  • 6
    Welcome! If the journal tells you to use this class, they are unlikely to tolerate your use of Biblatex. If you aren't submitting to such a journal, use a class which doesn't impose a journal's house style on your document. Note that subfigure is obsolete and ought not be used. – cfr Jun 20 '17 at 0:24
  • 3
    Note that you are using the .cls file which loads natbib. Also note that you should not change any of these files without renaming them. That is, copy the file to a new name and edit that, if you wish. You should not edit the files in place or under their original names. – cfr Jun 20 '17 at 0:26
  • 2
    You are in general not allowed to change files you do not own. You cannot just remix your favourite Shakira song as well without getting into copyright trouble. – Johannes_B Jun 20 '17 at 4:54
  • 1
    If you ware going to submit to ACS, you can't use biblatex. Just use the achemso package and the bundled .bst files for BibTeX. See pubs.acs.org/page/4authors/submission/tex.html and ctan.org/tex-archive/macros/latex/contrib/achemso – moewe Jul 7 '17 at 20:30
3

You are using the achemso document class. That class loads natbib which is incompatible with biblatex.

If you want to submit to the ACS you should not use biblatex, you should use the .bst style that comes bundled with achemso (https://ctan.org/tex-archive/macros/latex/contrib/achemso).

If you do not plan to submit and just want to use this for your personal documents, you need a way to stop achemso.cls load natbib. This should be doable with the approaches from biblatex instead of natbib in elsarticle, how?. You should not modify achemso.cls directly. But if you don't plan to submit to the ACS, you could simply use another document class.

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.