上面的调色板跳跃度较低,看起来很丑。我们如何才能像单行标题那样添加一点填充?
\documentclass[aspectratio=169, xcolor={x11names}]{beamer}
\usecolortheme{seahorse}
\useoutertheme[]{split}
\useinnertheme{inmargin}
\newlength{\widthTextMarginLeft}
\setlength{\widthTextMarginLeft}{1.5mm}
\newlength{\widthTextMarginRight}
\setlength{\widthTextMarginRight}{2mm}
\setbeamersize{text margin left=\widthTextMarginLeft, text margin right=\widthTextMarginRight}
\newlength{\sidebarWidth}
\setlength{\sidebarWidth}{0.3\paperwidth}
\setbeamersize{sidebar width left=\sidebarWidth, sidebar width right=0cm}
\begin{document}
\begin{frame}{Uncovering Contents When They Cannot Fit in One Slide}
\end{frame}
\end{document}
答案1
“问题”在于,第一个标题“One Slide”的最后一行不包含任何降序字母,而“Uncovering Contents”的降序字母为“g”。如果您希望所有标题都像第二种情况一样,您可以在模板定义中添加一个\strut
after :\insertframetitle
\documentclass[aspectratio=169, xcolor={x11names}]{beamer}
\usecolortheme{seahorse}
\useoutertheme[]{split}
\useinnertheme{inmargin}
\newlength{\widthTextMarginLeft}
\setlength{\widthTextMarginLeft}{1.5mm}
\newlength{\widthTextMarginRight}
\setlength{\widthTextMarginRight}{2mm}
\setbeamersize{text margin left=\widthTextMarginLeft, text margin right=\widthTextMarginRight}
\newlength{\sidebarWidth}
\setlength{\sidebarWidth}{0.3\paperwidth}
\setbeamersize{sidebar width left=\sidebarWidth, sidebar width right=0cm}
\makeatletter
\setbeamertemplate{frametitle}{%
\ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
\@tempdima=\textwidth%
\advance\@tempdima by\beamer@leftmargin%
\advance\@tempdima by\beamer@rightmargin%
\begin{beamercolorbox}[sep=0.3cm,left,wd=\the\@tempdima]{frametitle}
\usebeamerfont{frametitle}%
\vbox{}\vskip-1ex%
\if@tempswa\else\csname beamer@fteleft\endcsname\fi%
\strut\insertframetitle\strut\par%
{%
\ifx\insertframesubtitle\@empty%
\else%
{\usebeamerfont{framesubtitle}\usebeamercolor[fg]{framesubtitle}\strut\insertframesubtitle\par}%
\fi
}%
\vskip-1ex%
\if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here...
\end{beamercolorbox}%
}
\makeatother
\begin{document}
\begin{frame}{Uncovering Contents When They Cannot Fit in One Slide}
\end{frame}
\end{document}
答案2
运行您的代码,我得到了正确的填充。但是您可以\vspace
在内容末尾使用:
\documentclass[aspectratio=169, xcolor={x11names}]{beamer}
\usecolortheme{seahorse}
\useoutertheme[]{split}
\useinnertheme{inmargin}
\newlength{\widthTextMarginLeft}
\setlength{\widthTextMarginLeft}{1.5mm}
\newlength{\widthTextMarginRight}
\setlength{\widthTextMarginRight}{2mm}
\setbeamersize{text margin left=\widthTextMarginLeft, text margin right=\widthTextMarginRight}
\newlength{\sidebarWidth}
\setlength{\sidebarWidth}{0.3\paperwidth}
\setbeamersize{sidebar width left=\sidebarWidth, sidebar width right=0cm}
\begin{document}
\begin{frame}{Uncovering Contents When They Cannot Fit in One Slide\vspace{0.2cm}}
\end{frame}
\end{document}