在作者年份風格的多個引用之間添加空格

在作者年份風格的多個引用之間添加空格

我使用biblatexwithauthoryear-icomp風格並想引用同一作者同一年寫的兩部作品。的當前輸出\citet{examplea, exampleb}

約翰 (1991a,b)

但我更願意增加一個額外的空間

約翰 (1991a, b)

我已經嘗試重新定義\multicitedelim\compcitedelim通過

\renewcommand{\multicitedelim}{\addcomma\addspace}
\renewcommand{\compcitedelim}{\addcomma\addspace}

但這並沒有達到預期的效果。

微量元素

\documentclass{article}

\usepackage[backend=biber, natbib, style=authoryear-icomp]{biblatex}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@MISC{examplea,
  author = {John, Doe},
  title = {MyBook A},
  date = {1991}
}
@MISC{exampleb,
  author = {John, Doe},
  title = {MyBook B},
  date = {1991}
}    
\end{filecontents*}
\bibliography{\jobname.bib}

\begin{document}
\citet{examplea, exampleb}
\end{document}

答案1

這種行為的罪魁禍首是 bibmacro textcite...

在序言中加入以下行(xpatch需要包)

\xpatchbibmacro{textcite}
  {\setunit{\addcomma}}
  {\setunit{\addcomma\addspace}}
  {}
  {}

解決了問題。

完整程式碼(我也改成\bibliography\addbibresource

\documentclass{article}

\usepackage[backend=biber, natbib, style=authoryear-icomp]{biblatex}

\usepackage{xpatch}
\xpatchbibmacro{textcite}
  {\setunit{\addcomma}}
  {\setunit{\addcomma\addspace}}
  {}
  {}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@MISC{examplea,
  author = {John, Doe},
  title = {MyBook A},
  date = {1991}
}
@MISC{exampleb,
  author = {John, Doe},
  title = {MyBook B},
  date = {1991}
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\citet{examplea, exampleb}
\end{document} 

輸出:

在此輸入影像描述

相關內容