footcite-重复引用

footcite-重复引用

我在演示中使用了biblatex包及其\footcite{}命令beamer。下面是一个简短的示例:

\documentclass{beamer}

\setbeamertemplate{navigation symbols}{}

% only for this example, otherwise in .bib file
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
    [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004",
    keywords =     "physics"
}

@book{dirac,
    title={The Principles of Quantum Mechanics},
    author={Paul Adrien Maurice Dirac},
    isbn={9780198520115},
    series={International series of monographs on physics},
    year={1981},
    publisher={Clarendon Press},
    keywords = {physics}
}
\end{filecontents}

\usepackage[style=verbose,citetracker,pagetracker=page,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\let\footcite\footfullcite
\begin{document}
 \begin{frame}
    Text text \footcite{einstein}\\
    Another text \footcite{einstein}\\

 \end{frame}

 \begin{frame}
    Text text text \footcite{dirac}\\
    And something more \footcite{einstein}
 \end{frame}

 \begin{frame}
     \printbibliography
 \end{frame} 

\end{document}

输出:

但是,我想保留一个数字作为参考。因此所需的输出将是:

我该怎么做?

答案1

使用答案奥黛丽并设置page tracker=page和重新定义\renewcommand\footcite\superfootcite

\documentclass{beamer}

\setbeamertemplate{navigation symbols}{}

% only for this example, otherwise in .bib file
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
    [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004",
    keywords =     "physics"
}

@book{dirac,
    title={The Principles of Quantum Mechanics},
    author={Paul Adrien Maurice Dirac},
    isbn={9780198520115},
    series={International series of monographs on physics},
    year={1981},
    publisher={Clarendon Press},
    keywords = {physics}
}
\end{filecontents}

\usepackage[style=numeric-comp,citetracker=true,pagetracker=page,sorting=none]{biblatex}

\makeatletter
%---------------------------------------------------------------
% Essentially verbatim from Joseph Wright (except for refinements to \ifciteseen test)
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/

\DeclareCiteCommand{\superfootcite}[\cbx@superscript]
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:superfoot}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\AtEveryCitekey{%
  \ifcsundef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}
    {\csnumgdef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}{0}}
    {}%
  \csnumgdef{cbx@instcount@last@\the\c@refsection @\thefield{entrykey}}{%
    \csuse{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}}%
  \csnumgdef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}{\value{instcount}}}

\def\iflastciteonsamepage{%
  \ifsamepage
    {\number\csuse{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}}
    {\number\csuse{cbx@instcount@last@\the\c@refsection @\thefield{entrykey}}}}

\newbibmacro*{cite:superfoot}{% 
  \iflastciteonsamepage   
    {}
    {\xappto\cbx@citehook{%
       \noexpand\footnotetext[\thefield{labelnumber}]{%
         \fullcite{\thefield{entrykey}}\addperiod}}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{#1}%
  \cbx@citehook
  \global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
%---------------------------------------------------------------
\makeatother

\let\stdfootcite\footcite
\renewcommand\footcite\superfootcite

\begin{document}
 \begin{frame}
    Text text \footcite{einstein}\\
    Another text \footcite{einstein}\\
 \end{frame}

 \begin{frame}
    Text text text \footcite{dirac}\\
    And something more \footcite{einstein}
 \end{frame}

 \begin{frame}
     \printbibliography
 \end{frame} 

\end{document}

相关内容