When I compile my bibliography it lists the names as "John Smith" instead of "Smith, John". How do I change this? By the way, I am using BibDesk.
[Tex/LaTex] BiBTeX Name Order
bibliographiesbibtex
Related Solutions
The formatting of the references is controlled by the bibliography style file you've chosen; in the present MWE, that would be the plain
style. To change the formatting of the authors' names to meet your preferences -- Albert Bertram Smith
to be typeset as Smith, AB
-- one needs to change one line in the file plain.bst
.
Find the file
plain.bst
in your TeX distribution, and make a copy named (say)myplain.bst
. Don't edit the original file directly.Open the file
myplain.bst
in your favorite editor and locate the following line in the functionformat.author
:{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
and change it to
{ s nameptr "{vv~}{ll,}{ f{}}{, jj}" format.name$ 't :=
Addendum: If you do not want a comma between the surname and the initial(s) of the given name(s), i.e., if you want
Smith AB
, and no comma between the initials and any "Junior" part, set this line to:{ s nameptr "{vv~}{ll}{~f{}}{~jj}" format.name$ 't :=
Save the file, either in the directory where your main
.tex
file is located or in a directory that's searched by your TeX distribution. If you choose the second method, be sure to update the TeX filename database per your TeX distribution's recommendations.Start using the new style by setting the instruction
\bibliographystyle{myplain}
.
When running your MWE with the new bibliography style file on one of your bib entries, I get:
Note that you should probably add curly braces around Glasgow
and Crash Injury Research Engineering Network
in the title
field, to prevent the words from being converted to lowercase.
On a related subject, in the entry CDCgirlGrowthCharts
, you really should set the author
field as
author = {{National Center for Health Statistics}}
rather than
author = {National Center for Health Statistics},
Doing so tells BibTeX that it's dealing with a "corporate author" which should be sorted under N
. You may have noticed that the entry is (incorrectly) sorted under H
in the bibliography shown i your posting. Why is this happening? It's because BibTeX currently thinks it's dealing with a personal author" with given names National
and Center
, "von" component for
, and surname Health Statistics
. Ouch!!! You may not have noticed until now that something was amiss (other than the fact that the entry is sorted under "H"), because the plain
bibliography style is set to typeset the full given names, followed by the "von" part and the surname; by sheer luck, this just happens to produce the correct sequence -- in this particular case. If you were to run the unmodified entry through the myplain
bibliography style, the author's name would be typeset as for Health Statistics, NC
, telling you rather quickly that something's not quite right.
I can think of only two things that may have happened to your document:
you are not using the genuine
elsarticle-harv
bibliography style; orafter changing the argument of
\bibliographystyle
toelsarticle-harv
, you did not re-run LaTeX, BibTeX, and LaTeX twice more to fully propagate all changes stemming from the change in the argument of\bibliographystyle
.
For sure, the genuine elsarticle-harv
bibliographystyle (a) abbreviates the first and middle names of authors and places the initials after the surname and (b) sorts the entries alphabetically.
\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{bloggs:2010,
author = "Joe Bloggs",
title = "Thoughts",
year = 2010,
}
@misc{author:2016,
author = "Annie Aardvark and Zebulon Zwicky",
title = "Deep Thoughts",
year = 2016,
}
\end{filecontents}
\documentclass[authoryear]{elsarticle}
\bibliographystyle{elsarticle-harv}
\begin{document}
\citet{bloggs:2010}, \citet{author:2016}
\section*{References}
\bibliography{mybib}
\end{document}
Best Answer
As @egreg put in his comment, the appearance of names in the reference list is managed by the bibliography style.
To give a simple example of this using the .bib file:
The .tex file
produces the output
but the .tex file
, which differs only in the
\bibliographystyle
line, produces the output