使用这beamer
回答我已将我的大学徽标添加到使用主题制作的幻灯片的框架标题中Metropolis
。MWE:
\documentclass[9pt,aspectratio=169,]{beamer}
\usetheme[progressbar=frametitle,
subsectionpage=progressbar,
block=fill]{Metropolis}
\usepackage[export]{adjustbox}
\makeatletter
\setlength{\metropolis@frametitle@padding}{1.8ex}% <- default 2.2 ex
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\begin{beamercolorbox}[%
wd=\paperwidth,%
sep=0pt,%
leftskip=\metropolis@frametitle@padding,%
rightskip=\metropolis@frametitle@padding,%
]{frametitle}%
\metropolis@frametitlestrut@start%
\insertframetitle%
\nolinebreak%
\metropolis@frametitlestrut@end%
\hfill
\includegraphics[height=3ex,keepaspectratio,valign=c]{example-image}
\end{beamercolorbox}
}
\begin{document}
\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}
\end{document}
但现在框架标题下方不再有进度条。我尝试使用 Metropolis 中的代码将其重新添加手动的,但没有成功。任何帮助都值得感激。谢谢!
答案1
\usebeamertemplate*{progress bar in head/foot}
您可以在自定义框架标题定义末尾添加:
\documentclass[9pt,aspectratio=169,]{beamer}
\usetheme[progressbar=frametitle,
subsectionpage=progressbar,
]{moloch}% modern fork of the metropolis theme
\usepackage[export]{adjustbox}
\makeatletter
\setlength{\moloch@frametitle@padding}{1.8ex}% <- default 2.2 ex
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\begin{beamercolorbox}[%
wd=\paperwidth,%
sep=0pt,%
leftskip=\moloch@frametitle@padding,%
rightskip=\moloch@frametitle@padding,%
]{frametitle}%
\moloch@frametitlestrut@start%
\insertframetitle%
\nolinebreak%
\moloch@frametitlestrut@end%
\hfill
\includegraphics[height=3ex,keepaspectratio,valign=c]{example-image}
\end{beamercolorbox}
\usebeamertemplate*{progress bar in head/foot}
}
\setlength{\moloch@progressinheadfoot@linewidth}{3pt}% just to better see that it's working
\begin{document}
\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}
\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}
\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}
\end{document}