1

I added support for shortauthors in biblatex authoryear. When one author has multiple entries authorname is omitted, but not shortauthor. How can I fix that? example

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{filecontents}{filename.bib} 
@Electronic{ilo2015,
  Title                    = {World Employment and Social Outlook},
  Author                   = {{Internationale Arbeitsorganisation}},
  Shortauthor              = {ILO},
}
@Electronic{ilo2013,
  Title                    = {Beschaftigung, Wachstum und soziale Gerechtigkeit. Bericht des Generaldirektors.},
  Author                   = {{Internationale Arbeitsorganisation}},
  Shortauthor              = {ILO},
}
\end{filecontents}
\usepackage[backend=biber, style=authoryear]{biblatex}

% Show shortauthor
\renewbibmacro*{begentry}{%
    \ifnameundef{shortauthor}
        {}
        {\printnames{shortauthor}%
         \addspace\textendash\space}}

\addbibresource{filename.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
1

After reading the sources of biblatex-authoryear I found that \usebibmacro{bbx:dashcheck} is the solution

\renewbibmacro*{begentry}{%
  \ifnameundef{shortauthor}
  {}
  {\usebibmacro{bbx:dashcheck}{}
    {\printnames{shortauthor}%
    \addspace\textendash\space}}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.