我希望将速记内容印在参考书目方括号中前书目项目。我改编了lockstep 的这个答案该方法有一个问题:如果没有作者,则会出现多余的点。这显然是由于参考书目驱动程序命令\labelnamepunct
设置的\setunit
。有没有简单的方法可以避免输出\labelnamepunct
?
下面是一个可以说明问题的例子(KpV 是正确的,CTAN 有多余的标点符号):
\listfiles
\documentclass[ngerman]{scrartcl}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@InBook{kant:kpv,
shorthand = {KpV},
hyphenation = {german},
author = {Kant, Immanuel},
bookauthor = {Kant, Immanuel},
title = {Kritik der praktischen Vernunft},
shorttitle = {Kritik der praktischen Vernunft},
booktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
maintitle = {Kants Werke. Akademie Textausgabe},
volume = {5},
publisher = {Walter de Gruyter},
location = {Berlin},
date = {1968},
pages = {1--163}
}
@Online{ctan,
shorthand = {CTAN},
hyphenation = {american},
title = {CTAN},
subtitle = {The Comprehensive TeX Archive Network},
date = {2006},
url = {http://www.ctan.org},
urldate = {2006-10-01}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel,csquotes}
\usepackage[
style=authortitle,
backend=biber
]{biblatex}
\addbibresource{\jobname.bib}
\renewbibmacro*{begentry}{%
\iffieldundef{shorthand}
{}
{\printtext[brackets]{\usebibmacro{cite}}%
\addspace}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
以下是我得到的结果:
答案1
添加\nopunct
到 bibmacro 的重新定义begentry
。这样,下一个标点符号命令将不会打印任何内容。
\renewbibmacro*{begentry}{%
\iffieldundef{shorthand}
{}
{\printtext[brackets]{\usebibmacro{cite}}%
\nopunct\addspace}}
另请参阅我的回答到修复 biblatex 中字段后的标点符号。