减少小框架与框架标题之间的空间

减少小框架与框架标题之间的空间

我使用的是现代(大都会)主题和迷你框架外主题。我正确地获得了迷你框架;但是,我希望迷你框架和框架标题之间的空间更小(更近一点),即迷你框架和框架标题的点更近。因此,我可以为幻灯片留出更多空间。

我的代码:

\documentclass[10pt,aspectratio=169, compress]{beamer}
\usetheme[progressbar=frame title, numbering=fraction, titleformat title= 
smallcaps]{metropolis}      % Use metropolis theme
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]
\useoutertheme[subsection=false]{miniframes}
\setbeamercolor{section in head/foot}{fg=white, bg=mDarkTeal}
\setbeamerfont{section in head/foot}{series=\bfseries}


\begin{document}
\section{Section I}
\subsection*{Section I}
\begin{frame}{Introduction}
\end{frame}


\section{Section II}
\subsection*{Section II}
\begin{frame}{Frame 2}
Something 
\end{frame}
\end{document}

enter image description here

答案1

位于frametitle内,这种框的高度和深度可以通过和beamercolorbox控制。例如,可以将和(只是猜测,根据您的需要进行调整)添加到 frametitle 的定义中:ht=...dp=...ht=2.25exdp=1.1ex

\documentclass[10pt,aspectratio=169, compress]{beamer}
\usetheme[progressbar=frame title, numbering=fraction, titleformat title= 
smallcaps]{metropolis}      % Use metropolis theme
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]
\useoutertheme[subsection=false]{miniframes}
\setbeamercolor{section in head/foot}{fg=white, bg=mDarkTeal}
\setbeamerfont{section in head/foot}{series=\bfseries}

\makeatletter
\setbeamertemplate{frametitle}{%
  \nointerlineskip%
  \begin{beamercolorbox}[%
      wd=\paperwidth,%
      sep=0pt,%
      leftskip=\metropolis@frametitle@padding,%
      rightskip=\metropolis@frametitle@padding,%
      ht=2.25ex,%%%%%% NEW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      dp=1.1ex, %%%%%% NEW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    ]{frametitle}%
  \metropolis@frametitlestrut@start%
  \insertframetitle%
  \nolinebreak%
  \metropolis@frametitlestrut@end%
  \end{beamercolorbox}%
}
\makeatother

\begin{document}
\section{Section I}
\subsection{Section I}
\begin{frame}{Introduction}
\end{frame}


\section{Section II}
\subsection*{Section II}
\begin{frame}{Frame 2}
Something 
\end{frame}
\end{document}

enter image description here

相关内容