LaTeX forum ⇒ BibTeX, biblatex and biberelsarticle-num v2.1: month field of article ignored if pages are present

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
user49915
Posts: 39
Joined: Wed Apr 17, 2019 12:51 pm

elsarticle-num v2.1: month field of article ignored if pages are present

Postby user49915 » Wed Apr 24, 2019 12:36 am

Consider the following input:

  1. \documentclass{elsarticle}% V3.2 from <!-- m --><a class="postlink" href="http://ctan.org/tex-archive/macros/latex/contrib/elsarticle">http://ctan.org/tex-archive/macros/late ... elsarticle</a><!-- m -->
  2. \usepackage{filecontents}
  3. \begin{filecontents}{\jobname.bib}
  4. @article{Holzmann-TheModelCheckerSPIN,
  5. author = {Gerard Johan Holzmann},
  6. title = {The model checker {SPIN}},
  7. journal = {{IEEE} {TSE}},
  8. volume = 23,
  9. number = 5,
  10. month = may,
  11. year = 1997,
  12. pages = {279--295}
  13. }
  14. @article{Sutter-TheFreeLunchIsOver,
  15. author={Herb Sutter},
  16. title={The free lunch is over: a fundamental turn toward concurrency in software},
  17. journal={Dr.\@ Dobb's Journal},
  18. year = 2005,
  19. volume=30,
  20. number=3,
  21. month=mar
  22. }
  23. \end{filecontents}
  24. \begin{document}
  25. \cite{Holzmann-TheModelCheckerSPIN,Sutter-TheFreeLunchIsOver}
  26. \bibliographystyle{elsarticle-num}% V2.1 from <!-- m --><a class="postlink" href="http://ctan.org/tex-archive/macros/latex/contrib/elsarticle">http://ctan.org/tex-archive/macros/late ... elsarticle</a><!-- m -->
  27. \bibliography{\jobname}
  28. \end{document}


Consider the output of the standard pdflatex-bibtex loop:
test.png
Output of the standard pdflatex-bibtex loop
test.png (198.45 KiB) Viewed 409 times

Notice that the month is missing if the pages are given and present if the pages are not given. I think the month should be there regardless of the pages according to various manuals (e.g., http://mirror.utexas.edu/ctan/info/bibt ... ttb_en.pdf or http://en.wikipedia.org/wiki/BibTeX). What's the right (I do know that the term is vague) way to repair `elsarticle-num.bst`? (An aside: to the best of my knowledge, the authors of the package were contacted but have not reacted so far.)
Last edited by user49915 on Wed Apr 24, 2019 2:44 pm, edited 2 times in total.

user22741
Posts: 35
Joined: Fri Nov 09, 2018 12:03 pm

Postby user22741 » Wed Apr 24, 2019 11:22 am

You use a bibliography style that does not show the month if pages are given. If you want to show the month, use a bib style that shows it, create a bib style of your own or remove the pages.
  1. \documentclass{elsarticle}% V3.2 from <!-- m --><a class="postlink" href="https://ctan.org/tex-archive/macros/latex/contrib/elsarticle">https://ctan.org/tex-archive/macros/lat ... elsarticle</a><!-- m -->
  2. \usepackage{filecontents}
  3. \begin{filecontents}{\jobname.bib}
  4. @article{Holzmann-TheModelCheckerSPIN,
  5. author = {Gerard Johan Holzmann},
  6. title = {The model checker {SPIN}},
  7. journal = {{IEEE} {TSE}},
  8. volume = 23,
  9. number = 5,
  10. month = may,
  11. year = 1997,
  12. pages = {279--295}
  13. }
  14. \end{filecontents}
  15.  
  16.  
  17. \biboptions{}
  18.  
  19. \begin{document}
  20. \cite{Holzmann-TheModelCheckerSPIN}
  21. \bibliographystyle{plainnat}% V2.1 from <!-- m --><a class="postlink" href="https://ctan.org/tex-archive/macros/latex/contrib/elsarticle">https://ctan.org/tex-archive/macros/lat ... elsarticle</a><!-- m -->
  22. \bibliography{\jobname}
  23. \end{document}
Last edited by user22741 on Wed Apr 24, 2019 4:39 pm, edited 2 times in total.

user49915
Posts: 39
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Wed Apr 24, 2019 6:37 pm

user22741 wrote:You use a bibliography style that does not show the month if pages are given.

I don't think that it was intended this way; there is no good reason for this strange conditional behavior. I think it's simply a bug in `elsarticle-num.bst`.

user22741
Posts: 35
Joined: Fri Nov 09, 2018 12:03 pm

Postby user22741 » Wed Apr 24, 2019 10:28 pm

why would the source code contain a special if-case to check for empty page fields, if this behavior was not intended?

  1. pages empty$
  2. { format.date "year" output.check }
  3. 'skip$
  4. if$

user49915
Posts: 39
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Wed Apr 24, 2019 11:06 pm

user22741 wrote:why would the source code contain a special if-case to check for empty page fields

I don't know. Given that the prior edition of elsarticle-num.bst from January 2019 had more bugs (cf. https://tex.stackexchange.com/questions ... -for-entry, https://tex.stackexchange.com/questions ... aphy-entry), I bet on the side that the authors simply err.

user22741
Posts: 35
Joined: Fri Nov 09, 2018 12:03 pm

Postby user22741 » Wed Apr 24, 2019 11:25 pm

user49915 wrote:
user22741 wrote:why would the source code contain a special if-case to check for empty page fields

I don't know. Given that the prior edition of elsarticle-num.bst from January 2019 had more bugs (cf. https://tex.stackexchange.com/questions ... -for-entry, https://tex.stackexchange.com/questions ... aphy-entry), I bet on the side that the authors simply err.


Then why ask here and not write to the authors?

user49915
Posts: 39
Joined: Wed Apr 17, 2019 12:51 pm

Postby user49915 » Thu Apr 25, 2019 12:56 am

user22741 wrote:Then why ask here and not write to the authors?

This problem is mentioned in the aside in my OP.


Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 3 guests