我希望能够使用 biblatex 在同一帧上(单独)打印某些参考文献。我以为我可以使用 来做到这一点\newrefcontext
,但是这不起作用,如下方的 MWE 所示。只要\printbibliography
执行 ,就会打印所有参考文献。
另外,有没有办法在框架上显示参考编号,而不是显示小页面图标?\defbibenvironment
在普通文档中可以使用 ,但在 beamer 中似乎不起作用。
\documentclass{beamer}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Doe2012a,
author = {J. Doe},
title = {Lorem Ipsum -- Part I},
journal = {J. Dolor Sit Am.},
language = {English},
volume = {1},
pages = {1--10},
month = {1},
year = {2012},
}
@article{Doe2019a,
author = {J. Doe},
title = {Lorem Ipsum -- Part II},
journal = {J. Dolor Sit Am.},
volume = {2},
pages = {1--30},
month = {1},
year = {2019},
}
\end{filecontents}
\usepackage[backend=biber, giveninits=true, hyperref]{biblatex}
\addbibresource{\jobname.bib}
\defbibenvironment{bibliography}%
{\scriptsize\begin{enumerate}}%
{\end{enumerate}}%
{\item}%
\begin{document}
\begin{frame}
First reference only: \newrefcontext \nocite{Doe2012} \printbibliography
\vskip 1cm%
All references: \newrefcontext \nocite{*} \printbibliography
\end{frame}
\end{document}
答案1
要将参考书目分开,请使用refsection
s 而不是refcontext
s。srefcontext
控制排序和类似的上下文相关数据。srefsection
将参考书目和引文完全分开。还有refsegment
s,可用于细分参考书目而不使它们保持独立。
如果您使用,您的示例将按预期工作
\newrefsection
代替\newrefcontext
。
\setbeamertemplate{bibliography item}{\insertbiblabel}
你可以按照说明恢复参考书目编号如何获取 Beamer 书目中的编号条目。
\documentclass{beamer}
\usepackage[backend=biber, giveninits=true]{biblatex}
\defbibenvironment{bibliography}
{\scriptsize\begin{enumerate}}
{\end{enumerate}}
{\item}%
\setbeamertemplate{bibliography item}{\insertbiblabel}
\begin{filecontents}{\jobname.bib}
@article{Doe2012a,
author = {J. Doe},
title = {Lorem Ipsum -- Part I},
journal = {J. Dolor Sit Am.},
language = {English},
volume = {1},
pages = {1--10},
month = {1},
year = {2012},
}
@article{Doe2019a,
author = {J. Doe},
title = {Lorem Ipsum -- Part II},
journal = {J. Dolor Sit Am.},
volume = {2},
pages = {1--30},
month = {1},
year = {2019},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\begin{frame}
First reference only: \newrefsection \nocite{Doe2012a} \printbibliography
\vskip 1cm
All references: \newrefsection \nocite{*} \printbibliography
\end{frame}
\end{document}