beamer
我正在用和写一张海报beamerposter
。我使用专用命令为参考书目添加了一些样式。下面是一个最小示例。
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\setbeamertemplate{bibliography item}{\insertbiblabel}
\setbeamertemplate{bibliography entry title}{}
\setbeamertemplate{bibliography entry location}{}
\setbeamertemplate{bibliography entry note}{}
\setbeamercolor{bibliography item}{fg=black}
\setbeamercolor{bibliography entry author}{fg=black}
\setbeamercolor{bibliography entry title}{fg=black}
\setbeamercolor{bibliography entry location}{fg=black}
\setbeamercolor{bibliography entry note}{fg=black}
\setbeamerfont{bibliography item}{size=\footnotesize}
\setbeamerfont{bibliography entry author}{size=\footnotesize}
\setbeamerfont{bibliography entry title}{size=\footnotesize,series=\bfseries}
\setbeamerfont{bibliography entry location}{size=\footnotesize}
\setbeamerfont{bibliography entry note}{size=\footnotesize}
\begin{document}
\begin{frame}
\begin{thebibliography}{99}
\bibitem{Hecht12}
Frédéric \textsc{Hecht},
\newblock{New Development in FreeFem++,}
\newblock{Journal of Numerical Mathematics,}
\newblock{vol. 20, no. 3--4, pp. 251--265, 2012.}
\bibitem{Nedelec86}
Jean-Claude \textsc{Nédélec},
\newblock{A New Family of Mixed Finite Elements in $\mathbb{R}^3$,}
\newblock{Numerische Mathematik,}
\newblock{vol. 50, no. 1, pp. 57--81, 1986.}
\bibitem{Monk03}
Peter \textsc{Monk},
\newblock{Finite Element Methods for Maxwell's Equations,}
\newblock{Oxford University Press,}
\newblock{2003.}
\end{thebibliography}
\end{frame}
\end{document}
我遇到的问题是,字体大小属性适用于所有块,没有任何限制。如果我\footnotesize
仅指定标题,则第一个标题后面的块也将是这个大小。字体系列也会受到影响,如您在以下结果屏幕截图中看到的那样。
我究竟做错了什么?
答案1
这是预期的行为,请参阅beamer
-font的文档bibliography entry author
:
[...] 请注意,此模板的效果将持续到参考书目项目结束或直到以下模板之一撤消其效果。
series=\mdseries
因此,最简单的解决方案可能是通过包含非粗体文本等设置来完全指定字体模板。
作为替代方案,更改默认beamer
行为以重置每个块的字体模板将涉及修补beamer
要使用的内部命令\usebeamerfont*
,而不是无星号的版本\usebeamerfont
:
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\setbeamertemplate{bibliography item}{\insertbiblabel}
\setbeamertemplate{bibliography entry title}{}
\setbeamertemplate{bibliography entry location}{}
\setbeamertemplate{bibliography entry note}{}
\setbeamercolor{bibliography item}{fg=black}
\setbeamercolor{bibliography entry author}{fg=black}
\setbeamercolor{bibliography entry title}{fg=black}
\setbeamercolor{bibliography entry location}{fg=black}
\setbeamercolor{bibliography entry note}{fg=black}
\setbeamerfont{bibliography item}{size=\footnotesize}
\setbeamerfont{bibliography entry author}{size=\footnotesize}
\setbeamerfont{bibliography entry title}{size=\footnotesize,series=\bfseries}
\setbeamerfont{bibliography entry location}{size=\footnotesize}
\setbeamerfont{bibliography entry note}{size=\footnotesize}
\usepackage{regexpatch}
\makeatletter
\xpatchcmd*{\beamer@newblock}{\usebeamerfont}{\usebeamerfont*}{}{}
\makeatletter
\begin{document}
\begin{frame}
\begin{thebibliography}{99}
\bibitem{Hecht12}
Frédéric \textsc{Hecht},
\newblock New Development in FreeFem++,
\newblock Journal of Numerical Mathematics,
\newblock vol. 20, no. 3--4, pp. 251--265, 2012.
\bibitem{Nedelec86}
Jean-Claude \textsc{Nédélec},
\newblock A New Family of Mixed Finite Elements in $\mathbb{R}^3$,
\newblock Numerische Mathematik,
\newblock vol. 50, no. 1, pp. 57--81, 1986.
\bibitem{Monk03}
Peter \textsc{Monk},
\newblock Finite Element Methods for Maxwell's Equations,
\newblock Oxford University Press,
\newblock 2003.
\end{thebibliography}
\end{frame}
\end{document}
(请注意,as\newblock
应该用作分隔符,它不需要参数,所以示例中的括号有点误导 - 这就是我在代码中删除它们的原因。)