仅在脚注中同上,而不在正文中

仅在脚注中同上,而不在正文中

有没有办法实现同上功能biblatex 仅有的在脚注中(\footcite{key}\footnote{\cite{key}.}但不是在正在运行的文本中(bla bla \cite{key} bla bla)?

换句话说,我喜欢脚注中的行为,但我不想阅读ibidem连续文本(或者通常阅读脚注以外的任何内容)。

(当然,如果\autocite能够自行确定它是在脚注中发布(从而扩展为\cite)还是在运行文本中发布(从而扩展为\footcite),那么一定有办法让 idemtracker 也具有上下文相关性,对吗?

梅威瑟:

%!TEX TS-program = lualatexmk
\documentclass{scrbook}

\usepackage[style=authortitle-icomp,backend=biber]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Title},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text with a footnote.\footcite[99]{A01}

Some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the first right page \cite{A01}. That is ok.

\clearpage

Some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the left page \cite{A01}. That is ok.

\clearpage

Now some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the right page \cite{A01}. That is not ok.

Again, some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the right page \cite{A01}. That is not ok.

\clearpage

Some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the left page \cite{A01}. That is ok.

Again, some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the left page \cite{A01}. That is not ok.

\printbibliography

\end{document}

答案1

加载前插入此代码biblatex

\makeatletter
\def\blx@opt@ibidtracker@foot{%
  \let\blx@imc@ifciteibid\blx@ifciteibid@foot
  \let\blx@ibidtracker\blx@ibidtracker@foot
  \let\blx@ibidreset\blx@ibidreset@foot
  \booltrue{citetracker}}

\def\blx@ifciteibid@foot{%
  \ifbool{citetracker}
    {\iftoggle{blx@footnote}
       {\blx@imc@iffieldequals{entrykey}\blx@lastkey@text}
       {\@secondoftwo}}
    {\@secondoftwo}}

\def\blx@ibidtracker@foot{%
  \ifbool{citetracker}
    {\iftoggle{blx@footnote}
       {\global\let\blx@lastkey@text\abx@field@entrykey}
       {\global\let\blx@lastkey@foot\abx@field@entrykey}}
    {}}

\def\blx@ibidreset@foot{%
  \iftoggle{blx@footnote}
    {\global\undef\blx@lastkey@text}}
    {}
\makeatother

ibidtracker=foot并在加载时添加选项biblatex

梅威瑟:

%!TEX TS-program = lualatexmk
\documentclass{scrbook}

\makeatletter
\def\blx@opt@ibidtracker@foot{%
  \let\blx@imc@ifciteibid\blx@ifciteibid@foot
  \let\blx@ibidtracker\blx@ibidtracker@foot
  \let\blx@ibidreset\blx@ibidreset@foot
  \booltrue{citetracker}}

\def\blx@ifciteibid@foot{%
  \ifbool{citetracker}
    {\iftoggle{blx@footnote}
       {\blx@imc@iffieldequals{entrykey}\blx@lastkey@text}
       {\@secondoftwo}}
    {\@secondoftwo}}

\def\blx@ibidtracker@foot{%
  \ifbool{citetracker}
    {\iftoggle{blx@footnote}
       {\global\let\blx@lastkey@text\abx@field@entrykey}
       {\global\let\blx@lastkey@foot\abx@field@entrykey}}
    {}}

\def\blx@ibidreset@foot{%
  \iftoggle{blx@footnote}
    {\global\undef\blx@lastkey@text}}
    {}
\makeatother

\usepackage[style=authortitle-icomp,backend=biber,ibidtracker=foot]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Title},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text with a footnote.\footcite[99]{A01}

Some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the first right page \cite{A01}. That is ok.

\clearpage

Some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the left page \cite{A01}. That is ok.

\clearpage

Now some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the right page \cite{A01}. That is not ok.

Again, some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the right page \cite{A01}. That is not ok.

\clearpage

Some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the left page \cite{A01}. That is ok.

Again, some text with a footnote.\footcite[99]{A01}

And now a reference in the text on the left page \cite{A01}. That is not ok.

\printbibliography

\end{document} 

输出:

在此处输入图片描述

PS这个想法来自这个答案安德鲁·斯旺 (Andrew Swann) 的做法,却恰恰相反。

相关内容