使用 Biblatex 在 Beamer 中统一引用编号

使用 Biblatex 在 Beamer 中统一引用编号

我正在尝试在 Beamer 演示文稿中包含参考书目。理想的行为应该是:

  • 最后是完整的参考书目,包含所有引用的项目和类似 IEEEtran 的风格
  • 在每个框架上,都可以在脚注中添加完整的引用:这应该没有脚注编号,但应该使用括号中的参考编号,从而允许在该幻灯片中的参考文献上方使用上标数字的脚注(就像在脚注中有两个块,真正的脚注在前面,参考文献在后面)。

我所能得到的是以下内容,它只使用脚注编号,这不一致,我认为对读者来说有点混乱。此外,如果有人对幻灯片中的不同引用方式提出建议,我们非常欢迎。

\documentclass[10pt]{beamer}
\usepackage[utf8]{inputenc}

\usepackage{filecontents}
\begin{filecontents}{MWE.bib}
@article{Knuth92,
        author = "D.E. Knuth",
        title = "Two notes on notation",
        journal = "Amer. Math. Monthly",
        volume = "99",
        year = "1992",
        pages = "403--422",
}

@book{ConcreteMath,
        author = "R.L. Graham and D.E. Knuth and O. Patashnik",
        title = "Concrete mathematics",
        publisher = "Addison-Wesley",
        address = "Reading, MA",
        year = "1989"
}

@unpublished{Simpson,
        author = "H. Simpson",
        title = "Proof of the {R}iemann {H}ypothesis",
        note = "preprint (2003), available at
        \texttt{http://www.math.drofnats.edu/riemann.ps}",
        year = "2003"
}
\end{filecontents}

\usetheme{Warsaw}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number] %% Add total slide number
\setbeamertemplate{bibliography item}{\insertbiblabel} %% Remove book symbol from references and add number
\usepackage[style=ieee,backend=bibtex]{biblatex}
\addbibresource{MWE.bib}

\begin{document}

\begin{frame}{Some references}
Some references 
\cite{Knuth92,Simpson,ConcreteMath}
\cite{Knuth92}\footfullcite{Knuth92}
\cite{ConcreteMath}\footfullcite{ConcreteMath}
\end{frame}


\begin{frame}[t,allowframebreaks]{References} %% Aligned top
\printbibliography[heading=none]
\end{frame}

\end{document}

在此处输入图片描述 在此处输入图片描述


我在 @moewe 的大力帮助下编辑了 MWE。现在再补充一点细节:将所有脚注移到脚注引用之前有多复杂?因此,所有脚注,然后是该页面中的所有引用(使用\footfullcite)(此处脚注 2 位于 [1] 之前)?

修改后的代码如下:

\documentclass[10pt]{beamer}
\usepackage[utf8]{inputenc}

\usepackage{filecontents}
\begin{filecontents}{MWE.bib}
@article{Knuth92,
        author = "D.E. Knuth",
        title = "Two notes on notation",
        journal = "Amer. Math. Monthly",
        volume = "99",
        year = "1992",
        pages = "403--422",
}

@book{ConcreteMath,
        author = "R.L. Graham and D.E. Knuth and O. Patashnik",
        title = "Concrete mathematics",
        publisher = "Addison-Wesley",
        address = "Reading, MA",
        year = "1989"
}

@unpublished{Simpson,
        author = "H. Simpson",
        title = "Proof of the {R}iemann {H}ypothesis",
        note = "preprint (2003), available at
        \texttt{http://www.math.drofnats.edu/riemann.ps}",
        year = "2003"
}
\end{filecontents}

\usetheme[progressbar=frametitle,numbering=fraction]{metropolis}
\setbeamertemplate{bibliography item}{\insertbiblabel} %% Remove book symbol from references and add number
\usepackage[style=ieee,backend=bibtex,citetracker=true]{biblatex}
\addbibresource{MWE.bib}

% See https://tex.stackexchange.com/a/396754/28146
\makeatletter
\newbibmacro*{hypercite}{%
  \renewcommand{\@makefntext}[1]{\noindent\normalfont##1}%
  \footnotetext{%
    \blxmkbibnote{foot}{%
    \printtext[labelnumberwidth]{%
      \printfield{prefixnumber}%
      \printfield{labelnumber}}%
    \addspace
    \fullcite{\thefield{entrykey}}}}}

\DeclareCiteCommand{\hypercite}%
  {\usebibmacro{cite:init}}
  {\usebibmacro{hypercite}}
  {}
  {\usebibmacro{cite:dump}}

% Redefine the \footfullcite command to use the reference number
\renewcommand{\footfullcite}[1]{\cite{#1}\hypercite{#1}}
\makeatother

\begin{document}

\begin{frame}{Some references}
Some references non cited in the footnotes, \cite{Knuth92,Simpson,ConcreteMath} and some cited also in the footnotes\footnote{A footnote}, \footfullcite{Knuth92} and \footfullcite{ConcreteMath}\footnote{A second footnote}
\end{frame}


\begin{frame}[t,allowframebreaks]{References} %% Aligned top
\printbibliography[heading=none]
\end{frame}

\end{document}

结果是: 在此处输入图片描述 在此处输入图片描述

答案1

您可以使用以下灵感有关 DeclareCiteCommand 的附加参数的帮助

\documentclass[10pt]{beamer}
\usepackage[%
    backend=biber,
    style=ieee,
    citetracker=true,
    ]{biblatex}

\usetheme{Warsaw}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{bibliography item}{\insertbiblabel}

\makeatletter
\newbibmacro*{hypercite}{%
  \renewcommand{\@makefntext}[1]{\noindent\normalfont##1}%
  \footnotetext{%
    \blxmkbibnote{foot}{%
    \printtext[labelnumberwidth]{%
      \printfield{prefixnumber}%
      \printfield{labelnumber}}%
    \addspace
    \fullcite{\thefield{entrykey}}}}}

\DeclareCiteCommand{\hypercite}%
  {\usebibmacro{cite:init}}
  {\usebibmacro{hypercite}}
  {}
  {\usebibmacro{cite:dump}}
\makeatother

\addbibresource{biblatex-examples.bib}

\begin{document}
\begin{frame}{Some references}
Some references 
Lorem\footnote{Duizend}
\cite[1]{sigfridsson,wilde} and \cite[2]{sigfridsson}A\hypercite{sigfridsson}B and \cite[3]{worman} and \cite[4]{geer}
\end{frame}


\begin{frame}[t,allowframebreaks]{References}
\printbibliography[heading=none]
\end{frame}
\end{document}

第一页

这定义了一个新命令\hypercite,该命令没有输出,只带有包含来源完整引用的脚注。

相关内容