暂时隐藏投影仪演示文稿侧边栏中的某些部分

暂时隐藏投影仪演示文稿侧边栏中的某些部分

我正在尝试在投影仪演示文稿中创建一个大纲部分。

此大纲部分被包裹在一个outlinesection环境中,其中标题(以及其他内容)被重新定义。在此特定部分中,我希望仅显示标题和与此特定部分相关的微型框架。

这个答案每个部分都提出了这一点,但我想用环境来限制这种行为outlinesection

这个想法是在大纲中不显示演示文稿的组织结构,但保留在大纲中导航的能力。
我最初的想法是让\insertnavigation选项敏感,有点像\tableofcontents选项sections={<>}允许过滤显示的部分,但我现在不知道该怎么做。

\documentclass{beamer}
\usetheme{Frankfurt}

% Start of outline style settings
% -> Conditional display of a summary at the beginning of each section
\usepackage{ifthen}
\newboolean{sectiontoc}
\setboolean{sectiontoc}{true}
\AtBeginSection[]{%
    \ifthenelse{\boolean{sectiontoc}}{%
        \addtocounter{framenumber}{-1}%
        \begin{frame}{Outline}%
            \tableofcontents[currentsection,hideallsubsections,%
                             sectionstyle=show/shaded,firstsection=2,sections={<2->}
                             ]%
        \end{frame}%
    }%
}
% -> outlinesection environment with local redefinintion of the headline
\newenvironment{outlinesection}{%
    \setbeamertemplate{headline}{%
        \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=3.75ex,left]{section in head/foot}%
            % This shows only the first section title
            %\usebeamerfont{section in head/foot}\insertsectionhead
            % This shows all sections + miniframes
            \insertnavigation{\paperwidth}
        \end{beamercolorbox}%
    }%
}{%
    % Summary with all sections to close the outline
    \subsection{}
    \begin{frame}
        \frametitle{Outline}
        \tableofcontents[hideallsubsections,firstsection=2,sections={<2->}]
    \end{frame}
}
% End of outline style settings


\begin{document}

\begin{outlinesection}
\setboolean{sectiontoc}{false}
\section{Outline}
\setboolean{sectiontoc}{true}
\begin{frame}{Outline}
  ......
\end{frame}
\end{outlinesection}

\section{section 1}
\subsection{subsection 11}
\begin{frame}
   ......
\end{frame}
\section{section 2}
\subsection{subsection 21}
\begin{frame}
   ......
\end{frame}
\section{section 3}
\subsection{subsection 31}
\begin{frame}
   ......
\end{frame}
\section{section 4}
\subsection{subsection 41}
\begin{frame}
   ......
\end{frame}

\end{document}

这是显示大纲部分幻灯片时的当前输出 在此处输入图片描述

预期输出如下 在此处输入图片描述

进入演示文稿的主要部分后,标题应如下所示 在此处输入图片描述

答案1

我终于自己找到了解决方案,多次查看了我的问题中喜欢的答案(以及 beamer 手册)。解决方案分为两个步骤:

  1. 其他部分必须从侧边栏隐藏
  2. 其他部分的微型框架必须从侧边栏隐藏

第一步是在环境中以 0% 不透明度section in head/foot shaded局部重置样式,并使用outlinesection

\setbeamertemplate{section in head/foot shaded}[default][0]

这使得侧边栏中的其他部分名称具有与背景相同的颜色。副作用是,链接仍然可以点击,因此如果您了解您的演示文稿,您可以猜出要点击的位置,并且它像往常一样工作。

第二步是通过Beamer 信息线外部主题带有仅适用于当前部分的迷你框架项目符号, 和

\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other subsection of current section}}{}{}
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other section}}{}{}
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection of current section}}{\usebeamertemplate{mini frame in other subsection}}{}{}

总而言之,正确outlinesection风格的 MWE 是

\documentclass{beamer}
\usetheme{Frankfurt}

% Start of outline style settings
% -> Conditional display of a summary at the beginning of each section
\usepackage{ifthen}
\newboolean{sectiontoc}
\setboolean{sectiontoc}{true}
\AtBeginSection[]{%
    \ifthenelse{\boolean{sectiontoc}}{%
        \addtocounter{framenumber}{-1}%
        \begin{frame}{Outline}%
            \tableofcontents[currentsection,hideallsubsections,%
                             sectionstyle=show/shaded,firstsection=2,sections={<2->}
                             ]%
        \end{frame}%
    }%
}
% -> outlinesection environment with local redefinintion of the headline
% Patch of the mini frame in other subsection style as per https://tex.stackexchange.com/a/45152/141947 <---------
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other subsection of current section}}{}{}
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection}}{\usebeamertemplate{mini frame in other section}}{}{}
\patchcmd{\slideentry}{\usebeamertemplate{mini frame in other subsection of current section}}{\usebeamertemplate{mini frame in other subsection}}{}{}

\newenvironment{outlinesection}{%
    % Local transparency of the other sections and mini frames
    \setbeamertemplate{section in head/foot shaded}[default][0]% <---------
    \setbeamertemplate{mini frame in other section}[default][0]% <---------
    \setbeamertemplate{headline}{%
        \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=3.75ex,left]{section in head/foot}%
            % This shows only the first section title
            %\usebeamerfont{section in head/foot}\insertsectionhead
            % This shows all sections + miniframes
            \insertnavigation{\paperwidth}
        \end{beamercolorbox}%
    }%
}{%
    % Summary with all sections to close the outline
    \subsection{}
    \begin{frame}
        \frametitle{Outline}
        \tableofcontents[hideallsubsections,firstsection=2,sections={<2->}]
    \end{frame}
}
% End of outline style settings


\begin{document}

\begin{outlinesection}
\setboolean{sectiontoc}{false}
\section{Outline}
\setboolean{sectiontoc}{true}
\begin{frame}{Outline}
  ......
\end{frame}
\end{outlinesection}

\section{section 1}
\subsection{subsection 11}
\begin{frame}
   ......
\end{frame}
\section{section 2}
\subsection{subsection 21}
\begin{frame}
   ......
\end{frame}
\section{section 3}
\subsection{subsection 31}
\begin{frame}
   ......
\end{frame}
\section{section 4}
\subsection{subsection 41}
\begin{frame}
   ......
\end{frame}

\end{document}

相关内容