![Beamer 更改章节/小节页面](https://linux22.com/image/332254/Beamer%20%E6%9B%B4%E6%94%B9%E7%AB%A0%E8%8A%82%2F%E5%B0%8F%E8%8A%82%E9%A1%B5%E9%9D%A2.png)
在 Beamer 中,是否可以在 Section/Subsection 页面中进行以下更改,如附件 jpg 所示
1- 避免显示“章节/小节”字样 2- 在小节页面中包含章节标题 3- 使用颜色代码标记章节/小节页面
\documentclass{beamer}
\usepackage{beamerthemesplit}
\usetheme{PaloAlto}
\setbeamertemplate{navigation symbols}{}
\usepackage{xcolor}
\title
[]{\Large \bf My Thesis}
\subtitle
{}
\author
[]{{{\textcolor{blue}{\footnotesize H. John}}}}
\date
{{\small 2016}}
\usepackage{verbatim}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}[t,allowframebreaks]
\frametitle{Table of Contents}
\tableofcontents
\end{frame}
\section
[Int]{Introduction}
\frame{\sectionpage}
\subsection
[Scope]{Scope}
\frame{\subsectionpage}
\subsection
[Lim]{Limits}
\frame{\subsectionpage}
\section
[Mats]{Materials}
\frame{\sectionpage}
\subsection
[Mat1]{Material1}
\frame{\subsectionpage}
\subsection
[Mat2]{Material2}
\frame{\subsectionpage}
\section
[Meths]{Methods}
\frame{\sectionpage}
\subsection
[Meth1]{Method1}
\frame{\subsectionpage}
\subsection
[Meth2]{Method2}
\frame{\subsectionpage}
\end{document}
答案1
默认情况下,beamer 似乎使用部分和子部分页面中框的颜色part title
。以下代码用两种独立的颜色重新定义这些页面,然后在文档中可以更改它们以区分各个部分。
\documentclass{beamer}
\usepackage{beamerthemesplit}
\usetheme{PaloAlto}
\setbeamertemplate{navigation symbols}{}
\title[]{My Thesis}
\subtitle{}
\author[]{H. John}
\date{2016}
\listfiles
\setbeamercolor{author}{fg=blue}
\setbeamerfont{title}{size=\Large, series=\bfseries}
\setbeamerfont{author}{size=\footnotesize}
\setbeamerfont{date}{size=\small}
\setbeamertemplate{section page}
{
\begingroup
\begin{beamercolorbox}[sep=12pt,center]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
\endgroup
}
\setbeamertemplate{subsection page}
{
\begingroup
\begin{beamercolorbox}[sep=12pt,center]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
\vspace*{10pt}
\begin{beamercolorbox}[sep=8pt,center]{subsection title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
\endgroup
}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}[t,allowframebreaks]
\frametitle{Table of Contents}
\tableofcontents
\end{frame}
\setbeamercolor{section title}{bg=cyan!50!black}
\setbeamercolor{subsection title}{bg=cyan}
\section[Int]{Introduction}
\frame{\sectionpage}
\subsection
[Scope]{Scope}
\frame{\subsectionpage}
\subsection
[Lim]{Limits}
\frame{\subsectionpage}
\setbeamercolor{section title}{bg=green!50!black}
\setbeamercolor{subsection title}{bg=green}
\section
[Mats]{Materials}
\frame{\sectionpage}
\subsection
[Mat1]{Material1}
\frame{\subsectionpage}
\subsection
[Mat2]{Material2}
\frame{\subsectionpage}
\setbeamercolor{section title}{bg=yellow!50!black}
\setbeamercolor{subsection title}{bg=yellow}
\section
[Meths]{Methods}
\frame{\sectionpage}
\subsection
[Meth1]{Method1}
\frame{\subsectionpage}
\subsection
[Meth2]{Method2}
\frame{\subsectionpage}
\end{document}
评论:
- 您不需要
xcolor
beamer 中的包,beamer 本身会加载它。 - 与对外观进行修改不同
\author[]{{{\textcolor{blue}{\footnotesize H. John}}}}
,beamer 为其各个组件提供了非常舒适的机制来控制字体大小等。
\setbeamercolor{author}{fg=blue}
\setbeamerfont{author}{size=\footnotesize}
编辑:同时这个问题在 Beamer 开发版本中得到了修复(https://github.com/josephwright/beamer/commit/d05925d68cd467188096eb4f6b8f1993058c0641)。它应该包含在从 beamer v3.49 开始的标准 tex 发行版中。