2

I need to amend the references to include the "shortauthor" in biblatex. My question is almost identical to

How to print shortauthor in the references as well?

but I need the reference to be of the form

World Health Organization [WHO]. (2016). ...

Right now, it is

World Health Organization. (2016). ...

and \begentry only lets you amend the beginning of the entry. I use biblatex with style=apa. How can I achieve this?

Chris tie
  • 251

2 Answers2

1

With biblatex-apa you only need

\renewbibmacro*{author}{%
  \ifnameundef{author}
    {\usebibmacro{labeltitle}}
    {\printnames[apaauthor][-\value{listtotal}]{author}%
     \setunit*{\addspace}%
     \printfield{nameaddon}%
     \ifnameundef{shortauthor}
       {}
       {\setunit*{\addspace}%
        \printtext[brackets]{\printnames{shortauthor}}}%
     \ifnameundef{with}
       {}
       {\setunit{}\addspace\mkbibparens{\printtext{\bibstring{with}\addspace}%
        \printnames[apaauthor][-\value{listtotal}]{with}}
        \setunit*{\addspace}}}%
  \newunit\newblock%
  \usebibmacro{labelyear+extrayear}}

Where we just added the part starting with \ifnameundef{shortauthor}.

MWE

\documentclass[british]{scrartcl}
\listfiles
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{iea,
author = {{International Energy Agency}},
title = {World Energy Outlook},
shortauthor = {IEA},
date = {2005}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel,csquotes}

\usepackage[
    style=apa,
  backend=biber
]{biblatex}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\DeclareLanguageMapping{british}{british-apa}

\renewbibmacro*{author}{%
  \ifnameundef{author}
    {\usebibmacro{labeltitle}}
    {\printnames[apaauthor][-\value{listtotal}]{author}%
     \setunit*{\addspace}%
     \printfield{nameaddon}%
     \ifnameundef{shortauthor}
       {}
       {\setunit*{\addspace}%
        \printtext[brackets]{\printnames{shortauthor}}}%
     \ifnameundef{with}
       {}
       {\setunit{}\addspace\mkbibparens{\printtext{\bibstring{with}\addspace}%
        \printnames[apaauthor][-\value{listtotal}]{with}}
        \setunit*{\addspace}}}%
  \newunit\newblock%
  \usebibmacro{labelyear+extrayear}}

\begin{document}
\cite{companion,iea}

\printbibliography
\end{document}

example output

moewe
  • 175,683
  • this solution sadly creates a new problem for me. The bibliography looks like this after adding the shortname with your solution: enter image description here How do I get the follwoing notation back with just the [MSB NRW] added: enter image description here – TrizZm4ster Jul 15 '22 at 14:11
  • @TrizZm4ster I think this should be asked in a new question (which should include an example document that reproduces the undesirable output). – moewe Jul 15 '22 at 18:57
0

It depends of the amount of references in your .bib but wouldn't it be simpler to manually shortcode your entry ?

Something like this should do the trick just fine :

 @book{hello,
 Title={Hello},
 Author={World Health {Organization [WHO]}}
}

Where the double {} is used to trick biblatex into thinking that "Organization [WHO]" is a single word.

  • I am completely fine with shortcoding. However, your example returns "Organization [FSO], 2016"

    in citations and bibliography. Also, I already have Author={{World Health Organization}}

    in double braces

    – Chris tie Feb 08 '17 at 14:19
  • I didn't have thought of that, sorry. – Rémi Nazin Feb 08 '17 at 14:29