我正在尝试使用 biber 来处理我的参考书目。我希望作者和年份完全以粗体打印。但是,我只能将名称(和前缀等)加粗,却无法弄清楚如何对作者姓名之间的“and”做同样的事情。出版年份也遇到了同样的问题。
这是我目前所做的:
\usepackage[backend=biber,
style=authoryear,
citestyle=apa]{biblatex}
\addbibresource{mybib.bib}
....
\begingroup
\setlength\bibitemsep{10pt}
\renewcommand{\labelnamepunct}{\addcolon\space}
\renewcommand*{\mkbibnamefamily}[1]{\textbf{#1}}
\renewcommand*{\mkbibnamegiven}[1]{\textbf{#1}}
\renewcommand*{\mkbibnameprefix}[1]{\textbf{#1}}
\renewcommand*{\mkbibnamesuffix}[1]{\textbf{#1}}
\printbibliography
\addcontentsline{toc}{chapter}{Bibliography}
\endgroup
如果有人能帮助我我会非常高兴!
编辑:为了完整起见,我已经找到了以粗体打印年份(及其周围的括号)的解决方案:
\DeclareFieldFormat{parens}{\bfseries{\mkbibparens{#1}}}
\DeclareFieldFormat{date}{\bfseries{#1}}
答案1
在你的序言中,添加以下几行
\DeclareNameAlias{sortname}{given-family-bold}
\DeclareNameFormat{given-family-bold}{\mkbibbold{%
\ifgiveninits
{\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiveni}
{\namepartprefix}{\namepartsuffix}}
{\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiven}
{\namepartprefix}{\namepartsuffix}}%
\usebibmacro{name:andothers}}}
数学家协会
\documentclass[12pt,a4paper]{report}
\usepackage{lipsum}
\usepackage[backend=biber,style=authoryear,citestyle=apa]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{test1,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title = {The LaTeX Companion},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareNameAlias{sortname}{given-family-bold}
\DeclareNameFormat{given-family-bold}{\mkbibbold{%
\ifgiveninits
{\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}
{\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}}%
\usebibmacro{name:andothers}}}
\begin{document}
\chapter{Test}
Test paragraph, just random words \parencite{test1}. \lipsum[1-2]
\setlength\bibitemsep{10pt}
\printbibliography
\end{document}
正如 OP 所指出的,参考书目按姓氏、名字、名字姓氏和名字姓氏进行排序,https://tex.stackexchange.com/a/178877/35864—— 这些行应该放在序言中。
\DeclareNameAlias{sortname}{family-given/given-family-bold}
\DeclareNameFormat{family-given/given-family-bold}{\mkbibbold{%
\ifnumequal{\value{listcount}}{1}
{\ifgiveninits
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}%
\ifboolexpe{%
test {\ifdefvoid\namepartgiven}
and
test {\ifdefvoid\namepartprefix}}
{}
{\usebibmacro{name:revsdelim}}}
{\ifgiveninits
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}%
\usebibmacro{name:andothers}}}