当不同页面引用相同参考文献时,将“Ibid.”字符串替换为字符串“Ivi”

当不同页面引用相同参考文献时,将“Ibid.”字符串替换为字符串“Ivi”

我正在使用biblatexext-verbose-trad1风格memoir

当我随后在不同的页面上引用相同的参考文献时,我必须使用缩写“ivi”,而当在同一页面上引用相同的参考文献时,则保留通常的“ibid.”缩写。

这个问题也在tex.stackexchange.com/q/418701/35864,建议使用补丁。

正如下面的 MWE 所演示的,使用ext-verbose-trad1补丁建议的样式可以完美运行:

\documentclass[12pt, a4paper]{memoir}
\usepackage[italian]{babel}
\usepackage[style=ext-verbose-trad1]{biblatex}

 %patch to use ibid and ivi
 \usepackage{xpatch}     
 \NewBibliographyString{ibidemloccit,ibidemnoloccit}
 \DefineBibliographyStrings{italian}{%
   idem           = {\autocap{i}d},
   ibidemloccit   = {\mkbibemph{\autocap{i}bid\adddot}},
   ibidemnoloccit = {\mkbibemph{\autocap{i}vi}},
 }
 
 \xpatchbibmacro{author}
   {\printnames{author}}
   {\iffootnote
      {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{author}}}
      {\printnames{author}}}
   {}{}
 \xpatchbibmacro{bbx:editor}
   {\printnames{editor}}
   {\iffootnote
      {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
         {\usebibmacro{cite:idem}}
         {\printnames{editor}}}
      {\printnames{editor}}}
   {}{}
 \xpatchbibmacro{bbx:translator}
   {\printnames{translator}}
   {\iffootnote
      {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
         {\usebibmacro{cite:idem}}
         {\printnames{translator}}}
      {\printnames{translator}}}
   {}{}
 
 \renewbibmacro*{cite:ibid}{%
   \printtext{%
     \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
       \ifloccit
         {\bibstring[\mkibid]{ibidemloccit}%
          \global\toggletrue{cbx:loccit}}
         {\bibstring[\mkibid]{ibidemnoloccit}}}}}
 
  \addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \footcite{aristotle:anima}
Lorem \footcite[14]{aristotle:anima}
Lorem \footcite[198]{aristotle:anima}
ipsum \footcite[198]{aristotle:anima}

\printbibliography
\end{document}

给出输出:

当我使用该样式时,ext-verbose-trad2它给出了另一个结果。最后一个引用是前一个的简单重复,而应该出现字符串“Ibid”:

在此处输入图片描述

答案1

链接问题的答案仍然适用于(ext-)verbose-trad2。您只是遗漏了答案中最重要的部分(在第一句中提到):您需要设置选项ibidpage=true,

\documentclass[12pt, a4paper]{memoir}
\usepackage[italian]{babel}
\usepackage[style=ext-verbose-trad2, ibidpage=true]{biblatex}

%patch to use ibid and ivi
\usepackage{xpatch}     
\NewBibliographyString{ibidemloccit,ibidemnoloccit}
\DefineBibliographyStrings{italian}{%
  idem           = {\autocap{i}d},
  ibidemloccit   = {\mkbibemph{\autocap{i}bid\adddot}},
  ibidemnoloccit = {\mkbibemph{\autocap{i}vi}},
}

\xpatchbibmacro{author}
  {\printnames{author}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
       {\usebibmacro{cite:idem}}
       {\printnames{author}}}
     {\printnames{author}}}
  {}{}
\xpatchbibmacro{bbx:editor}
  {\printnames{editor}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{editor}}}
     {\printnames{editor}}}
  {}{}
\xpatchbibmacro{bbx:translator}
  {\printnames{translator}}
  {\iffootnote
     {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
        {\usebibmacro{cite:idem}}
        {\printnames{translator}}}
     {\printnames{translator}}}
  {}{}

\renewbibmacro*{cite:ibid}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \ifloccit
        {\bibstring[\mkibid]{ibidemloccit}%
         \global\toggletrue{cbx:loccit}}
        {\bibstring[\mkibid]{ibidemnoloccit}}}}}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \footcite{aristotle:anima}
Lorem \footcite[14]{aristotle:anima}
Lorem \footcite[198]{aristotle:anima}
ipsum \footcite[198]{aristotle:anima}

\printbibliography
\end{document}

4 同上。

相关内容