Biblatex - idemtracker 未按预期工作

Biblatex - idemtracker 未按预期工作

idemtracker当连续引用同一作者的几部作品时,效果并不如预期。这
是我得到的结果:

在此处输入图片描述

我原本期望得到:

MIT. "Bla bla 2020"
Idem, "Bla bla 2018"
Idem, "Bla bla 2019"
Idem, "Bla bla 2018"

在参考书目中不存在这样的问题,Biblatex 正确地检测到三次是同一位作者。

在此处输入图片描述

有没有办法改变 Biblatex 的行为以实现所需的结果?

\documentclass{book}
\usepackage[backend=biber, style=verbose-trad1, idemtracker=true]{biblatex}

\begin{filecontents}{bibliography.bib}
@Online{MIT2020,
  author = {MIT},
  url = {blablabla.com},
  title = {Bla bla 2020},
}
@Online{MIT2019,
  author = {MIT},
  url = {blablabla.com},
  title = {Bla bla 2019},
}
@Online{MIT2018,
  author = {MIT},
  url = {blablabla.com},
  title = {Bla bla 2018},
}
\end{filecontents}

\addbibresource{bibliography.bib}

\begin{document}
\footcite{MIT2020}
\footcite{MIT2018}
\footcite{MIT2019}
\footcite{MIT2018}

\printbibliography
\end{document}

答案1

正如 Ulrike 在评论中所说,verbose-trad1打印第一个引用的完整引用,而这些引用没有提供使用选项同上

这是启用的方法同上\ifciteidem也适用于首次引用。我们的想法是向 bibmacros 中添加对authoreditor和 的测试translator

\documentclass{article}
\usepackage[backend=biber, style=verbose-trad1, idemtracker=true]{biblatex}

\makeatletter
\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\ifboolexpr{test {\ifcitation} and test {\ifciteidem}}
          {\bibstring[\mkibid]{idem\thefield{gender}}}
          {\printnames{author}}%
        \setunit{\printdelim{authortypedelim}}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{authorstrg}}
    {\global\undef\bbx@lasthash}}

\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\ifboolexpr{test {\ifcitation} and test {\ifciteidem}}
          {\bibstring[\mkibid]{idem\thefield{gender}}}
          {\printnames{editor}}%
        \setunit{\printdelim{editortypedelim}}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{editor}}
    {\global\undef\bbx@lasthash}}

\renewbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\ifboolexpr{test {\ifcitation} and test {\ifciteidem}}
          {\bibstring[\mkibid]{idem\thefield{gender}}}
          {\printnames{translator}}%
        \setunit{\printdelim{translatortypedelim}}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{translator}}
    {\global\undef\bbx@lasthash}}
\makeatother

\begin{filecontents}{\jobname.bib}
@online{MIT2020,
  author = {MIT},
  url    = {blablabla.com},
  title  = {Bla bla 2020},
}
@online{MIT2019,
  author = {MIT},
  url    = {blablabla.com},
  title  = {Bla bla 2019},
}
@online{MIT2018,
  author = {MIT},
  url    = {blablabla.com},
  title  = {Bla bla 2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
Lorem\autocite{MIT2020}
ipsum\autocite{MIT2018}
dolor\autocite{MIT2019}
sit\autocite{MIT2018}

\printbibliography
\end{document}

1 MIT。Bla bla 2020。网址:blablabla.com。2 同上。Bla bla 2018。网址:blablabla.com。3 同上。Bla bla 2019。网址:blablabla.com。4 同上,Bla bla 2018。


以下方法稍微更模块化

\documentclass{article}
\usepackage[backend=biber, style=verbose-trad1, idemtracker=true]{biblatex}

\makeatletter
\newbibmacro{ifrepeatauthor}{\ifciteidem}
\newbibmacro{repeatedauthor}{%
  \bibstring[\mkibid]{idem\thefield{gender}}}

\AtBeginBibliography{%
  \renewbibmacro{ifrepeatauthor}{\usebibmacro{bbx:dashcheck}}%
  \renewbibmacro{repeatedauthor}{\bibnamedash}%
}

\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{ifrepeatauthor}
       {\usebibmacro{repeatedauthor}}
       {\printnames{author}%
        \setunit{\printdelim{authortypedelim}}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{authorstrg}}
    {\global\undef\bbx@lasthash}}

\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{ifrepeatauthor}
       {\usebibmacro{repeatedauthor}}
       {\printnames{editor}%
        \setunit{\printdelim{editortypedelim}}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{editor}}
    {\global\undef\bbx@lasthash}}

\renewbibmacro*{bbx:translator}[1]{%
  \ifboolexpr{
    test \ifusetranslator
    and
    not test {\ifnameundef{translator}}
  }
    {\usebibmacro{ifrepeatauthor}
       {\usebibmacro{repeatedauthor}}
       {\printnames{translator}%
        \setunit{\printdelim{translatortypedelim}}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{translator}}
    {\global\undef\bbx@lasthash}}
\makeatother

\begin{filecontents}{\jobname.bib}
@online{MIT2020,
  author = {MIT},
  url    = {blablabla.com},
  title  = {Bla bla 2020},
}
@online{MIT2019,
  author = {MIT},
  url    = {blablabla.com},
  title  = {Bla bla 2019},
}
@online{MIT2018,
  author = {MIT},
  url    = {blablabla.com},
  title  = {Bla bla 2018},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
Lorem\autocite{MIT2020}
ipsum\autocite{MIT2018}
dolor\autocite{MIT2019}
sit\autocite{MIT2018}

\printbibliography
\end{document}

相关内容