Metropolis 主题中子部分的页脚导航栏

Metropolis 主题中子部分的页脚导航栏

我正在尝试在页脚中创建一个子部分导航栏。实际上,我希望页脚仅显示给定部分的子部分。

以下是我目前拥有的:

\documentclass{beamer}
\usetheme[
sectionpage=progressbar,
progressbar=frametitle]{metropolis}
\usepackage{graphicx}
\definecolor{prettyBlue}{HTML}{2196F3}
\setbeamercolor{progress bar}{fg=prettyBlue, bg=gray}
\title{Proof of $C_4$ photosynthesis without Kranz anatomy in \textit{Bienertia cycloptera} (Chenopodiaceae)}
\subtitle{Methods}

%%% TEST
% see: https://tex.stackexchange.com/questions/364904/adding-section-indicator-to-metropolis-theme
\setbeamertemplate{mini frame}{}
\setbeamertemplate{mini frame in current section}{}
\setbeamertemplate{mini frame in current subsection}{}
\makeatletter
\setbeamertemplate{footline}{%
    \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
    \end{beamercolorbox}
    \begin{beamercolorbox}{section in head/foot}
        \vskip2pt\insertsubsectionnavigation{\paperwidth}\vskip-2pt
    \end{beamercolorbox}%
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
    \end{beamercolorbox}
}
\makeatother

\setbeamercolor{section in head/foot}{fg=normal text.bg, bg=structure.fg}
\setbeamercovered{}
%%% TEST END

\begin{document}
    
\maketitle

\begin{frame}{Aim}
To identify the 'class' of photosynthesis for 
\textit{Bienertia cycloptera}.
\end{frame}

%% See if we can get a flowchart at top to show 'sequence'
\section{Observing the structure through microscopy}

\subsection{Fixing the tissue}
\begin{frame}{Fixing the tissue}
\begin{itemize}[<+->]
    \item[] Before microscopy, tissues must first be preserved.\\~\\
    \item[] Here, \textit{paraformaldehyde} and \textit{glutaraldehyde} is used.
\end{itemize}
\end{frame}

\begin{frame}{Fixing the tissue}
\begin{itemize}[<+->]
    \item[] Before microscopy, tissues must first be preserved.\\~\\
    \item[] Here, \textit{paraformaldehyde} and \textit{glutaraldehyde} is used.
\end{itemize}
\end{frame}

\begin{frame}{Staining the tissue}
Blah blah blah
\end{frame}


\section{In situ immunolocalisation}% need italics

\section{Enzymatic analysis}

\section{Exposure of leaves to $^{14}CO_2$}
\end{document}

在此处输入图片描述 值得注意的是,该小节是存在的,但它正在从页面上消失。

但我想要的是更接近于 - 在此处输入图片描述

其中当前小节突出显示,其他小节略微透明。

我该如何设置导航框以使其“按预期”工作?

答案1

两个问题:

  • 您需要\insertsubsectionnavigationhorizontal\insertsubsectionnavigation否则子部分将堆叠在一起并消失在页面边框下方

  • 要设置子部分名称的颜色,\setbeamercolor{subsection in head/foot}除了设置颜色框的颜色之外,您还需要\setbeamercolor{section in head/foot}设置颜色框的颜色。


\documentclass{beamer}
\usetheme[
sectionpage=progressbar,
progressbar=frametitle]{moloch}% modern fork of the metropolis theme

\setbeamertemplate{mini frame}{}
\setbeamertemplate{mini frame in current section}{}
\setbeamertemplate{mini frame in current subsection}{}
\setbeamercolor{section in head/foot}{fg=normal text.bg, bg=structure.fg}
\setbeamercolor{subsection in head/foot}{fg=normal text.bg, bg=structure.fg}

\makeatletter
\setbeamertemplate{footline}{%
    \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
    \end{beamercolorbox}
    \begin{beamercolorbox}{section in head/foot}
      \insertsubsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}\vskip3pt%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
    \end{beamercolorbox}
}
\makeatother


\begin{document}

\section{sec}
\begin{frame}a\end{frame}

\subsection{sub1}
\begin{frame}a\end{frame}

\subsection{sub2}
\begin{frame}a\end{frame}

\subsection{sub3}
\begin{frame}a\end{frame}

\end{document}

在此处输入图片描述

相关内容