Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Jubobs Mar 21 '13 at 19:02
    
You are right, I have added the example –  dorien Mar 21 '13 at 20:11
    
@dorien Without the .bib entry for klapuri2004automatic only conjectures can be made. –  egreg Mar 21 '13 at 21:51
    
I hope it is more complete now. –  dorien Mar 22 '13 at 8:59
add comment

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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