在包含虚线条目的参考书目中,我希望J. Lennon
和等变体John Lennon
表现为相同的名称。换句话说,后一个条目应该是虚线。我尝试通过SHORTAUTHOR = "John Lennon", SORTNAME = "John Lennon"
在条目中设置来强制执行此操作J. Lennon
,但没有效果。
如何获取lennon1971
以下示例中条目的虚线条目?
\documentclass{article}
\usepackage[style = authoryear-comp, dashed = true, sorting = nyt]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{lennon1970,
AUTHOR = "J. Lennon",
TITLE = "My life with the Beatles",
YEAR = "1970",
SHORTAUTHOR = "John Lennon",
SORTNAME = "John Lennon"}
@BOOK{lennon1971,
AUTHOR = "John Lennon",
TITLE = "Moving on",
YEAR = "1971"}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
答案1
正如 PLK 在评论中所建议的,您可以使用源映射将某些名称形式替换为另一个标准化名称,而无需更改您的 bib 文件。
\documentclass{article}
\usepackage[style = authoryear-comp, dashed = true, sorting = nyt]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{lennon1970,
AUTHOR = "J. Lennon",
TITLE = "My life with the Beatles",
YEAR = "1970"}
@BOOK{lennon1971,
AUTHOR = "John Lennon",
TITLE = "Moving on",
YEAR = "1971"}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=author,
match={J. Lennon},
replace={John Lennon}]
}
}
}
\begin{document}
\nocite{*}
\printbibliography
\end{document}