TransWikia.com

Process bibitem without year data in an elsarticle-harv reference list

TeX - LaTeX Asked by wklchris on December 4, 2020

I am preparing a draft required to have Elsevier’s reference list style (i.e. the style of the bibliography list) and I’ve chosen elsarticle-harv reference style because it’s the closest to my requirements.

However, some online items don’t tell people when they went online, so there are bibitems don’t have "year" keys. In the reference list, these items will leave spaces in the "year" field and cause a comma immediately followed by a period.

(UPDATE: Let’s discuss the reference style only, not the citation style. I understand that a bibitem without year won’t give a proper "author+year" in-text citation, but that’s another question. Now my concern is just about the format of the reference list.)

Please see my MWE (compiled by pdflatex+bibtex):

documentclass{article}
usepackage[authoryear]{natbib}
bibliographystyle{elsarticle-harv}

usepackage{filecontents}
begin{filecontents*}{ref.bib}
@misc{miscwebsite,
    author = {{Author 1}},
    title = {{Misc Website}},
    url = {http://foo.bar/},
    note = {Accessed 31.01.2000.}
}
end{filecontents*}

begin{document}
Here I cite a webpage without year citep{miscwebsite}.
bibliography{ref}

end{document}

Here is the screenshot. The comma before the empty year field should be removed.

enter image description here


I have tried following methods, but none works:

  • Using elsarticle documentclass instead of article
  • Adding an empty year key into the bibitem, i.e. year={}
  • Applying @online item type (though I think it’s for BibLaTeX) instead of @misc

I guess I might need to customize the elsarticle-harv.bst file or something even more complicated, but I haven’t done such things before.

Any help or information will be appreciated.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP