[Tex/LaTex] Elsarticle – number bibliography not working

bibtexelsarticle

I am trying to correctly format an article for Computers & Operations Research. They say I should use the "number" format to cite.

I use elsarticle.cls and the documentation says that number should be the standard option loaded. This does not seem to be the case as \cite{smth} outputs Author[1] and I don't want Author to be there.

When I use the option \documentclass[preprint,number,12pt]{elsarticle}

I get the error:

! Package natbib Error: Bibliography not compatible with author-year citations.

(natbib)                Press <return> to continue in numerical citation style.


See the natbib package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.191 ...and\NAT@force@numbers{}\NAT@force@numbers

I have tried many bibliographystyles, among which
\bibliographystyle{elsarticle-num}

Any suggestions?

Here is a stripped version of my document (I have kept my packages just in case there is a problem there)

\documentclass[preprint,number,12pt]{elsarticle}
\usepackage{amssymb}
\usepackage[nodots,nocompress]{numcompress}
\usepackage[utf8]{inputenc}
\usepackage{musixtex}
%\usepackage{natbib} %use of natbib package, necessary for customized cmj BibTeX style
%\usepackage{cite}
\usepackage{etex} 
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{fancybox}
\usepackage{pgfplots}
\usepackage{url}
\pgfplotsset{compat=1.3} 
\usepackage{subfigure}
\usepackage{booktabs} %voor mooiere tabellekes
\usepackage{float}
\usepackage{setspace}
\begin{document}
\cite{klapuri2004automatic}
\bibliographystyle{elsarticle-num}
\bibliography{paper}
\end{document}

The pdf actually displays well now (except for the \citet commands, which display as "author error"). But compilation is aborted, so that should not happen.

And the .bib entry (there where about 50, but I just took one to test)

@article{klapuri2004automatic,
  title={Automatic music transcription as we know it today},
  author={Klapuri, A.P.},
  journal={Journal of New Music Research},
  volume={33},
  number={3},
  pages={269--282},
  year={2004},
  publisher={Taylor \& Francis}
}

This is a link to the bst file I am using: https://www.dropbox.com/s/4jrnxb5twjwl9xm/elsarticle-num.bst

and elsarticle.cls https://www.dropbox.com/s/s6qgfbxyz57gci0/elsarticle.cls

Best Answer

The elsarticle class already loads natbib with some option that you provide as class options. In your example, the class option number means numerical mode. Your MWE actually works fine, if you still get errors with that, remove the .bbl and .aux file first, then recompile afresh.

If you want to use \citet correctly, the bibliography style has to support that (the \bibitem has to have the right optional argument). You could replace elsarticle-num by elsarticle-harv, e.g.