Biblatex Incollection:书名后的逗号

Biblatex Incollection:书名后的逗号

书名后面的句号应该是逗号。虽然我找到了类似的问题及其解决方案,但我无法解决我的问题。

梅威瑟:

\documentclass{article}
\usepackage{filecontents}
\usepackage[style=authoryear-icomp]{biblatex}

\begin{filecontents}{\jobname.bib}
@incollection{foo,
    author = {Author},
    title = {Title},
    booktitle = {Booktitle},
    editor = {Editor},
    location = {Location},
    year = {2013},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{foo}
\printbibliography
\end{document}

答案1

使用xpatch包来修补 bibdrivers,使其在宏后包含逗号而不是默认的\newunitpunct(由 插入\newunittitle

\documentclass{article}
\usepackage[style=authoryear-icomp]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@incollection{foo,
    author = {Author},
    title = {Title},
    booktitle = {Booktitle},
    editor = {Editor},
    location = {Location},
    year = {2013},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\usepackage{xpatch}
\def\dopatchbibdrivereditorcomma#1{%
  \xpatchbibdriver{#1}
    {\usebibmacro{maintitle+booktitle}%
     \newunit\newblock}
    {\usebibmacro{maintitle+booktitle}%
     \setunit{\addcomma\space}\newblock}
    {}
    {\typeout{failed to patch driver for type #1}}}
\forcsvlist{\dopatchbibdrivereditorcomma}{inbook,incollection,inproceedings}

\begin{document}
\nocite{foo}
\printbibliography
\end{document}

示例输出

相关内容