【问题标题】:latex beamer: prevent showing the TOC at one occasion乳胶投影仪:防止一次显示 TOC
【发布时间】:2011-02-17 05:42:26
【问题描述】:

我通常使用

\AtBeginSection[]
{
  \begin{frame}<beamer>{Gliederung}
    \tableofcontents[currentsection]
  \end{frame}
}

在我的序言中,为了在新部分开始之前实现这一点,TOC 会突出显示现在开始的部分。

在我实际上正在准备的演讲中,我有一个特殊的部分我不希望出现这种行为。从之前的部分过渡应该是“无声的”。所有其他部分都应该像现在一样开始。

我相信这一定是可能的。

【问题讨论】:

    标签: latex beamer


    【解决方案1】:

    在beamer手册中,命令\AtBeginSection解释如下:

    \AtBeginSection[special star text]{text}
    

    如果使用星号命令\section* 声明特殊节,则不会出现节目录。这是第一个想到的解决方案,但可能会改变该部分在文档中的表示方式。

    另一种方法(实验性的,我从未测试过)是使用布尔参数。如果设置了布尔参数,则不打印代码。然后你正常声明你的部分,但你在你的代码周围设置布尔值。

    这是一个可以解决问题的代码示例:

    \RequirePackage{ifthen} % package required
    
    \newboolean{sectiontoc}
    \setboolean{sectiontoc}{true} % default to true
    
    \AtBeginSection[]
    {
      \ifthenelse{\boolean{sectiontoc}}{
        \begin{frame}<beamer>{Gliederung}
          \tableofcontents[currentsection]
        \end{frame}
      }
    }
    
    \newcommand{\toclesssection}[1]{
      \setboolean{sectiontoc}{false}
      \section{#1}
      \setboolean{sectiontoc}{true}
    }
    

    然后在文档中,将您的特殊部分声明为\toclesssection{My section without the toc}

    【讨论】:

    • \section* 从目录中删除整个部分,这是我不想要的。第二部分使用布尔变量,效果很好!谢谢!
    【解决方案2】:

    另一种做法是临时更改\AtBeginSection的内容:

    \documentclass{beamer}
    
    
    \AtBeginSection[]
    {
      \begin{frame}<beamer>{Gliederung}
        \tableofcontents[currentsection]
      \end{frame}
    }
    
    
    \begin{document}
    
    \section{section with toc}  
    \begin{frame}
        abc
    \end{frame} 
    
    \begingroup
        \AtBeginSection[]{}
        \section{section without toc}   
        \begin{frame}
            abc
        \end{frame} 
    \endgroup
    
    \section{section with toc}  
    \begin{frame}
        abc
    \end{frame} 
    
    \end{document}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-02
      • 1970-01-01
      相关资源
      最近更新 更多