![如何使作者字段加粗,包括 Biblatex 中的连词“和”?](https://linux22.com/image/312507/%E5%A6%82%E4%BD%95%E4%BD%BF%E4%BD%9C%E8%80%85%E5%AD%97%E6%AE%B5%E5%8A%A0%E7%B2%97%EF%BC%8C%E5%8C%85%E6%8B%AC%20Biblatex%20%E4%B8%AD%E7%9A%84%E8%BF%9E%E8%AF%8D%E2%80%9C%E5%92%8C%E2%80%9D%EF%BC%9F.png)
我在 Biblatex 中使用style = authoryear
,我想将所有作者姓名(包括连词“and”)都加粗。我使用了以下命令
\renewcommand{\mkbibnamefirst}[1]{\textbf{#1}}
\renewcommand{\mkbibnamelast}[1]{\textbf{#1}}
然而,这只会使作者姓名加粗,而不会使“and”连词加粗,所以我得到了这样的结果
我怎样才能使作者字段中的“and”和逗号变为粗体?
答案1
此答案来自以下邮政。
\DeclareNameFormat{last-first/first-last-bold}{\mkbibbold{%
\ifnumequal{\value{listcount}}{1}
{\iffirstinits
{\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}%
\ifblank{#3#5}
{}
{\usebibmacro{name:revsdelim}}}
{\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}%
\usebibmacro{name:andothers}}}
\DeclareNameAlias{sortname}{last-first/first-last-bold}