我在使用 Beamer 的侧边栏时遇到了问题。我使用的是 PaloAlto 主题,有太多部分和子部分,所以它超出了框架的范围。我读到过我可以减小字体大小,想知道当侧边栏在主题中预定义时,是否有办法减少每个部分标题之间的空间?谢谢!
编辑-这里是(缩短的)前导代码和问题的图片:
\documentclass[pdftex, mathserif/mathsans, red]{beamer}
\usetheme{PaloAlto}
\usecolortheme{beaver}
\setbeamercolor*{title in sidebar}{fg=darkred!50!black}
\setbeamercolor*{author in sidebar}{fg=darkgray}
\setbeamercolor*{section in sidebar}{fg=gray}
\setbeamercolor*{subsection in sidebar}{fg=gray}
\setbeamercovered{transparent}
\mode<presentation>
\begin{document}
您可以看到侧边栏中的标题超出了空间。
答案1
您可以使用以下方式更改侧边栏中各部分的字体大小
\setbeamerfont{section in sidebar}{size=\Tiny}
要更改垂直间距,您可以像这样重新定义
section in sidebar
和模板:section in sidebar shaded
\documentclass{beamer}
\usetheme{PaloAlto}
\usecolortheme{beaver}
\setbeamercolor*{title in sidebar}{fg=darkred!50!black}
\setbeamercolor*{author in sidebar}{fg=darkgray}
\setbeamercolor*{section in sidebar}{fg=gray}
\setbeamercolor*{subsection in sidebar}{fg=gray}
\setbeamercovered{transparent}
\mode<presentation>
\setbeamerfont{section in sidebar}{size=\Tiny}
\makeatletter
\setbeamertemplate{section in sidebar}
{%
\vbox{%
\vskip-5ex% <- was 1ex by default
\beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionhead}%
}%
}
\setbeamertemplate{section in sidebar shaded}
{%
\vbox{%
\vskip-5ex% <- was 1ex by default
\beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionhead}%
}%
}
\makeatother
\begin{document}
\section{title}
\begin{frame}
content...
\end{frame}
\section{title}
\begin{frame}
content...
\end{frame}
\end{document}