In presentation slides, one's own work is typically abbreviated, by, say, first letters of last names (like "This has been solved by FB (2013)" instead of "This has been solved by Foobarfoo and Barfoobar (2013)"). How can this be achieved with BibLaTeX, while keeping the full references in the bibliography? (like "Foobarfoo, B. and Barfoobar, F. (2013), On strange BibLaTeX questions, Journal of BibLaTeX 12(3)". [The latter bibliography style I already have, I am just wondering whether there is an option so that \cite{} changes from the standard, full-last-name author-year style to this new, abbreviated style. I saw the option abbreviate=true, but of course that didn't do it.]
Asked
Active
Viewed 1,239 times
0
Marius Hofert
- 4,754
1 Answers
1
labelalpha might be what you're looking for.
EDIT added maxalphanames=999 so all authors are abbreviated (though it does become quite confusing with a lot of names).
We let biber create labels (labelalpha=true) and set up the template.
\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field[strwidth=1,strside=left]{labelname}
}
\labelelement{
\literal{\,}
}
\labelelement{
\field{year}
}
}
With \citefield{testartlong}{labelalpha} we can then access the shortened label.
We then define a new citation command \abbrvcite to use the abbreviated citations (I would rather not overwrite \cite to use this style.).
\DeclareCiteCommand{\abbrvcite}
{\usebibmacro{prenote}}
{\printfield{labelalpha}%
\iffieldundef{extraalpha}%
{}%
{\printfield{extraalpha}}}%
{\multicitedelim}
{\usebibmacro{postnote}}
Note the use of extraalpha, as abbreviated citations might get ambiguous quite quickly.
Full MWE
\documentclass[american, a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[autopunct=true]{csquotes}
\usepackage[labelalpha=true,style=numeric,maxnames=999,maxalphanames=999]{biblatex}
\addbibresource{\jobname.bib}
\begin{filecontents}{\jobname.bib}
@article{testartlong,
author = {Arnold Uthor and William Riter and Rita Esearcher and Steven C. Ientist and Stuart T. Udent and Peter R. Ofessor and Lewis E. C. Turer},
title = {An Article about Articles},
journal = {Journal of Articles},
volume = {8},
number = {2},
page = {1-5},
date = {2010},
}
@article{testart,
author = {Arnold Uthor and William Riter},
title = {A Very Interesting Article},
journal = {Journal of Articles},
volume = {7},
number = {3},
page = {1-5},
date = {2010},
}
@book{testbook,
author = {Walter Ordsmith},
editor = {Eddie Ditor},
title = {The Work},
subtitle = {Subtitle},
date = {1983},
}
@online{testonline,
author = {Bernie Logger},
title = {A Very Opinionated Blog Post},
url = {http://example.com},
year = {2013},
}
@online{testonline2,
author = {Bernie Logger},
title = {A Very Opinionated Blog Post II},
subtitle = {More Text},
url = {http://example.com},
year = {2013},
}
\end{filecontents}
\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field[strwidth=1,strside=left]{labelname}
}
\labelelement{
\literal{\,}
}
\labelelement{
\field{year}
}
}
\DeclareCiteCommand{\abbrvcite}
{\usebibmacro{prenote}}
{\printfield{labelalpha}%
\iffieldundef{extraalpha}%
{}%
{\printfield{extraalpha}}}%
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{document}
Let's cite \cite{testartlong}.
\abbrvcite{testartlong} and \abbrvcite{testbook}, \abbrvcite{testart} or \abbrvcite{testonline} vs \abbrvcite{testonline2}.
\nocite{*}
\printbibliography
\end{document}

moewe
- 175,683
\DeclareLabelalphaTemplateisbiber-only (see documentation, ยง 4.5.5, p. 153). If you specifybackend=bibtexyou will still get short labels, but not in exactly the way defined above; try it, maybe you like it. If onlytexi2dvihinders you from switching tobiber, have a look at latexmk. โ moewe Sep 06 '13 at 14:07latexmkbut usetexi2dvinow since it is much faster (3s vs 5s) and also for other reasons). I'll still accept your answer (because it is correct in principle and might help others). I might come back to this in the future when I have more time to rethink 'the whole process' and how this could be improved. Thanks again. โ Marius Hofert Sep 06 '13 at 20:04