------
\documentclass[preprint,authoryear,12pt]{elsarticle}
\journal{Nuclear Physics B}
\begin{document}
\section{This is a test}
Test kjkjk \citep{dawkins82}
\bibliographystyle{elsarticle-harv}
\bibliography{myb}
\end{document}
------
with the bib file:
@BOOK{dawkins82,
AUTHOR = {Richard Dawkins},
TITLE = {The Extended Phenotype: The Long Reach of the Gene},
PUBLISHER = {W.H. Freeman \& Company},
YEAR = {1982},
}
Thanks for your help.
Luis Felipe
elsarticle.cls ends with
\@ifpackageloaded{amsrefs}%
{}
{\let\bibsection\relax%
\AtBeginDocument{\def\cites@b#1#2,#3{%
\begingroup[%
\toks@{\InnerCite{#2}#1}%
\ifx\@empty#3\@xp\@gobble\fi
\cites@c#3%
}}}
This is what makes the heading disappear, since natbib redefines
the thebibliography environment to start with \bibsection, which
is responsible for the typesetting of the bibliography heading.
I don't know if this is a design decision or simply a mistake.
To recover natbib's definition of \bibsection you may try to
write
\newcommand\bibsection{%
\section*{\bibname\markright{\MakeUppercase{\bibname}}}}
in the preamble of your document. It's \newcommand and not
\renewcommand as one might expect.
Ciao
Enrico
> Hi,
> I am writing an article using the elsarticle.cls style and elsarticle-
> harv.bst, but the title 'References' is not printed when I generate
> the pdf file.
>
> Luis Felipe
Did you run latex then bibtex and the latex again?
Alan
What version of elsarticle is this? Luis' sample file compiled fine for
me and the References section showed up. My version of elsarticle
doesn't have the code snippet you give above. Maybe the problem is an
older version?
*File List*
elsarticle.cls 2008/05/22, 1.0.1: Elsevier Science
article.cls 2005/09/16 v1.4f Standard LaTeX document class
size12.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
graphics.sty 2006/02/20 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
pdftex.def 2008/09/08 v0.04l Graphics/color for pdfTeX
pifont.sty 2005/04/12 PSNFSS-v9.2a Pi font support (SPQR)
upzd.fd 2001/06/04 font definitions for U/pzd.
upsy.fd 2001/06/04 font definitions for U/psy.
elsart.spl
natbib.sty 2009/02/02 8.3 (PWD, AO)
supp-pdf.tex
elsart.bbl
the current one, i imagine.
>Luis' sample file compiled fine for
>me and the References section showed up. My version of elsarticle
>doesn't have the code snippet you give above. Maybe the problem is an
>older version?
>
> *File List*
>elsarticle.cls 2008/05/22, 1.0.1: Elsevier Science
current is 2009/12/01, 1.20
--
Robin Fairbairns, Cambridge
No, the problem is in a newer version:
*File List*
elsarticle.cls 2009/09/17, 1.2.0: Elsevier Ltd
article.cls 2007/10/19 v1.4h Standard LaTeX document class
...
natbib.sty 2009/07/16 8.31 (PWD, AO)
In elsarticle.dtx we find
% \changes{v1.2}{2009/09/17}{Documentation, templates, and *.bst
% has been seperated from this .dtx. Incompatibility problems
% with amsref.sty, fncylab.sty have been fixed. Some bugs related
% to author/affiliation part have been fixed.}
which accounts for the change. In amsrefs.sty there's a bibsection
environment and, probably, the authors of elsarticle.cls forgot that
\bibsection is the command used by natbib to introduce the bibliography.
Ciao
Enrico