12

I need to use the NeurIPS template. However, with the following minimal working example:

\documentclass{article}


\usepackage[final]{neurips_2019}
\usepackage[backend=bibtex, style=ieee]{biblatex}

\title{}

\begin{document}
\maketitle
\end{document}

(the .sty file is in the same path as the .tex file) I get:

! Package biblatex Error: Incompatible package 'natbib'.

How can I get around this error?

moewe
  • 175,683
Vorac
  • 743
  • 1
    Neurips seems to internally load natbib which can't be used in combination with biblatex. Therefore, drop biblatex and stick with the functionalities of natbib. – leandriis Nov 18 '19 at 06:31
  • @leandriis can you be more precise on your suggestion? When I uncommented \usepackage{biblatex} I had many new errors arising and even the pdf in overleaf failed to display. What do you want us to do? – Charlie Parker Dec 24 '21 at 19:41
  • did you try \usepackage[nonatbib, preprint]{neurips_2021}? I think that solved my problems. – Charlie Parker Dec 24 '21 at 19:47

2 Answers2

7

neurips_2019.sty loads the citation/bibliography package natbib. natbib is incompatible with biblatex since biblatex reimplements LaTeX's citation features completely. That's why you get the error

! Package biblatex Error: Incompatible package 'natbib'.

Since the package you need to use for submission loads natbib, the obvious way to resolve this issue is not to load biblatex. The accompanying file https://media.neurips.cc/Conferences/NeurIPS2019/Styles/neurips_2019.tex mentions that the exact citation style does not matter, so you could go with something like

\documentclass{article}

\usepackage[final]{neurips_2019}

\title{Lorem}
\author{A. Uthor}

\begin{document}
\cite{blub}
\bibliographystyle{plainnat}
\bibliography{mybibfile}
\end{document}

which is based on standard natbib styles.

moewe
  • 175,683
  • 1
    % to avoid loading the natbib package, add option nonatbib: % \usepackage[nonatbib]{neurips_2019} I saw it just now. – Vorac Nov 19 '19 at 18:40
  • 2
    @Vorac Even if it is possible not to load natbib with the style file (and it thus becomes possible to load biblatex) I would recommend against using biblatex in a submission unless the publisher explicitly allows biblatex. Since biblatex uses a completely different implementation of citations and bibliography than, thebibliography, classical BibTeX and natbib, publishers may not be able to deal with biblatex as expected. See for example https://tex.stackexchange.com/q/12175/35864. ... – moewe Nov 19 '19 at 19:15
  • 1
    ... It is usually safer to stick with natbib, especially if there is no need for advanced biblatex features or customisability. – moewe Nov 19 '19 at 19:15
  • Can someone clarify what natbib is and where it is loaded? I'm getting the original error in this post from the ICML template, but I don't see where natbib is loaded – Rylan Schaeffer May 30 '21 at 04:17
  • 2
    @RylanSchaeffer natbib is a LaTeX package that implements some nice features for bibliographies and citations. You can learn more about it in https://tex.stackexchange.com/q/25701/35864. In the example here the package was loaded by neurips_2019.sty. I don't know your template, so I can't tell you exactly where natbib is loaded. But if your template loads natbib you probably should be using natbib and not biblatex (the two are incompatible and if the publisher prefers natbib they probably have a reason for that). – moewe May 30 '21 at 05:01
  • now when I do \usepackage[nonatbib]{neurips_2021} I get the issue that the authors appears as anonymous...I don't want that! I want normal authors displayed in the paper. Any ideas? – Charlie Parker Dec 24 '21 at 19:45
  • Somehow for the problem was solved by doing \usepackage[nonatbib, preprint]{neurips_2021} – Charlie Parker Dec 24 '21 at 19:46
0

For me using \usepackage[nonatbib, preprint]{neurips_2021} and removing \usepackage{biblatex} worked.

e.g.

\documentclass{article}

% if you need to pass options to natbib, use, e.g.: % \PassOptionsToPackage{numbers, compress}{natbib} % before loading neurips_2021

% ready for submission % \usepackage{neurips_2021}

% to compile a preprint version, e.g., for submission to arXiv, add add the % [preprint] option: % \usepackage[preprint]{neurips_2021}

% to compile a camera-ready version, add the [final] option, e.g.: % \usepackage[final]{neurips_2021} % \usepackage[preprint]{neurips_2021}

% to avoid loading the natbib package, add option nonatbib: % \usepackage[nonatbib]{neurips_2021} \usepackage[nonatbib, preprint]{neurips_2021}

\usepackage[utf8]{inputenc} % allow utf-8 input \usepackage[T1]{fontenc} % use 8-bit T1 fonts \usepackage{hyperref} % hyperlinks \usepackage{url} % simple URL typesetting \usepackage{booktabs} % professional-quality tables \usepackage{amsfonts} % blackboard math symbols \usepackage{nicefrac} % compact symbols for 1/2, etc. \usepackage{microtype} % microtypography \usepackage{xcolor} % colors

\newcommand{\yx}[1]{{\small\color{blue}{\bf yx: #1}}} \newcommand{\sk}[1]{{\small\color{red}{\bf sk: #1}}} \newcommand{\bm}[1]{{\small\color{green}{\bf bm: #1}}}

%% my imports

\usepackage{biblatex} \addbibresource{egbib.bib} ...