当我在beamer
框架中包含参考文献时,首先打印作者,然后是标题,然后是期刊/笔记。我使用 bibtex 进行引用。
\bibliographystyle{unsrt}
\bibliography{report.bib}
输出如下:
我怎样才能使标题出现在顶部,作者出现在下方?
我一直在关注beamerbaselocalstructure.sty重新定义 newblock 定义,但迄今为止尚未成功。
以下是产生上述输出的示例代码(尽管它使用内联 bibitems 而不是 bibtex)。我不想在 bibtex 文件中切换作者和标题字段。
\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{thebibliography}{10}
\bibitem{patchdroid} Collin Mulliner, Jon Oberheide, William Robertson, and Engin Kirda. \newblock Scalable Third-Party Security Patches for Android Devices. \newblock In \textit{Proceedings of the 29th Annual Computer Security Applications Conference}, pages 259--268. ACM, 20143.
\end{thebibliography}
\end{frame}
\end{document}
答案1
我设法重新定义\beamer@newblock
,以便保存作者块中的文本,然后在标题块之后使用。我使用beamerbaselocalstructure.sty
(Till Tantau,Vedran Miletić)中命令的定义作为修改的起点。请注意,模板bibliography entry author
现在用于标题,标题模板用于作者。
欢迎任何拥有更好 LaTeX 技能的人来改进解决方案。
\documentclass{beamer}
\usepackage{xparse}
\makeatletter
\RenewDocumentCommand\beamer@newblock{u{\newblock}}{%
\def\newblock{%
\usebeamercolor[fg]{bibliography entry title}%
\usebeamerfont{bibliography entry title}%
\usebeamertemplate{bibliography entry author}%
\def\newblock{%
\usebeamercolor[fg]{bibliography entry author}%
\usebeamerfont{bibliography entry author}%
\usebeamertemplate{bibliography entry title}%
#1%
\usebeamercolor[fg]{bibliography entry location}%
\usebeamerfont{bibliography entry location}%
\usebeamertemplate{bibliography entry location}%
\def\newblock{%
\usebeamercolor[fg]{bibliography entry note}%
\usebeamerfont{bibliography entry note}%
\usebeamertemplate{bibliography entry note}}}}%
\leavevmode\setbox\beamer@tempbox=\hbox{}\ht\beamer@tempbox=1.5em\box\beamer@tempbox\newblock}
\makeatother
\begin{document}
\begin{frame}
\begin{thebibliography}{10}
\bibitem{patchdroid} Collin Mulliner, Jon Oberheide, William Robertson, and Engin Kirda. \newblock Scalable Third-Party Security Patches for Android Devices. \newblock In \textit{Proceedings of the 29th Annual Computer Security Applications Conference}, pages 259--268. ACM, 20143.
\end{thebibliography}
\end{frame}
\end{document}