Automatically abbreviate authors' first names in LaTeX
Asked Answered
M

2

26

Using natbib/Latex/Bibtex, in the references section I get references with full first names like:

Vladimir Iosifovich Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. Technical Report 8, 1966.

I would like automatically abbreviated first names like:

V. I. Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. Technical Report 8, 1966.

If you have an idea how to do this I will be glad to hear.

Moose answered 7/7, 2011 at 14:50 Comment(1)
Caspar's answer is great, but should be replaced by \usepackage[backend=bibtex,giveninits=true]{biblatex} because firstinits is declared as deprecated.Resinoid
H
27

Use a BibTeX style that does this. Alternatively, create your own style by modifying an existing one. You will have to change the function format.names, so that a line similar to this:

s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=

has f. as shown. The full first name would be shown if it is ff.

Hako answered 7/7, 2011 at 15:34 Comment(5)
I use the \bibliographystyle{plainnat}, where should I edit the function (in which file?). Thanks!Moose
@TTT: Copy the file plainnat.bst into your working directory under a different name (e.g. my-plainnat.bst). Look for the FUNCTION {format.names}. About the seventh line of that function is the line shown above. Modify it to f. instead of ff. Then, use \bibliographystyle{my-plainnat} in your LaTeX file.Hako
Thanks, this worked! Additional step is that you need to update your index. Check out link and scroll down to "4. Update your index" for instructions.Moose
Should this answer be moved to tex.stackexchange?Hypabyssal
Notice that one need to delete the .bbl file before it works.Jennelljenner
M
13

If you are using Biblatex, just add this in your preable when calling for Biblatex:

\usepackage[backend=bibtex,giveninits=true]{biblatex}

Note: For older latex versions: use firstinits instead - firstinits was recently replaced by giveninits.

Mammalian answered 10/2, 2015 at 4:8 Comment(1)
See flipper's comment above: as of 2020, firstinits is deprecated and should be replaced by giveninits.Achondrite

© 2022 - 2024 — McMap. All rights reserved.