Beamer 书目图标是否可以与编号一起出现?
这邮政展示了一种根据参考类型选择图标的好方法。但是,除了显示类型之外,我还想添加编号以强调。
最小工作示例(MWE)。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{refs.bib}
@Book{Kuttruff2007,
author = {Heinrich Kuttruff},
publisher = {Taylor \& Francis},
title = {Acoustics: an introduction},
year = {2007},
isbn = {0203970896},
}
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[aspectratio=169]{beamer}
\usepackage[backend=biber, bibstyle=numeric, citestyle=numeric, sorting=none]{biblatex}
\addbibresource{refs.bib}
%% Set the icons
\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}
\title[Example]{Beamer example}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section{First section}
\begin{frame}{Title of frame: cite example}
Contents \cite{Kuttruff2007}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{References}
\begin{frame}[t,noframenumbering,plain,allowframebreaks]{References}
\frametitle{References}
\printbibliography
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EOF
谢谢您的帮助。
答案1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{refs.bib}
@Book{Kuttruff2007,
author = {Heinrich Kuttruff},
publisher = {Taylor \& Francis},
title = {Acoustics: an introduction},
year = {2007},
isbn = {0203970896},
}
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[aspectratio=169]{beamer}
\usepackage[backend=biber, bibstyle=numeric, citestyle=numeric, sorting=none]{biblatex}
\addbibresource{refs.bib}
%
\mode<presentation>{
\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}} }
{\lower2pt\hbox{\pgfuseimage{beamericonbook}}}
{\ifentrytype{online}
{\lower3pt\hbox{\pgfuseimage{beamericononline}}}
{\lower2pt\hbox{\pgfuseimage{beamericonarticle}}}}%
~\insertbiblabel}}
\title[Example]{Beamer example}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section{First section}
\begin{frame}{Title of frame: cite example}
Contents \cite{Kuttruff2007}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{References}
\begin{frame}[t,noframenumbering,plain,allowframebreaks]{References}
\frametitle{References}
\printbibliography
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EOF