我正在编写一个 latex Beamer 文件,在设置部分和子部分时遇到了一些问题。空间不足以显示我的文本。我想增加范围以包含文本,而不是减小文本大小。
这是我的文字
\documentclass[compress]{beamer}
\usetheme{CambridgeUS}
\setbeamerfont{section in head/foot}{size=\fontsize{15}{15}\selectfont}
\setbeamerfont{subsection in head/foot}{size=\fontsize{15}{15}\selectfont}
\begin{document}
\section{Title Page}
\subsection{XXXXXXXXXXXXXXXXXXXXXXXX}
\begin{frame}
\title{Estimation}
\titlepage
\end{frame}
\end{document}
谢谢!
答案1
作为一个快速技巧,你可以使用\addtobeamertemplate{headline}{\usebeamerfont{section in head/foot}}{}
\documentclass[compress]{beamer}
\usetheme{CambridgeUS}
\setbeamerfont{section in head/foot}{size=\fontsize{15}{15}\selectfont}
\setbeamerfont{subsection in head/foot}{size=\fontsize{15}{15}\selectfont}
\addtobeamertemplate{headline}{\usebeamerfont{section in head/foot}}{}
\begin{document}
\section{Title Page}
\subsection{XXXXXXXXXXXXXXXXXXXXXXXX}
\begin{frame}
\title{Estimation}
\titlepage
\end{frame}
\end{document}
如果您需要对尺寸进行更精细的控制,您可以通过修改以下标题重新定义中的值ht=...
(也可能是)来更改标题的高度:dp=...
\documentclass[compress]{beamer}
\usetheme{CambridgeUS}
\setbeamerfont{section in head/foot}{size=\fontsize{15}{15}\selectfont}
\setbeamerfont{subsection in head/foot}{size=\fontsize{15}{15}\selectfont}
\setbeamertemplate{headline}{%
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=4.65ex,dp=1.5ex,right]{section in head/foot}%
\usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=4.65ex,dp=1.5ex,left]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}\hspace*{2ex}\insertsubsectionhead
\end{beamercolorbox}}%
\vskip0pt%
}
\begin{document}
\section{Title Page}
\subsection{XXXXXXXXXXXXXXXXXXXXXXXX}
\begin{frame}
\title{Estimation}
\titlepage
\end{frame}
\end{document}