4

If I use elsarticle as follows, then pdf latex launched the errors. Can I use the the follwoing commands for bibliography?

\documentclass[preprint,12pt]{elsarticle}
 \usepackage[square,numbers,sort&compress]{natbib}
  \bibliographystyle{unsrt}
 \usepackage{usebib}

Error

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)
 restricted \write18 enabled.
entering extended mode
(./elsarticle-template-num-names.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.
(c:/texlive/2013/texmf-dist/tex/latex/elsarticle/elsarticle.cls
Document Class: elsarticle 2009/09/17, 1.2.0: Elsevier Ltd
(c:/texlive/2013/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(c:/texlive/2013/texmf-dist/tex/latex/base/size12.clo))
(c:/texlive/2013/texmf-dist/tex/latex/graphics/graphicx.sty
(c:/texlive/2013/texmf-dist/tex/latex/graphics/keyval.sty)
(c:/texlive/2013/texmf-dist/tex/latex/graphics/graphics.sty
(c:/texlive/2013/texmf-dist/tex/latex/graphics/trig.sty)
(c:/texlive/2013/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(c:/texlive/2013/texmf-dist/tex/latex/pdftex-def/pdftex.def
(c:/texlive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(c:/texlive/2013/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
(c:/texlive/2013/texmf-dist/tex/latex/psnfss/pifont.sty
(c:/texlive/2013/texmf-dist/tex/latex/psnfss/upzd.fd)
(c:/texlive/2013/texmf-dist/tex/latex/psnfss/upsy.fd))
(./elsarticle-template-num-names.spl)
(c:/texlive/2013/texmf-dist/tex/latex/natbib/natbib.sty))

! LaTeX Error: Option clash for package natbib.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.22    \bibliographystyle
                          {unsrt}

According to the answer of @Mico , I modified the codes and it works fine!!

 %\documentclass[preprint,12pt]{elsarticle}
\documentclass[preprint,12pt,square,numbers,sort&compress]{elsarticle}
%\usepackage[square,numbers,sort&compress]{natbib}
\bibliographystyle{unsrt}
\usepackage{usebib}
6

The relevant error message is

! LaTeX Error: Option clash for package natbib.

This is happening because (a) the elsarticle document class loads natbib by default and (b) natbib is loaded again in the preamble, this time with the options square, numbers, and sort&compress. Since natbib was loaded initially without any options, the instruction \usepackage[square,numbers,sort&compress]{natbib} is responsible for the option clash.

The remedy is to include the natbib-relevant options in the argument of the \documentclass instruction:

\documentclass[preprint,12pt,square,numbers,sort&compress]{elsarticle}

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.