我想改变参考书目的风格,biblatex
但我还没有找到实现我想要的方法。
通常,大多数样式在参考书目中按字母顺序列出作者。 Authortitle
并biblatex-dw
以我使用的相同方式执行biblatex-juradiss
。 我希望参考书目突出显示作者的第一个字母,并在字母表中遇到新字母时创建一个间隙。
我创建了以下最小示例来展示我想要实现的结果和 biblatex 产生的结果。
\begin{filecontents*}{lit.bib}
@BOOK{aname,
author = {Aname, Firstname},
title = {Title of the Book}
}
@BOOK{aname2,
author = {AnameSecond, Firstname},
title = {Title of the Book number two}
}
@BOOK{bname,
author = {Bname, Firstname},
title = {Title of the Book}
}
@BOOK{bname2,
author = {BnameSecond, Firstname},
title = {Title of the Book number two}
}
@BOOK{cname,
author = {Cname, Firstname},
title = {Title of the Book}
}
@BOOK{cname2,
author = {CnameSecond, Firstname},
title = {Title of the Book number two}
}
\end{filecontents*}
\documentclass{article}
\usepackage[
backend=biber,
style=biblatex-juradiss
]{biblatex}
\bibliography{lit}
\setlength{\parskip}{6pt}
\setlength{\parindent}{0pt}
\begin{document}
\cites{aname}{aname2}{bname}{bname2}{cname}{cname2}
\section*{Preferred Result}
\textbf{A}name, Fristname, Title of the Book
AnameSecond, Firstname, Title of the Book number two
\vskip 20pt
\textbf{B}name, Fristname, Title of the Book
BnameSecond, Firstname, Title of the Book number two
\vskip 20pt
\textbf{C}name, Fristname, Title of the Book
CnameSecond, Firstname, Title of the Book number two
\printbibliography
\end{document}
答案1
字段给出了参考书目中每个条目的首字母排序sortinit
,可以通过钩子检查\AtEveryBibitem
。sortinit
可以使用不同的命令设置与最后一项不同的字段值,\mkbbibnamelast
该命令以粗体显示其参数的首字母。将以下内容添加到您的序言中应该会得到所需的格式。
\setlength{\bibinitsep}{5\bibitemsep}
\AtEveryBibitem{%
\iffieldequals{sortinit}{\lastsortinit}
{}
{\let\mkbibnamelast\mkbibinitnamelast%
\savefield{sortinit}{\lastsortinit}}}
\let\mkbibinitnamelast\mkbibnamelast
\patchcmd{\mkbibinitnamelast}{{#1}}{{\firstbold#1\relax}}{}{}
\patchcmd{\mkbibinitnamelast}{{#1}}{{\firstbold#1\relax}}{}{}
\apptocmd{\mkbibinitnamelast}{\global\let\mkbibnamelast\origmkbibnamelast}{}{}
\def\firstbold#1#2\relax{\textbf{#1}#2}
\let\origmkbibnamelast\mkbibnamelast
\def\lastsortinit{}
请注意,biblatex-juradiss
参考书目样式继承了 的姓氏格式authortitle-dw
,该格式对 使用了相当复杂的定义\mkbibnamelast
。因此,粗体首字母变体\mkbibinitnamelast
是通过补丁获得的。