Beamer 书目图标

Beamer 书目图标

我想在 Beamer 演示文稿中使用thebibliography环境列出我的参考资料,并附上精美的小

  • 书本图标 ( \beamertemplatebookbibitems) 和

  • 文章图标 ( \beamertemplatearticlebibitems)

在每个来源的前面。

网站也有图标吗?类似的东西\beamertemplatewebsitebibitems?如果没有,有没有办法轻松实现这一点?

答案1

这是模板online的选项bibliography item;显示预定义选项的示例:

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{thebibliography}{9}
\setbeamertemplate{bibliography item}[online]
\bibitem{A} ItemA
\setbeamertemplate{bibliography item}[book]
\bibitem{B} ItemB
\setbeamertemplate{bibliography item}[article]
\bibitem{C} ItemC
\setbeamertemplate{bibliography item}[triangle]
\bibitem{D} ItemD
\setbeamertemplate{bibliography item}[text]
\bibitem{E} ItemE
\end{thebibliography}
\end{frame}

\end{document}

在此处输入图片描述

当然,您也可以使用自己的图像:

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{thebibliography}{9}
\setbeamertemplate{bibliography item}{\includegraphics[width=1.5em]{ctanlion}}
\bibitem{A} CTAN lion drawing by Duane Bibby.
\end{thebibliography}
\end{frame}

\end{document}

在此处输入图片描述

答案2

biblatex可以扩展bibliography item模板来自动选择适当的图标。

\documentclass{beamer}
\usepackage[style=authoryear]{biblatex}
\usepackage{hyperref}

\setbeamertemplate{bibliography item}{%
  \ifboolexpr{ test {\ifentrytype{book}} or test {\ifentrytype{mvbook}}
    or test {\ifentrytype{collection}} or test {\ifentrytype{mvcollection}}
    or test {\ifentrytype{reference}} or test {\ifentrytype{mvreference}} }
    {\setbeamertemplate{bibliography item}[book]}
    {\ifentrytype{online}
       {\setbeamertemplate{bibliography item}[online]}
       {\setbeamertemplate{bibliography item}[article]}}%
  \usebeamertemplate{bibliography item}}

\defbibenvironment{bibliography}
  {\list{}
     {\settowidth{\labelwidth}{\usebeamertemplate{bibliography item}}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item}

\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{glashow,markey,knuth:ct:a,knuth:ct:b,companion,bertram,ctan}
\begin{frame}[noframenumbering,plain,allowframebreaks]{References}
\printbibliography
\end{frame}
\end{document}

在此处输入图片描述

相关内容