![如何在 Beamer Berkeley 的普通框架中居中标题和章节页面](https://linux22.com/image/473323/%E5%A6%82%E4%BD%95%E5%9C%A8%20Beamer%20Berkeley%20%E7%9A%84%E6%99%AE%E9%80%9A%E6%A1%86%E6%9E%B6%E4%B8%AD%E5%B1%85%E4%B8%AD%E6%A0%87%E9%A2%98%E5%92%8C%E7%AB%A0%E8%8A%82%E9%A1%B5%E9%9D%A2.png)
我正在使用 Beamer Berkeley 主题,侧边栏更宽。我想将标题页和章节页中的信息水平居中。
为了实现这一点,我为框架使用了纯文本选项。但是,标题等的位置和部分名称似乎与侧边栏有关,尽管由于纯文本模式,侧边栏本身是隐藏的。我该如何满足要求?谢谢。
MWE 如下:
\documentclass{beamer}
\usetheme[width=2cm]{Berkeley}
\AtBeginSection[]{
\begin{frame}[plain]
\vfill
\centering
\begin{beamercolorbox}
[sep=8pt,center,shadow=true,rounded=true]{title}
\usebeamerfont{title}\thesection. \insertsectionhead\par%
\end{beamercolorbox}
\vfill
\end{frame}
}
\title{Title Title Title Title Title Title Title Title Title}
\author{Author Author Author}
\begin{document}
\begin{frame}[plain]
\maketitle
\end{frame}
\begin{frame}{Frame 1}
Frame 1
\end{frame}
\section{Section Section Section Section Section}
\begin{frame}{Frame 2}
Frame 2
\end{frame}
\begin{frame}{Frame 3}
Frame 3
\end{frame}
\end{document}
答案1
您可以将标题页和章节页向左移动侧边栏宽度的一半:
\documentclass{beamer}
\usetheme[width=2cm]{Berkeley}
\AtBeginSection[]{
{
\hoffset=-.5\beamersidebarwidth
\begin{frame}[plain]
\vfill
\centering
\begin{beamercolorbox}
[sep=8pt,center,shadow=true,rounded=true]{title}
\usebeamerfont{title}\thesection. \insertsectionhead\par%
\end{beamercolorbox}
\vfill
\end{frame}
}
}
\title{Title Title Title Title Title Title Title Title Title}
\author{Author Author Author}
\begin{document}
{
\hoffset=-.5\beamersidebarwidth
\begin{frame}[plain]
\maketitle
\end{frame}
}
\begin{frame}{Frame 1}
Frame 1
\end{frame}
\section{Section Section Section Section Section}
\begin{frame}{Frame 2}
Frame 2
\end{frame}
\begin{frame}{Frame 3}
Frame 3
\end{frame}
\end{document}
如果您希望在标题和章节页面上拥有更多空间,您可以将标题向左移动到侧边栏的整个宽度并增加文本宽度:
\documentclass{beamer}
\usetheme[width=2cm]{Berkeley}
\AtBeginSection[]{
{
\hoffset=-\beamersidebarwidth
\advance\textwidth\beamersidebarwidth
\hsize\textwidth
\columnwidth\textwidth
\begin{frame}[plain]
\vfill
\centering
\begin{beamercolorbox}
[sep=8pt,center,shadow=true,rounded=true]{title}
\usebeamerfont{title}\thesection. \insertsectionhead\par%
\end{beamercolorbox}
\vfill
\end{frame}
}
}
\title{Title Title Title Title Title Title Title Title Title}
\author{Author Author Author}
\begin{document}
{
\hoffset=-\beamersidebarwidth
\advance\textwidth\beamersidebarwidth
\hsize\textwidth
\columnwidth\textwidth
\begin{frame}[plain]
\maketitle
\end{frame}
}
\begin{frame}{Frame 1}
Frame 1
\end{frame}
\section{Section Section Section Section Section}
\begin{frame}{Frame 2}
Frame 2
\end{frame}
\begin{frame}{Frame 3}
Frame 3
\end{frame}
\end{document}