如何从 beamer 中的导航窗格中删除某些部分?

如何从 beamer 中的导航窗格中删除某些部分?

这是另一个问题的后续问题问题

我不希望某些部分(\section{OUTLINE}\section{ACKNOWLEDGEMENTS}\section{BIBLIOGRAPHY})显示在顶部导航窗格中。

\documentclass[aspectratio=169]{beamer}
\usetheme[compress]{Singapore}
\usepackage{graphicx}
\graphicspath{ {figures/} }
\usefonttheme{serif}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\setbeamertemplate{caption}[numbered]
\setbeamersize{text margin left=14mm,text margin right=14mm} 
\setbeamertemplate{navigation symbols}{}

\title{ON GENERAL RELATIVITY}

\author{John Doe\inst{1}}

\institute[Eidgenössische Technische Hochschule Zürich (ETH)]{
  \inst{1}%
  {PhD Candidate at the Department of Physics\\
  Eidgenössische Technische Hochschule Zürich (ETH)}}

\date{\today}

\newcommand{\nologo}{\setbeamertemplate{logo}{}}

\logo{%
    \makebox[\paperwidth]{%
    \includegraphics[height=1cm]{example-image}%
    \hfill%
    \includegraphics[height=1cm]{example-image}%
    }\hskip-.1cm%
}

\show\hss

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\section{OUTLINE}

\begin{frame}{OUTLINE}

\tableofcontents

\end{frame}

\section{INTRODUCTION}

\begin{frame}{INTRODUCTION}

INSERT INTRODUCTION.

\end{frame}

\section{THEORY}

\begin{frame}{THEORY}

INSERT THEORY.

\end{frame}

\section{METHOD(S)}

\begin{frame}{METHOD(S)}

INSERT METHOD(S).

\end{frame}

\section{RESULTS}

\begin{frame}{RESULTS}

INSERT RESULTS.

\end{frame}

\section{DISCUSSION}

\begin{frame}{DISCUSSION}

INSERT DISCUSSION.

\end{frame}

\section{CONCLUSIONS}

\begin{frame}{CONCLUSIONS}

INSERT CONCLUSIONS.

\end{frame}

\section{BIBLIOGRAPHY}

\nologo{
\begin{frame}{BIBLIOGRAPHY}

INSERT BIBLIOGRAPHY

\end{frame}

\section{ACKNOWLEDGEMENTS}

\begin{frame}{ACKNOWLEDGEMENTS}

\centering
\includegraphics[height=2cm,keepaspectratio]{example-image}%
\hspace{30pt}
\includegraphics[height=2cm,keepaspectratio]{example-image}%
\hspace{30pt}
\includegraphics[height=2cm,keepaspectratio]{example-image}%

\end{frame}
}

\end{document}
  • 有没有办法隐藏某些部分,使它们根本不出现在导航窗格中?如果我不使用\section{BIBLIOGRAPHY}\section{ACKNOWLEDGEMENTS}它们就不会出现,但导航点会列在前一个下section。我只找到了隐藏所有部分的方法(例如\setbeamertemplate{headline}{}),而不是特定的部分。
  • 是否可以确保所有导航窗格名称的长度都相似,而不管字长如何?如果它们具有相同的指定长度,看起来会更好。

编辑(2021年12月21日):

回答了另一种方法,即使用\appendix,以便\section{BIBLIOGRAPHY}\section{ACKNOWLEDGEMENTS}出现在新的导航窗格中。然而,这并不是我想要的,因为它们仍然会出现。如果您评论这些部分,仍然会出现两个导航点。\section{OUTLINE}很容易包含,因为您可以评论它,但它不会出现,因为它在其他部分的前面(而不是后面)。这仍然不是我想要的。

答案1

\documentclass[aspectratio=169]{beamer}
\usetheme[compress]{Singapore}
%\usepackage{graphicx}
\graphicspath{ {figures/} }
\usefonttheme{serif}
\usepackage{caption}
\usepackage{subcaption}
%\usepackage{graphicx}
\setbeamertemplate{caption}[numbered]
\setbeamersize{text margin left=14mm,text margin right=14mm} 
\setbeamertemplate{navigation symbols}{}

\title{ON GENERAL RELATIVITY}

\author{John Doe\inst{1}}

\institute[Eidgenössische Technische Hochschule Zürich (ETH)]{
  \inst{1}%
  {PhD Candidate at the Department of Physics\\
  Eidgenössische Technische Hochschule Zürich (ETH)}}

\date{\today}

\newcommand{\nologo}{\setbeamertemplate{logo}{}}

\logo{%
    \makebox[\paperwidth]{%
    \includegraphics[height=1cm]{example-image}%
    \hfill%
    \includegraphics[height=1cm]{example-image}%
    }\hskip-.1cm%
}

\show\hss

\makeatletter
\let\beamer@writeslidentry@miniframeson=\beamer@writeslidentry%
\def\beamer@writeslidentry@miniframesoff{%
  \expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{}% does not happen normally
  {%else
    % removed \addtocontents commands
    \clearpage\beamer@notesactions%
  }
}
\newcommand*{\miniframeson}{\let\beamer@writeslidentry=\beamer@writeslidentry@miniframeson}
\newcommand*{\miniframesoff}{\let\beamer@writeslidentry=\beamer@writeslidentry@miniframesoff}
\makeatother


\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%\section*{OUTLINE}

\begin{frame}{OUTLINE}

\tableofcontents

\end{frame}

\section{INTRODUCTION}

\begin{frame}{INTRODUCTION}

INSERT INTRODUCTION.

\end{frame}

\section{THEORY}

\begin{frame}{THEORY}

INSERT THEORY.

\end{frame}

\section{METHOD(S)}

\begin{frame}{METHOD(S)}

INSERT METHOD(S).

\end{frame}

\section{RESULTS}

\begin{frame}{RESULTS}

INSERT RESULTS.

\end{frame}

\section{DISCUSSION}

\begin{frame}{DISCUSSION}

INSERT DISCUSSION.

\end{frame}

\section{CONCLUSIONS}

\begin{frame}{CONCLUSIONS}

INSERT CONCLUSIONS.

\end{frame}

%\section{BIBLIOGRAPHY}
\miniframesoff

\nologo
\begin{frame}{BIBLIOGRAPHY}

INSERT BIBLIOGRAPHY

\end{frame}

%\section{ACKNOWLEDGEMENTS}

\begin{frame}{ACKNOWLEDGEMENTS}

\centering{
\includegraphics[height=2cm,keepaspectratio]{example-image}%
\hspace{30pt}
\includegraphics[height=2cm,keepaspectratio]{example-image}%
\hspace{30pt}
\includegraphics[height=2cm,keepaspectratio]{example-image}%
}
\end{frame}


\end{document}

相关内容