我正在使用一个自定义命令,之前我在这里得到了帮助(我还是个新手)。在使用时cite:ibid macro
,这个命令似乎在括号外添加句点时存在某种问题。
如果我写\parencitearticle{source}
,它会正确产生(Ibid.)
另一方面,如果我写\parencitearticle{source}.
,它仍然会产生(Ibid.)
,而不是(Ibid.).
如您在屏幕截图中看到的,这个问题似乎只发生在句号上,因此使用其他标点符号不会产生错误的结果。我曾尝试自己修复它,但如果没有您的帮助,我不可能做到。
这是我的完整代码:
\documentclass[a4paper,12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[german, main=italian, english]{babel}
\usepackage[autostyle]{csquotes}
\setquotestyle{english}
\MakeOuterQuote{"}
\usepackage[
backend=biber,
style=authoryear-icomp,
maxbibnames=4, maxcitenames=2,
ibidpage=true, pagetracker=false,
dashed=true,
autolang=other,
]{biblatex}
\DeclareCiteCommand{\parencitearticle}
{\booltrue{citetracker}%
\booltrue{pagetracker}%
}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{(\usebibmacro{cite:ibid})}
{(\printtext[bibhyperref]{\printfield{title}}%
\setunit{\addcomma\space}%
\printfield{journaltitle}%
\setunit{\addcolon\addspace}%
\printfield{pages})}}
{\multicitedelim}
{\usebibmacro{postnote}}
\usepackage{setspace}
\usepackage[colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor=blue]{hyperref}
\begin{filecontents}{\jobname.bib}
@suppperiodical{carolina-spartan,
author = "Anon.",
journal = "The Carolina Spartan",
month = "5",
url = "https://chroniclingamerica.loc.gov/lccn/sn83025802/1856-05-29/ed-1/seq-2/",
number = "14",
pages = "2",
title = "Brooks and Sumner",
volume = "XIII",
year = "1856",
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\noindent
\parencitearticle{carolina-spartan}
\\
The following are the ibid results:
\\
\parencitearticle{carolina-spartan}
\\
\parencitearticle{carolina-spartan}.
\\
\parencitearticle{carolina-spartan}..
\\
\parencitearticle{carolina-spartan}:
\\
\parencitearticle{carolina-spartan};
\end{document}
答案1
正如评论中提到的,问题在于手动插入的括号里面cite 命令定义。它无法与标点符号缓冲区正常工作。
正确的方法是将\mkbibparens
其作为命令定义的可选参数插入:
\DeclareCiteCommand{\parencitearticle}[\mkbibparens]
{\booltrue{citetracker}%
\booltrue{pagetracker}%
}
{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
{\usebibmacro{cite:ibid}}
{\printtext[bibhyperref]{\printfield{title}}%
\setunit{\addcomma\space}%
\printfield{journaltitle}%
\setunit{\addcolon\addspace}%
\printfield{pages}}}
{\multicitedelim}
{\usebibmacro{postnote}}