Bibliography ordered as Author, Article title, Journal, Year, Volume, Issue, and Page, and DOI

I'm having trouble trying to adapt the structure of my bibliography. Ideally I would want to have them ordered as: Author, article title, journal, year, volume, issue, and page, and DOI.

What I have so far:

\documentclass{article}
\usepackage[authoryear]{natbib}
\setcitestyle{aysep={}}
\bibliographystyle{apalike}

\begin{document}
\citep{<Bibtexkey>}
\bibliography{<myRef>}
\end{document}


How do I adapt the set of instructions above to get the output below?

Cras JJ, Rowe-Taitt CA, Nivens DA, Ligler FS. Comparison of chemical cleaning methods of glass in preparation for silanization. Biosensors and Bioelectronics. 1999;14(9):683-88. https://doi.org/10.1016/S0956-5663(99)00043-3

• Welcome to TeX.SE. Which formatting requirements do you have for entry types other than @article? – Mico Jul 31 at 15:25
• You asked, "How do I adapt the set of instructions above to get the output below?" The short answer is, "One cannot adapt the code you've shown to get the desired output." Achieving the desired output requires either editing/modifying a given bibliography style (apalike, say) or creating a new bibliography style from scratch. Incidentally, obtaining the desired output by modifying apalike.bst would require multiple changes, well beyond just moving the spot where the contents of the year field would be inserted. Are you sure you want to start off from apalike? – Mico Jul 31 at 15:35
• @Mico I really don't mind if you have something different -- as long as it does the job. Thank you very much. – oma11 Jul 31 at 17:08
• Please see the answer I just posted. – Mico Jul 31 at 17:11

(too long for a comment, hence posted as an answer)

I can observe at least eight [8!!] differences between the output produced by apalike and your desired output. And this list includes only entries of type @article; other entry types will likely produce further discrepancies between apalike's output and your desired output.

• apalike renders names as Cras, J. J., whereas you want Cras JJ.
• If there's more than 1 author, apalike inserts and before the final author; you don't want this particle.
• Placement and form of the year field (this is the only difference you mention in your query): apalike produces (1999). after the author block, whereas you want 1999; placed after the journal field.
• apalike italicizes the contents of the journal field -- something you do not want.
• apalike places a comma after the journal field, whereas you want a period (aka full stop)
• If the pages field is given by pages = "683--688", apalike renders it as 683-688, whereas you want 683-88.
• apalike ignores the doi field; you want it included.
• apalike places a period (aka full stop) at the very end of the typeset bibliographic entry -- something you don't want.

Hacking the apalike.bst bibliography style file to obtain the desired output would be exceedingly tedious and likely error-prone.

What's the alternative to hacking apalike? I suggest you familiarize yourself with makebst utility, which is part of the custom-bib package. Open a command window and type pdflatex makebst to start the menu-driven utility. You'll walk through a series of multiple-choice questions, each one containing a default choice and several alternative choices. At the end, you'll have a bespoke bst file that contains almost all of your formatting choices; the only formatting choice the utility will not produce is to abbreviate the pages range, i.e., write 683-88 instead of 683-688.

(That's how I came up with the second screenshot shown above. Post your email address in a comment, and I'll be happy to send you the file cras.bst.)

\documentclass{article}
%% I obtained the following bib information from Elsevier's website
\begin{filecontents}[overwrite]{mybib.bib}
@article{crnl:1999,
author  = "J. J. Cras and C. A. Rowe-Taitt and D. A. Nivens and F. S. Ligler",
title   = "Comparison of chemical cleaning methods of glass in preparation for silanization",
journal = "Biosensors and Bioelectronics",
year    = "1999",
volume  = "14",
number  = "8--9",
pages   = "683--688",
doi     = "https://doi.org/10.1016/S0956-5663(99)00043-3",
}
\end{filecontents}

\usepackage[authoryear]{natbib}
\setcitestyle{aysep={}}
\setlength{\bibhang}{0pt}
\bibliographystyle{cras} % 'cras.bst' produced by the makebst utility
\usepackage{xurl}