我有inbook
条目,其中author
与相同bookauthor
。在这种情况下,默认情况下,bookauthor
引用中会省略 a。可以通过以下方式更改
\renewbibmacro*{bybookauthor}{%
\printnames{bookauthor}
}
但现在我们打印了两次相同的名称。我该如何启用条目idemtracker
内部功能inbook
?MWE:
\documentclass{article}
\usepackage[style=verbose-trad1]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inbook{mybook,
author={Done, John},
bookauthor={Done, John},
title={Chapter title},
booktitle={Main book title},
crossref={mainbook},
}
\end{filecontents}
\renewbibmacro*{bybookauthor}{%
\printnames{bookauthor}
}
\begin{document}
\cite{mybook}
\end{document}
更新:
我找到了部分解决方案:
\renewbibmacro*{bybookauthor}{%
\ifnamesequal{author}{bookauthor}
{\bibstring[\mkibid]{idem\thefield{gender}}%
\setunit{\printdelim{nametitledelim}}}
{\printnames{bookauthor}}
} 甚至
\renewbibmacro*{bybookauthor}{%
\ifnamesequal{author}{bookauthor}
{\usebibmacro{cite:idem}}
{\printnames{bookauthor}}}
答案1
正确使用分隔符有点棘手,因为标点符号跟踪器通常会打印它获得的最后一个标点符号,驱动程序会\newunitpunct
在执行bookauthor
bibmacro 后添加。我们可以使用\printunit
而不是常规方法\setunit
来解决此问题。
\documentclass{article}
\usepackage[style=verbose-trad1]{biblatex}
\renewbibmacro*{bybookauthor}{%
\ifnamesequal{author}{bookauthor}
{\bibstring[\mkibid]{idem\thefield{gender}}%
\printunit{\addcomma\space}}
{\printnames{bookauthor}}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inbook{mybook,
author = {Done, John},
bookauthor = {Done, John},
title = {Chapter title},
booktitle = {Main book title},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{mybook}
\end{document}