我正在編寫一個 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}