Beamer Slide 标题不包括小节

发布于 2025-01-10 21:33:23 字数 334 浏览 0 评论 0原文

我正在使用投影仪制作幻灯片。我设法让小节显示在标题中。例如,安全性的小节是 (1) 背景 (2) PerSpectron (3) 商业 ....

如何在标头中添加 subsubsections ?例如,我希望背景的几个小节出现在标题的额外列中,类似于 subsections。有什么办法可以做到这一点吗?谢谢。

输入图片此处描述

I am using beamer to make my slides. I managed to have the subsections show in the header. For example subsection of Security is (1) Background (2) PerSpectron (3) Commercial ....

How can I add subsubsections in the header too? For example, I want to have several subsections to the background appear in an extra column in the header, similar to subsections. Is there any way to do this? Thank you.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不忘初心 2025-01-17 21:33:23

首先我想引用Beamer用户指南:

“不要使用小节,它们是邪恶的。”

如果你想折磨你的观众,你可以使用这个快速技巧。确保:

  • 节/子节的数量多于子节的数量,否则高度可能错误

  • 您为每个小节中的子小节数量设置计数器


\documentclass{beamer}

\usetheme{Warsaw}

\usepackage{pgffor}

\newcounter{totalsubsub}

\AtBeginSubsubsection[]{\label{subsubsec:\thesection:\thesubsection:\thesubsubsection}}


\makeatletter

\setbeamertemplate{headline}{%
  \leavevmode%
  \@tempdimb=2.4375ex%
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 1.825ex%
    \begin{beamercolorbox}[wd=.33\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.33\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.34\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.33\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[leftskip=3.3ex,wd=.33\paperwidth,ht=\@tempdimb]{section in head/foot}%
    \begin{minipage}[b][\@tempdimb][c]{.9\linewidth}%
      \ifnum\thetotalsubsub>0
          \foreach \i in {1,...,\thetotalsubsub}{% 
                  \ifnum\i=\thesubsubsection
                      \usebeamercolor[fg]{subsubsection in sidebar}
                  \else
                      \usebeamercolor[fg]{subsubsection in sidebar shaded}
                  \fi
                  \hyperlink{subsubsec:\thesection:\thesubsection:\i}{\nameref{subsubsec:\thesection:\thesubsection:\i}}\par
              }
      \fi
        \end{minipage}%
    \end{beamercolorbox}%    
  \fi%
}

\makeatother


\begin{document}

\section{section}
\subsection{sub 1}
\setcounter{totalsubsub}{3}

\subsubsection{subsub 1}
\begin{frame}
    subsub 1
\end{frame} 

\subsubsection{subsub 2}
\begin{frame}
    subsub 2
\end{frame} 

\subsubsection{subsub 3}
\begin{frame}
    subsub 3
\end{frame} 

\subsection{sub 2}
\setcounter{totalsubsub}{0}

\begin{frame}
    abc
\end{frame} 

\subsection{sub 3}
\setcounter{totalsubsub}{2}

\begin{frame}
content...
\end{frame}

\subsubsection{subsub 1}
\begin{frame}
    subsub 1
\end{frame} 

\subsubsection{subsub 2}
\begin{frame}
    subsub 2
\end{frame} 

\end{document}

在此处输入图像描述

First I'd like to quote the beamer users guide:

"Do not use subsubsections, they are evil."

If you want to torture your audience, you can use this quick hack. Make sure that:

  • you have more sections/subsections than subsubsections, otherwise the height might be wrong

  • you set the counter for the number of subsubsection in each subsection


\documentclass{beamer}

\usetheme{Warsaw}

\usepackage{pgffor}

\newcounter{totalsubsub}

\AtBeginSubsubsection[]{\label{subsubsec:\thesection:\thesubsection:\thesubsubsection}}


\makeatletter

\setbeamertemplate{headline}{%
  \leavevmode%
  \@tempdimb=2.4375ex%
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 1.825ex%
    \begin{beamercolorbox}[wd=.33\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.33\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.34\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.33\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[leftskip=3.3ex,wd=.33\paperwidth,ht=\@tempdimb]{section in head/foot}%
    \begin{minipage}[b][\@tempdimb][c]{.9\linewidth}%
      \ifnum\thetotalsubsub>0
          \foreach \i in {1,...,\thetotalsubsub}{% 
                  \ifnum\i=\thesubsubsection
                      \usebeamercolor[fg]{subsubsection in sidebar}
                  \else
                      \usebeamercolor[fg]{subsubsection in sidebar shaded}
                  \fi
                  \hyperlink{subsubsec:\thesection:\thesubsection:\i}{\nameref{subsubsec:\thesection:\thesubsection:\i}}\par
              }
      \fi
        \end{minipage}%
    \end{beamercolorbox}%    
  \fi%
}

\makeatother


\begin{document}

\section{section}
\subsection{sub 1}
\setcounter{totalsubsub}{3}

\subsubsection{subsub 1}
\begin{frame}
    subsub 1
\end{frame} 

\subsubsection{subsub 2}
\begin{frame}
    subsub 2
\end{frame} 

\subsubsection{subsub 3}
\begin{frame}
    subsub 3
\end{frame} 

\subsection{sub 2}
\setcounter{totalsubsub}{0}

\begin{frame}
    abc
\end{frame} 

\subsection{sub 3}
\setcounter{totalsubsub}{2}

\begin{frame}
content...
\end{frame}

\subsubsection{subsub 1}
\begin{frame}
    subsub 1
\end{frame} 

\subsubsection{subsub 2}
\begin{frame}
    subsub 2
\end{frame} 

\end{document}

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文