如何将第二行脚注“作者。标题。年份。”替换为“同上”?

如何将第二行脚注“作者。标题。年份。”替换为“同上”?

我想提供以下足迹:

作者。文章标题。文章年份。[ref]

或者

同上 [ref](第二次引用同一内容)

对于第一次演示,我使用了一个新的引用命令,该命令定义在自定义 \footcite 命令

以下是一些用于测试目的的代码:

\begin{filecontents}{mybib.bib}
@article{Aggarwal2004b,
author = {Aggarwal, B. B. and Takada, Y. and Oommen, O. V.},
journal = {Expert Opin Investig Drugs},
month = oct,
number = {10},
pages = {1327--1338},
publisher = {Informa Pharma Science},
title = {{From chemoprevention to chemotherapy: common targets and common goals}},
volume = {13},
year = {2004}
}
\end{filecontents}    
\documentclass{report}
\usepackage[autolang=hyphen,backend=biber,style=numeric]{biblatex}
\usepackage[bookmarks,colorlinks=true]{hyperref}

\DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printnames{labelname}%
   \setunit{\labelnamepunct}
   \printfield[citetitle]{title}%
   \newunit
   \printfield{year}
   {\adddot}
   \mkbibbrackets{\usebibmacro{cite}}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\footpartcites}[\mkbibfootnote]{\footpartcite} {\addsemicolon\space}

\bibliography{mybib} 
\begin{document}

Test~\footpartcite{Aggarwal2004b}. \\
Test~\footpartcite{Aggarwal2004b}. \\
\printbibliography

\end{document}

但是,如果脚注引用已经在文档中,则不会用“同上 [ref]”替换脚注引用。

结果是:

结果

结果应该是这样的:

1 Aggarwal、Takada 和 Oommen。“从化学预防到化学治疗:共同目标和共同目的”。2004 年。[参考]。

2 同上。[参考]。

有什么解决方案可以用 Ibid 替换第二个脚注……?

答案1

您几乎已经完成了,我们唯一要做的就是告诉biblatex我们想要能够通过 来跟踪“ibid” ibidtracker=constrict(或任何其他打开的选项ibidtracker,请参阅第 56 页)biblatex文档有关更多信息,constrict请参阅authoryaer标准设置)。

在我们的新引用命令中,我们只需要检查引用是否之前被引用过(以及它是否不是新页面上的第一个引用),如果是,则打印“ibid”而不是整个内容

\DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
     {\usebibmacro{cite:ibid}}
     {\usebibmacro{cite:fullpartcite}}%
   \setunit{\addperiod\space}%
   \printtext[brackets]{%
     \usebibmacro{cite}}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

其中cite:ibid打印“ibid”,定义如下

\providecommand*{\mkibid}[1]{#1}
\newbibmacro*{cite:ibid}{%
  \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}}

cite:fullpartcite打印更详细的引文

\newbibmacro*{cite:fullpartcite}{%
  \printnames{labelname}%
  \setunit{\labelnamepunct}%
  \printfield[citetitle]{title}%
  \newunit
  \printfield{year}}

平均能量损失

\documentclass{article}
\usepackage[autolang=hyphen,backend=biber,style=numeric,ibidtracker=constrict]{biblatex}
\usepackage[bookmarks,colorlinks=true]{hyperref}

\providecommand*{\mkibid}[1]{#1}
\newbibmacro*{cite:ibid}{%
  \printtext[bibhyperref]{\bibstring[\mkibid]{ibidem}}}
\newbibmacro*{cite:fullpartcite}{%
  \printnames{labelname}%
  \setunit{\labelnamepunct}%
  \printfield[citetitle]{title}%
  \newunit
  \printfield{year}}

\DeclareCiteCommand{\footpartcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
     {\usebibmacro{cite:ibid}}
     {\usebibmacro{cite:fullpartcite}}%
   \setunit{\addperiod\space}%
   \printtext[brackets]{%
     \usebibmacro{cite}}}
  {\addsemicolon\space}
  {\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\footpartcites}[\mkbibfootnote]{\footpartcite}{\addsemicolon\space}

\addbibresource{biblatex-examples.bib} 

\begin{document}

Test\footpartcite{wilde,baez/article}.

Test\footpartcite{cicero} again \footpartcite{cicero}.

\printbibliography
\end{document}

在此处输入图片描述

相关内容