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.
Best Answer
You are using the
achemso
document class. That class loadsnatbib
, which is incompatible withbiblatex
.If you want to submit to the ACS you should not use
biblatex
, you should use the.bst
style that comes bundled withachemso
(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
from loadingnatbib
. This should be doable with the approaches from biblatex instead of natbib in elsarticle, how?. You should not modifyachemso.cls
directly. But if you don't plan to submit to the ACS, you could also simply use another document class.