我使用biblatex
withauthoryear-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}
輸出: