Beamer - 如何为每个小节添加特定的进度点

Beamer - 如何为每个小节添加特定的进度点

是否可以添加进展点具体到小节?

更具体地说,我想在相应的小节下添加点。

在此处输入图片描述

这里可以找到我用来制作上述内容的代码。

\documentclass{beamer}
\usetheme{Szeged}

\setbeamertemplate{headline}{%
\leavevmode%
\begin{beamercolorbox}[wd=0.9\paperwidth,ht=2.5ex,dp=1.125ex, center] {palette quaternary}%
\insertsectionnavigationhorizontal {\paperwidth}{\hskip0pt plus1fill}{\hskip0pt plus1fill}
 \end{beamercolorbox} \\
\begin{beamercolorbox}[wd=0.9\paperwidth,ht=2.5ex,dp=1.125ex]{}%
\insertsubsectionnavigationhorizontal {\paperwidth}{\hskip0pt plus1fill}{\hskip0pt plus1fill}\\
\end{beamercolorbox}\\ 
  \vspace*{-0.025cm}
  \begin{beamercolorbox}[colsep=1pt]{lower separation line head}
  \end{beamercolorbox}}


\begin{document}
\section{Section 1}

\subsection{subsec. 1.1}
\begin{frame} \frametitle{Slide 1}\end{frame}
\begin{frame} \frametitle{Slide 2}\end{frame}

\subsection{subsect. 1.2}
\begin{frame} \frametitle{Slide 3}\end{frame}
\begin{frame} \frametitle{Slide 4} \end{frame}


\section{ Section 2}

\subsection{ subsection 2.1}
\begin{frame} \frametitle{Slide 5}\end{frame}
\begin{frame} \frametitle{Slide 6}\end{frame}

\subsection{ subsection 2.2}
\begin{frame} \frametitle{Slide 7}\end{frame}

\end{document}

答案1

我可能已经想出了一个解决方案:它相当不优雅,但我已经尝试了一些我发现的代码这里尝试让它们按照我想要的方式工作

\documentclass{beamer}
\usetheme{Szeged}




\makeatletter

\newcount\beamer@xoff
\newcount\beamer@prev@section
\newcount\beamer@prev@miniframes
\beamer@xoff=0
\beamer@prev@section=0
\beamer@prev@miniframes=0

