我希望在我的參考書目中,作者加粗,年份應該是正常的。就像這個例子:
這是我的序言文件的源代碼的一部分:
\usepackage[natbib=true, backend=biber, style=authoryear, dashed=false]{biblatex}
\setlength{\bibitemsep}{18pt}
\setlength{\bibhang}{0.2cm}
\DeclareNameAlias{sortname}{last-first}
\AtBeginBibliography{%
\renewcommand*{\multinamedelim}{\addsemicolon\space}%
\renewcommand*{\finalnamedelim}{\addsemicolon\space}%
}
\DefineBibliographyStrings{ngerman}{%
andothers = {et\addspace al\adddotspace},%
andmore = {et\addspace al\adddotspace},%
}
\usepackage{xpatch}
\xpretobibmacro{author}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{author}{\egroup}{}{}
\xpretobibmacro{bbx:editor}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{bbx:editor}{\egroup}{}{}
\renewcommand*{\labelnamepunct}{\mkbibbold{\addcolon\space}}
答案1
更新
為了方便作者在參考書目中加粗,只需使用
\DeclareNameWrapperFormat{sortname}{\mkbibbold{#1}}
不需要xpatch
和朋友。
舊答案
使用
\usepackage{xpatch}
\def\bmkbibbold#1\emkbibbold{\mkbibbold{#1}}
\xpretobibmacro{author}{\bmkbibbold}{}{}
\xpatchbibmacro{author}
{\usebibmacro{date+extradate}}
{\emkbibbold\usebibmacro{date+extradate}}
{}{}
\xpretobibmacro{bbx:editor}{\bmkbibbold}{}{}
\xpatchbibmacro{bbx:editor}
{\usebibmacro{date+extradate}}
{\emkbibbold\usebibmacro{date+extradate}}
{}{}
\xpretobibmacro{bbx:translator}{\bmkbibbold}{}{}
\xpatchbibmacro{bbx:translator}
{\usebibmacro{date+extradate}}
{\emkbibbold\usebibmacro{date+extradate}}
{}{}
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addcolon\space}
這將使年份免於加粗,也將為譯者做正確的事。具有分隔參數的巨集可能有點冒險,因此通常應首選正確使用分組的解決方案。不幸的是,biblatex
的字體指令都是巨集而不是開關。