TeX - LaTeX Asked by Pietair on April 30, 2021
I created a .bib file using BibDesk, which contains the following reference:
@article{Farrell:2005aa,
Author = {Farrell, Jay and Sharma, Manu and Polycarpou, Marios},
Cited-By = {113},
Date-Added = {2014-03-11 16:36:51 +0000},
Date-Modified = {2014-03-11 16:38:05 +0000},
Journal = {Journal of Guidance, Control, and Dynamics},
Number = {6},
Pages = {1089-1102},
Title = {Backstepping-based flight control with adaptive function approximation},
Volume = {28},
Year = {2005},
}
When I generate a TeX Preview in BibDesk this entry looks as follows:
In my LaTeX document I use the following code to insert the references:
bibliographystyle{plain}
bibliography{MyBibFile}
With the following result:
Now I would like the reference in my report to look like as in the first example, that is with only the initials of the first names.
You could proceed as follows to direct BibTeX to abbreviate first (and middle) names down to the initials, while using a suitably modified version of the plain
bibliography style:
Find the file plain.bst
in your TeX distribution. (One way to find this file is to issue the command kpsewhich plain.bst
at a command prompt.) Copy this file to, say myplain.bst
. (Don't edit directly a file provided as part of your TeX distribution.)
Open the file myplain.bst
in your favorite text editor -- the one you use to edit your .tex
files will do -- and search for the function named format.names
. (In the version of this file that's in my TeX distribution, the function format.names
starts on line 185.)
In this function, look for the line
{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
Change this line to
{ s nameptr "{f. }{vv~}{ll}{, jj}" format.name$ 't :=
Save the file myplain.bst
either to the directory that contains your main .tex
file or to a directory that's searched by your BibTeX distribution. (If you choose the second option, depending on your TeX distribution, you may also have to refresh the filename database of the TeX distribution.)
Start using the modified bibliography style file by issuing the command bibliographystyle{myplain}
, and be sure to run LaTeX, BibTeX, and LaTeX twice more on the main .tex
file to propagate all changes.
Here's how the entry in question will be typeset with myplain
as the bibliography style:
RequirePackage{filecontents}
documentclass{article}
begin{filecontents*}{jobname.bib}
@article{Farrell:2005aa,
Author = {Farrell, Jay and Sharma, Manu and Polycarpou, Marios},
Cited-By = {113},
Date-Added = {2014-03-11 16:36:51 +0000},
Date-Modified = {2014-03-11 16:38:05 +0000},
Journal = {Journal of Guidance, Control, and Dynamics},
Number = {6},
Pages = {1089-1102},
Title = {Backstepping-based flight control with adaptive
function approximation},
Volume = {28},
Year = {2005},
}
end{filecontents*}
bibliographystyle{myplain} % note: 'myplain' rather than 'plain'
begin{document}
nocite{*}
bibliography{jobname}
end{document}
Correct answer by Mico on April 30, 2021
You can use biblatex
with convenient options. Write:
......................
usepackage[style=numeric,firstinits]{biblatex}
addbibresource{MyBibfile.bib}
....................
begin{document}
....................
printbibliography
end{document}
This makes both citation and bibliography styles numeric. But you can choose citation style and bibliography style independently. Take a look at §3.3 of the biblatex documentation for a description of the standard syles available. Moreover, in case you use natbib
, you can load biblatex with the natbib
option, that emulates natbib functionalities.
Updated (3/9/2017)
The new syntax for first names initials is [giveninits]
.
Answered by Bernard on April 30, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP