1

I set the references as the following in my document in Overleaf (\documentclass[review]{elsarticle}).

enter image description here

Now, I want to change it and indicate references by number(s) in square brackets in the text and also in the section of references, as shown in the figure. I could change it in the text but not in the section of references. I have also seen link1 and link2.

How to do it?

\documentclass[review]{elsarticle}
\graphicspath{ {./figures/} }
\usepackage{hyperref}
\usepackage{verbatim}
\usepackage{apalike}

\usepackage{lipsum,capt-of,graphicx} \usepackage{geometry}% Just for this example %\usepackage[authoryear,longnamesfirst]{natbib} %\usepackage[authoryear]{natbib} %\usepackage[numbers]{natbib} \usepackage{natbib} \let\printorcid\relax \usepackage[wby]{callouts} %\usepackage{cite} \usepackage{ragged2e} \usepackage{setspace} \usepackage[labelfont=bf,justification=raggedright,singlelinecheck=false, font={footnotesize}]{caption} \captionsetup[figure]{name=Fig. ,labelsep=period, justification=justified, singlelinecheck=off} \captionsetup[table]{labelsep=newline,font=footnotesize, justification=justified, singlelinecheck=off}%,skip=0pt,belowskip=0pt}

\usepackage{subcaption} \usepackage{setspace}

\usepackage{etoolbox} \AtBeginEnvironment{table}{\sffamily} \usepackage{booktabs,siunitx, multirow} \sisetup{table-format=1.4, tight-spacing=true, separate-uncertainty}

\sisetup{ output-exponent-marker = \text{e}, exponent-product={}, retain-explicit-plus, input-open-uncertainty = , input-close-uncertainty = , table-align-text-pre = false, table-align-text-post = false, round-mode=places, round-precision=2, table-space-text-pre = (, table-space-text-post = ), }

\usepackage{amsmath} \usepackage{adjustbox} \usepackage{floatrow} \floatsetup[table]{capposition=top} \floatsetup[table]{captionskip=0.1pt}

\usepackage{array, cellspace} \setlength\cellspacetoplimit{3pt} \setlength\cellspacebottomlimit{3pt}

\usepackage{placeins}

\journal{J}

\bibliographystyle{model5-names}\biboptions{authoryear} %\bibliographystyle{unsrt}\biboptions{numbers}

\begin{document}

For more information read \cite{AmericanL} and ...

\bibliography{sample}

\end{document}

And here is a sample of my .bib file

@misc{AmericanL,
    HOWPUBLISHED = {\url{https://www.lung.org}},
    AUTHOR = {Association, American Lung},
    TITLE = {Lung Cancer Fact Sheet},
    MONTH = {Dec},
    YEAR = {2020},
    NOTE = {Accessed on 2020-12-1}
}
Mico
  • 506,678
Ellie
  • 242
  • 2
    Off-topic: AUTHOR = {Association, American Lung}, is completely wrong, at it tells BibTeX it's dealing with an author with surname Association and given names American and Lung. The field really has to be AUTHOR = {{American Lung Association}},. Note the use of double braces, which serve to inform BibTeX that the entry has a so-called "corporate" author. – Mico Sep 15 '21 at 07:06
  • 2
    See also https://tex.stackexchange.com/q/10808/35864. – moewe Sep 15 '21 at 07:06
  • Remove \biboptions{authoryear}, all lines in your preamble that load natbib and the \biboptions{authoryear}. Then pass the option number to the class to get numeric citations (\documentclass[review,number]{elsarticle}). – moewe Sep 15 '21 at 07:14
  • @moewe: Yes, but my problem remains in the section of references. In the References, it should be => [1] Association, A. L. , ... – Ellie Sep 15 '21 at 08:07
  • 2
    Ah, I copy-and-pasted the wrong thing, sorry about that. The steps are as follows: (1) remove \usepackage{apalike}, (2) remove all lines loading natbib (currently only \usepackage{natbib} is active, but you should probably remove the commented lines as well to avoid confusion), (3) remove \biboptions{authoryear}. Then rerun the compilation. – moewe Sep 15 '21 at 08:15
  • 1
    You should also think about cleaning up your preamble. For journal submission it is usually a good idea to load as few packages as possible. In particular you should not load packages that change the underlying typesetting of the document (I'm thinking setspace, geometry as well as caption and your \captionsetup lines). – moewe Sep 15 '21 at 08:16

1 Answers1

3

The instruction \biboptions{authoryear} instructs the natbib citation package (which is loaded automatically by the elsarticle document class) to create authoryear-style citation call-outs. Since you say you don't want authoryear-style citation call-outs, stop using that instruction. Either delete the instruction outright or change it to \biboptions{numbers}.

Since you employ the elsarticle document class, you can't go very wrong by using the elsarticle-num bib style. In consequence, don't load the model5-names bib style.

And, since you're using the elsarticle document class, which loads the natbib citation management package automatically, do get rid of the \usepackage{apalike} instruction. The apalike and natbib citation management packages are not mutually compatible.

Finally, since `American Lung Association is not a person with two given names and one surname, you need to write

AUTHOR = {{American Lung Association}},

in order to inform BibTeX that the entry has a co-called "corporate" author.

enter image description here

\documentclass[review]{elsarticle}
\begin{filecontents}[overwrite]{sample.bib}
@misc{AmericanL,
    HOWPUBLISHED = {\url{https://www.lung.org}},
    AUTHOR = {{American Lung Association}},
    TITLE  = {Lung Cancer Fact Sheet},
    MONTH  = {Dec},
    YEAR   = {2020},
    NOTE   = {Accessed on 2020-12-1}
}
\end{filecontents}

\bibliographystyle{elsarticle-num} \usepackage{xurl} % allow arbitrary line breaks in URL strings \usepackage[colorlinks,allcolors=blue]{hyperref} % optional

\begin{document} For more information read \cite{AmericanL} and \dots \bibliography{sample} \end{document}

Mico
  • 506,678