我正在使用 biblatex-apa 来定义我的参考书目的布局。现在我引用了来自机构或新闻网站的几份(内部)文件,这些文件现在以缩写形式出现在文档中。我想让这些缩写以小写字母显示。实际上,我希望所有缩写的机构都以小写字母显示。这可能吗?我现在使用标签(从 Zotero 导出)拆分我的参考书目,所以我假设标签也可能使引文在文本中以小写字母显示?有人知道怎么做吗?
我的 MWE:
\documentclass[10pt,a4paper,twoside]{book}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa, date=year, natbib=true, sorting=nyt, sortcites=true]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\bibliography{Zotero}
\begin{document}
\chapter{Literature review}
This is some text with a double reference \cite{nos_weeralarm_2009, ns_volle_2013}.
\printbibliography[notkeyword=internal]
\printbibliography[title={Internal Documents}, keyword=internal]
\end{document}
我的 Zotero.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}
}
答案1
如果所有需要小型大写机构的引用确实具有相同的标签,那么应该是可能的。
但是,在您的 MWE 中,这两个条目不共享,因此我添加了要检查的keyword
关键字。instauth
我们所做的非常简单:在每个引用命令中,以及在我们检查的每个参考书目条目之前,如果条目包含关键字instauth
,则将姓氏格式设置为通过biblatex
的\mkbibacro
宏生成首字母缩略词(请注意,要使其工作,“首字母缩略词应以大写字母给出。”,第 89 页,biblatex
文档)。
\AtEveryCitekey{%
\ifkeyword{instauth}
{\renewcommand*{\mkbibnamelast}[1]{\mkbibacro{#1}}}
{}%
}
\AtEveryBibitem{%
\ifkeyword{instauth}
{\renewcommand*{\mkbibnamelast}[1]{\mkbibacro{#1}}}
{}%
}
另一种重新定义是较短的
\renewcommand*{\mkbibnamelast}[1]{%
\ifkeyword{instauth}
{\mkbibacro{#1}}
{#1}}
条件是里面格式化指令。那么就不需要\ifkeyword
像上面那样将更改挂接到定义的组中。
instauth
我们甚至可以在某种程度上实现自动检测。
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
\step[fieldsource=author, match=\regexp{^\{.+?\}$}, final]
\step[fieldset=keywords, append, fieldvalue={,instauth}]
}
}
}
所有author
包含双花括号内的字符串的字段均归类为instauth
。这可能会在某些特殊情况下失效 - 许多自动解决方案也是如此。
平均能量损失
\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}
答案2
注意:自 2016 年 3 月 (biblatex 3.3) 起,您需要将 \mkbibnamefamily 改为 \mkbibnamelast。另请参阅Biblatex 3.3 名称格式。