所以本质上我想这样做:是否可以降低 beamer 中框架标题框的高度? ... 但对于投影仪演示文稿中的部分框来说。换句话说:如何调整 beamer 中部分框的高度?
我目前使用以下模板:
\documentclass[]{beamer}
\setbeamertemplate{footline}[frame number]{}%gets rid of bottom navigation bars
\setbeamertemplate{navigation symbols}{}%remove navigation symbols
\setbeamertemplate{footline}{}%gets rid of footer
\useoutertheme[subsection=false]{miniframes}
\setbeamertemplate{mini frames}{}
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.2ex]{frametitle}
\hspace*{1ex}\insertframetitle%
\end{beamercolorbox}%
}
\setbeamercolor{frametitle}{fg=red,bg=black}
\setbeamercolor{title}{fg=red}
\setbeamertemplate{section in head/foot}{\hfill\bfseries\insertsectionhead}
\setbeamercolor{section in head/foot}{bg=red,fg=black}
\setbeamercolor{author in head/foot}{fg=red,bg=black}
\setbeamercolor{date in head/foot}{fg=red,bg=black}
\setbeamertemplate{section in head/foot shaded}[default][30]
\begin{document}
\section{Hello}
\begin{frame}{Hello}
Hello
\end{frame}
\end{document}
我想手动更改部分高度的原因是,编译上述代码时,TeX Live 2015 和 TeX Live 2018 之间似乎存在差异。在前者中,我得到:
我想通过手动调整 TeX Live 2018 行为来重现 TeX Live 2015 行为。如能得到任何帮助,我将不胜感激。
答案1
您的 2015 代码似乎存在部分错误,应该有两行,一行是文本,一行是红色区域中的符号,然后是黑色区域中的较大行。但第二行红色格式不正确。我打乱了部分行的顺序,因此在测试时会改变稳定性。请注意,更改顺序很容易影响标题,使其“模糊”或其他情况。
主题元素的相对位置对于良好行为至关重要。看看如果你简单地将最后的法兰克福替换为昂蒂布,整个结构会发生怎样的变化
改变顶部栏大小的最简单方法是将默认起始字体设置为 8pt。
\documentclass[8pt]{beamer}
%\usetheme{Frankfurt} % use at bottom of preamble for fuzzy edges (top=sharp)
\setbeamertemplate{navigation symbols}{}%remove navigation symbols
\setbeamertemplate{footline}[frame number]{}%gets rid of bottom navigation bars
\setbeamertemplate{footline}{}%gets rid of footer
\usefonttheme[onlysmall]{structurebold}
\setbeamerfont*{title}{shape=\itshape,family=\rmfamily}
\setbeamertemplate{section in head/foot}{\bfseries\insertsectionhead}
\setbeamercolor{section in head/foot}{bg=red,fg=black}
\setbeamercolor{author in head/foot}{fg=red,bg=black}
\setbeamercolor{date in head/foot}{fg=red,bg=black}
\setbeamertemplate{section in head/foot shaded}[default][30]
\setbeamercolor{frametitle}{fg=red,bg=black}
\setbeamercolor{title}{fg=red}
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.2ex]{frametitle}
\hspace*{1ex}\insertframetitle%
\end{beamercolorbox}%
}
\useoutertheme[subsection=false]{miniframes}
\setbeamertemplate{miniframes}{\small}
\usetheme{Frankfurt} % use here at bottom of preamble for fuzzy edges (top=sharp)
\begin{document}
\section{\tiny Hello There}
\begin{frame}{Hello}
Hello
\end{frame}
\begin{frame}{World}
World
\end{frame}
\end{document}
答案2
这个答案是假如由 Stackoverflow 用户提供萨姆卡特在里面聊天室。我在这里发布它是因为它解决了我的问题。
这是一个模板,当使用 TeX Live 2018 运行时,它可以重现问题中代码的 2015 行为。
\documentclass[]{beamer}
\setbeamertemplate{footline}[frame number]{}%gets rid of bottom navigation bars
\setbeamertemplate{navigation symbols}{}%remove navigation symbols
\setbeamertemplate{footline}{}%gets rid of footer
\useoutertheme[subsection=false]{miniframes}
\setbeamertemplate{mini frames}{}
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.2ex]{frametitle}
\hspace*{1ex}\insertframetitle%
\end{beamercolorbox}%
}
\setbeamercolor{frametitle}{fg=red,bg=black}
\setbeamercolor{title}{fg=red}
\setbeamertemplate{section in head/foot}{\hfill\bfseries\insertsectionhead}
\setbeamercolor{section in head/foot}{bg=red,fg=black}
\setbeamercolor{author in head/foot}{fg=red,bg=black}
\setbeamercolor{date in head/foot}{fg=red,bg=black}
\setbeamertemplate{section in head/foot shaded}[default][30]
\makeatletter
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}{section in head/foot}
\vskip1pt\insertsectionnavigationhorizontal{\paperwidth}{}{}\vskip1pt
\end{beamercolorbox}%
\ifbeamer@theme@subsection%
\begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\insertsubsectionhead
\end{beamercolorbox}%
\fi%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
\makeatother
\begin{document}
\section{Hello}
\begin{frame}{Hello}
Hello
\end{frame}
\section{Hello}
\begin{frame}{Hello}
Hello
\end{frame}
\end{document}
相关的附加位是
\makeatletter
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}{section in head/foot}
\vskip1pt\insertsectionnavigationhorizontal{\paperwidth}{}{}\vskip1pt
\end{beamercolorbox}%
\ifbeamer@theme@subsection%
\begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\insertsubsectionhead
\end{beamercolorbox}%
\fi%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
\makeatother