我正在尝试在 Beamer 幻灯片中创建一个引用命令。为此,我创建了一个引用计数,用于对引用进行编号和堆叠。
我有两个问题:
正如您在下面看到的,计数器的值在两个引文中是相同的(仅适用于堆叠部分),这导致引文被相互覆盖
我用来表示文中引用的小数字与单词之间有一个空格。我可以使用负 hspace 来解决这个问题,但我认为有一种正确的方法可以做到这一点(无论我在命令前留空格还是不留空格,这种方法都可以奏效)
\documentclass{beamer}
\usepackage{eso-pic}
\usepackage[calc]{picture}
\newcounter{citecounter}[page]
\newcommand{\mycite}[1]{
\addtocounter{citecounter}{1}
\textsuperscript{\thecitecounter}
\AddToShipoutPictureFG*{
\put(0.95\paperwidth,0.07\paperheight + 12pt * {\value{citecounter}})
{\makebox(0,0)[r]{\color{black!60!white!30!green}
{\tiny{\textsuperscript{\thecitecounter}\rmfamily{ #1 }}}}}}%}
\begin{document}
\begin{frame}{References}
Mr. Smith \mycite{Mr. Smith, THEJOURNAL,{\bf 00}, 000000 (0000)} showed that Mrs. Smith \mycite{Mrs. Smith, THEJOURNAL,{\bf 00}, 000000 (0000)} showed that they were right.
\end{frame}
\end{document}
答案1
为什么要这么复杂?如果您想手动格式化参考文献,只需使用脚注即可。
\documentclass{beamer}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{footnote}{fg=green}
\makeatletter
\def\@makefnmark{\hbox{{{\usebeamercolor[fg]{footnote mark}\usebeamerfont*{footnote mark}$^\@thefnmark$}}}}
\def\@makefntext#1{%
\def\insertfootnotetext{ #1}%
\def\insertfootnotemark{\@makefnmark}%
\hfill \usebeamertemplate***{footnote}}
\makeatother
\renewcommand{\footnoterule}{}
\begin{document}
\begin{frame}{References}
Mr. Smith\footnote{\tiny Mr. Smith, THEJOURNAL,{\bf 00}, 000000 (0000)} showed that Mrs. Smith\footnote{\tiny Mrs. Smith, THEJOURNAL,{\bf 00}, 000000 (0000)} showed that they were right.
\end{frame}
\end{document}
要获得自动引用,也许可以查看\footcite
带有的命令biblatex
。