从上到下的进度条

从上到下的进度条

我正在寻找一个不错的beamer演示。但我不喜欢其中任何一个。它们中的几乎一个都不错,但有一个问题,似乎没有侧边栏进度条的示例。 latex-beamer 的进度条 是否可以在左侧设置文本导航侧栏并在右侧设置进度条(从上到下)?这是我的 MWE。

\documentclass[10pt, compress]{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\title{Report}
\subtitle{}
\date{\today}
\author{V A}
\institute{Lab}
\setbeamertemplate{navigation symbols}{}
\useoutertheme{sidebar}
\setbeamertemplate{footline}[frame number]
\makeatletter
\def\progressbar@progressbar{}  % the progress bar
\newcount\progressbar@tmpcounta % auxiliary counter
\newcount\progressbar@tmpcountb % auxiliary counter
\newdimen\progressbar@pbht      % progressbar height
\newdimen\progressbar@pbwd      % progressbar width
\newdimen\progressbar@tmpdim    % auxiliary dimension
\progressbar@pbwd=20em
\progressbar@pbht=0.5pt
\def\progressbar@progressbar{%
  \progressbar@tmpcounta=\insertframenumber
  \progressbar@tmpcountb=\inserttotalframenumber
  \progressbar@tmpdim=\progressbar@pbwd
  \multiply\progressbar@tmpdim by \progressbar@tmpcounta
  \divide\progressbar@tmpdim by \progressbar@tmpcountb    
  \makebox[\textwidth][c]{
    \begin{tikzpicture}[tight background]    
      \node[anchor=west, white, inner sep=0pt] at (0pt, 0pt) {\insertsectionHEAD};

      \draw[anchor=west, mDarkBrown, fill=mDarkBrown, inner sep=0pt]
      (2pt, -16pt) rectangle ++ (\progressbar@pbwd, \progressbar@pbht);    
      \draw[anchor=west, mMediumBrown, fill=mMediumBrown, inner sep=0pt]
      (2pt, -16pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht);
    \end{tikzpicture}%
  }
}
\begin{document}
    \maketitle
    \section{E1}
    \begin{frame}{F1}
    \end{frame}
    \begin{frame}{F2}
    \end{frame}
\end{document}

答案1

通过快速破解,可以将以下代码组合起来https://tex.stackexchange.com/a/59749/36296带有侧边栏主题:

\documentclass{beamer}

\usetheme{Berkeley}

\usepackage{tikz}
\usetikzlibrary{calc}

\makeatletter
\colorlet{pbblue}{beamer@blendedblue}% filling color for the progress bar
\definecolor{pbgray}{HTML}{575757}% background color for the progress bar


\def\progressbar@progressbar{} % the progress bar
\newcount\progressbar@tmpcounta% auxiliary counter
\newcount\progressbar@tmpcountb% auxiliary counter
\newdimen\progressbar@pbht %progressbar height
\newdimen\progressbar@pbwd %progressbar width
\newdimen\progressbar@tmpdim % auxiliary dimension

\progressbar@pbwd=.82\paperheight
\progressbar@pbht=1.5ex

% the progress bar
\def\progressbar@progressbar{%

    \progressbar@tmpcounta=\insertframenumber
    \progressbar@tmpcountb=\inserttotalframenumber
    \progressbar@tmpdim=\progressbar@pbwd
    \multiply\progressbar@tmpdim by \progressbar@tmpcounta
    \divide\progressbar@tmpdim by \progressbar@tmpcountb

  \begin{tikzpicture}[rounded corners=2pt,very thin]

    \shade[top color=pbgray!40,bottom color=pbgray!40,middle color=pbgray!50]
      (0pt, 0pt) rectangle ++ (\progressbar@pbwd, \progressbar@pbht);

      \shade[draw=structure.fg,top color=structure.fg,bottom color=structure.fg,middle color=structure.fg!75!black] %
        (0pt, 0pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht);
  \end{tikzpicture}%
}

\setbeamertemplate{navigation symbols}{\rotatebox{270}{\progressbar@progressbar}}
\makeatother

\begin{document}

\section{test}

\begin{frame}{title}
test
\end{frame}

\begin{frame}
test
\end{frame}

\begin{frame}
test
\end{frame}

\begin{frame}
test
\end{frame}

\end{document}

在此处输入图片描述

相关内容