\def\insertsubsectionnavigationhorizontalminiframes#1#2#3{%
  \hbox to #1{{%
    \usebeamerfont{subsection in head/foot}\usebeamercolor[fg]    {subsection in head/foot}%
    \beamer@currentsubsection=0%
    \def\sectionentry##1##2##3##4##5{}%
    \def\slideentry##1##2##3##4##5##6{%
      \ifnum##1>\beamer@prev@section%
        \beamer@xoff=##3\relax%
        \beamer@prev@miniframes=0\relax%
      \fi
      \ifnum##6=\c@part\ifnum##1=\c@section%
      \ifnum##2>\beamer@currentsubsection%
      \beamer@xoff=0\relax%
      \beamer@currentsubsection=##2%
      \box\beamer@sectionbox\hskip1.875ex plus1fill%
      \ifnum\beamer@prev@miniframes>0\relax%
        \beamer@tempdim=\beamer@boxsize%
        \multiply\beamer@tempdim by \beamer@prev@miniframes%
        \advance\beamer@tempdim by -\beamer@boxsize%
        \advance\beamer@tempdim by 2pt%
        \ifnum##2>1%
          \advance\beamer@tempdim by 1.875ex%
        \else
          \advance\beamer@tempdim by -\beamer@boxsize%
        \fi
      \else
        \beamer@tempdim=0pt%
      \fi
      \setbox\beamer@sectionbox=
      \hbox{\def\insertsubsectionhead{\kern\beamer@tempdim##5}%
         \def\insertsectionheadnumber{##1}%
         \def\insertsubsectionheadnumber{##2}%
         \def\insertpartheadnumber{##6}%
         \ifnum\c@subsection=##2%
        \beamer@link(##4){{\usebeamertemplate{subsection in head/foot}}}\else%
        \beamer@link(##4){{\usebeamertemplate{subsection in head/foot shaded}}}\fi}%
      \ht\beamer@sectionbox=1.875ex%
      \dp\beamer@sectionbox=0.75ex%
      \else%
      \beamer@prev@miniframes=##3%
      \fi%
              \setbox0=\hbox{\insertsectionhead\unskip}\ifdim\wd0>0pt\ifnum##3>0%
      \beamer@xpos=##3\relax%
  \advance\beamer@xpos by -\beamer@xoff%
  \hbox to 0pt{%
    \beamer@tempdim=0.5pt%
    \raise\beamer@tempdim\hbox{%
      \ifnum##2>0%
        \beamer@tempdim=\beamer@boxsize%
        \multiply\beamer@tempdim by\beamer@xpos%
        \advance\beamer@tempdim by -\beamer@boxsize%
        \advance\beamer@tempdim by 2pt%
        \advance\beamer@tempdim by \wd\beamer@sectionbox%
      \else%
        \beamer@tempdim=\beamer@boxsize%
        \multiply\beamer@tempdim by\beamer@xpos%
        \advance\beamer@tempdim by 1.875ex%
      \fi%
      \kern\beamer@tempdim\hbox{\beamer@link(##4){%
          \usebeamerfont{mini frame}%
          \ifnum\c@section=##1%
            \ifnum\c@subsection=##2%
              \usebeamercolor[fg]{mini frame}%
              \ifnum\c@subsectionslide=##3%
                \usebeamertemplate{mini frame}%
              \else%
                \usebeamertemplate{mini frame in current subsection}%
              \fi%
            \else%
              \usebeamercolor{mini frame}%
              \usebeamertemplate{mini frame in other subsection}%
            \fi%
          \else%
            \usebeamercolor{mini frame}%
            \usebeamertemplate{mini frame in other subsection}%
          \fi%
        }}}\hskip-10cm plus 1fil%
      }\fi\fi%
  \else%
  \fakeslideentry{##1}{##2}{##3}{##4}{##5}{##6}%
  \fi\fi%
  \beamer@prev@section=##1%
  \ignorespaces}%
#2\hskip.3cm\setbox\beamer@sectionbox=\hbox{}%
\hskip-1.875ex plus-1fill\dohead%
\box\beamer@sectionbox\hfil\hskip.3cm%
#3}}}

\setbeamercolor{mini frame}{parent=subsection in head/foot}



\makeatother

\setbeamertemplate{headline}{%
\leavevmode%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette quaternary}%
 \insertsectionnavigationhorizontal{\paperwidth}{}{}
  \end{beamercolorbox}\\

   \begin{beamercolorbox}[wd=\paperwidth,ht=1.5ex,dp=1.125ex]{}%
\insertsubsectionnavigationhorizontalminiframes{0.9\paperwidth}{}{}
\end{beamercolorbox}%
  \\ 

  \vspace*{-0.025cm}
  \begin{beamercolorbox}[colsep=1pt,color=CLE]{lower separation line head}
  \end{beamercolorbox}
}

\begin{document}
\section{Section 1}

\subsection{subsec. 1.1}
\begin{frame} \frametitle{Slide 1}\end{frame}
\begin{frame} \frametitle{Slide 2}\end{frame}

\subsection{subsect. 1.2}
\begin{frame} \frametitle{Slide 3}\end{frame}
\begin{frame} \frametitle{Slide 4} \end{frame}

\section{ Section 2}

\subsection{ subsection 2.1}
\begin{frame} \frametitle{Slide 5}\end{frame}
\begin{frame} \frametitle{Slide 6}\end{frame}

\subsection{ subsection 2.2}
\begin{frame} \frametitle{Slide 7}\end{frame}

\end{document}

这是一种反复试验的解决方案,而不是合乎逻辑的解决方案。就这样吧!

相关内容