Use small caps in bibliography for institutional authors
If all your citations that require a small caps institution do indeed have the same tag, then it should be possible.
In your MWE however, the two entries do not share a keyword
, so I added the keyword instauth
to check for.
What we do is very simple: At every citation command, and before every bibliography entry we check, if the entry has the keyword instauth
, if so the last name format is set to produce acronyms via biblatex
's \mkbibacro
macro (note that for this to work "[t]he acronym should be given in uppercase letters.", p. 89, the biblatex
documentation).
\AtEveryCitekey{%
\ifkeyword{instauth}
{\renewcommand*{\mkbibnamelast}[1]{\mkbibacro{#1}}}
{}%
}
\AtEveryBibitem{%
\ifkeyword{instauth}
{\renewcommand*{\mkbibnamelast}[1]{\mkbibacro{#1}}}
{}%
}
An alternative redefinition is the shorter
\renewcommand*{\mkbibnamelast}[1]{%
\ifkeyword{instauth}
{\mkbibacro{#1}}
{#1}}
Where the conditional is inside the formatting directive. Then there is no need to hook the change into groups where \ifkeyword
is defined, as was necessary above.
We can even make the detection of instauth
automatic up to some point. With
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\step[fieldsource=author, match=\regexp{^\{.+?\}$}, final]
\step[fieldset=keywords, append, fieldvalue={,instauth}]
}
}
}
all author
fields that contain a string wrapped in double curly braces are classed as instauth
.
This might brake down in some corner cases - as do so many automatic solutions.
\documentclass[a4paper]{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage{filecontents}
\usepackage[backend=biber, style=apa, date=year, natbib=true, sorting=nyt, sortcites=true]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{filecontents*}{\jobname.bib}
@online{nos_weeralarm_2009,
title = {Weeralarm en verkeeralarm ingetrokken},
url = {http://nos.nl/l/124074},
titleaddon = {{NOS.nl}},
author = {{NOS}}, %THIS AUTHOR MUST BE PRINTED IN SC
urldate = {2014-02-12},
date = {2009-12-20},
keywords = {gladheid, ijs, ongeluk, openbaar vervoer, schiphol, sneeuw}
}
@report{ns_volle_2013,
location = {Utrecht},
title = {Internal document title},
institution = {NS},
type = {Internal Document},
author = {{NS}}, % THIS AUTHOR MUST BE PRINTED IN SC
date = {2013},
keywords = {internal},
}
\end{filecontents*}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\step[fieldsource=author, match=\regexp{^\{.+?\}$}, final]
\step[fieldset=keywords, append, fieldvalue={,instauth}]
}
}
}
\renewcommand*{\mkbibnamelast}[1]{%
\ifkeyword{instauth}
{\mkbibacro{#1}}
{#1}}
\begin{document}
This is some text with a double reference \cite{nos_weeralarm_2009, ns_volle_2013, wilde, cicero}.
\printbibliography[notkeyword=internal]
\printbibliography[title={Internal Documents}, keyword=internal]
\end{document}