Biblatex“同上。”无法使用速记

Biblatex“同上。”无法使用速记

在我的参考书目中,有一本书带有shorthand,我正在使用biblatex带有 的包citestyle=authoryear-ibid,这样立即重复的引用就会被缩写“ibidem”取代。但是,如果一本书有值(参见 MWE),
那么这种方法就行不通了。 我希望有 引用(但shorthand
只是对于具有字段的书籍shorthand)被替换为“同上”。只要它是完全相同到前一个。如果不是,则应打印完整的引文(不带“同上”)。
因此,例如,MWE 的期望输出应该是

¹ Q, 1, 47, 56
² Ibid.
³ Q, 1, 47, 59

有什么想法吗?谢谢。MWE

\documentclass{book}

\usepackage[
    style=chicago-authordate,
    citestyle=authoryear-ibid,
    ibidpage=true,
]{biblatex}
\usepackage{filecontents}
  \begin{filecontents}{\jobname.bib}
        @book{Quaderni,
          publisher = {Einaudi},
          year = {1977},
          title = {Quaderni del carcere},
          address = {Torino},
          author = {Gramsci, Antonio},
          shorthand = {Q},
          pagination = {none}
        }
  \end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}

First sentence \footcite[1, 47, 56]{Quaderni}.
Second sentence \footcite[1, 47, 56]{Quaderni}.
Third sentence \footcite[1, 47, 59]{Quaderni}.

\end{document}

输出:

¹ Q, 1, 47, 56
² Q, 1, 47, 56
³ Q, 1, 47, 59

答案1

这需要对 bibmacro 进行一点修改cite

原始定义可以在authoryear-ibid.cbx(版本 3.16 中第 18-29 行)。我们只需\ifthenelse{\ifciteibid\AND\ifloccit\AND\NOT\iffirstonpage}\usebibmacro{cite:ibid}真的分支。

\documentclass{article}

\usepackage[
  style=chicago-authordate,
  citestyle=authoryear-ibid,
  ibidpage=true,
]{biblatex}

\renewbibmacro*{cite}{%
  \global\boolfalse{cbx:loccit}%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
       {\usebibmacro{cite:ibid}}
       {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
          {\usebibmacro{cite:label}%
           \setunit{\printdelim{nonameyeardelim}}}
          {\printnames{labelname}%
           \setunit{\printdelim{nameyeardelim}}}%
        \usebibmacro{cite:labeldate+extradate}}}
    {\ifthenelse{\ifciteibid\AND\ifloccit\AND\NOT\iffirstonpage}
       {\usebibmacro{cite:ibid}}
       {\usebibmacro{cite:shorthand}}}}

\begin{filecontents}{\jobname.bib}
@book{Quaderni,
  publisher  = {Einaudi},
  year       = {1977},
  title      = {Quaderni del carcere},
  address    = {Torino},
  author     = {Gramsci, Antonio},
  shorthand  = {Q},
  pagination = {none},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
First sentence \footcite[1, 47, 56]{Quaderni}.
Second sentence \footcite[1, 47, 56]{Quaderni}.
Third sentence \footcite[1, 47, 59]{Quaderni}.

First sentence \footcite[12]{kant:kpv}.
Second sentence \footcite[12]{kant:kpv}.
Third sentence \footcite[13]{kant:kpv}.

First sentence \footcite[380]{sigfridsson}.
Second sentence \footcite[380]{sigfridsson}.
Third sentence \footcite[381]{sigfridsson}.
\end{document}

1 Q, 1, 47, 56。2 同上。3 Q, 1, 47, 59。4 KpV,第 12 页。5 同上。6 KpV,第 13 页。7 Sigfridsson 和 Ryde 1998,第 380 页。8 同上。9 同上,第 381 页。

相关内容