自定义 Beamer 中的侧边栏

自定义 Beamer 中的侧边栏

我正在使用Marburg带有 的主题beamer,我想自定义其侧边栏,以便演示文稿的标题和作者不会显示,并且我希望侧边栏中的部分被编号。

期望输出:

之前和之后

例子:

\documentclass{beamer}
\usetheme{Marburg}


\title{Some title}
\author{author}
\institute{my workplace}
\date{\today}

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}


\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section[Outline]{}
\frame{\tableofcontents}

\section{Introdution}

\begin{frame}
\frametitle{Basics}
\begin{itemize}
\item A
\pause
\item B
\pause
\item C
\end{itemize}
\end{frame}

\subsection{More basics}

\begin{frame}
\frametitle{something goes here}
more stuff
\end{frame}

\section{My work}

\begin{frame}
my stuff...
\end{frame}

\end{document}

谢谢!

答案1

以下代码包含必要的重新定义:

\documentclass{beamer}
\usetheme{Marburg}

\makeatletter
  \setbeamertemplate{sidebar \beamer@sidebarside}
  {
    \beamer@tempdim=\beamer@sidebarwidth%
    \advance\beamer@tempdim by -6pt%
    \vskip4em%
    \insertverticalnavigation{\beamer@sidebarwidth}%
    \vfill
    \ifx\beamer@sidebarside\beamer@lefttext%
    \else%
      \usebeamercolor{normal text}%
      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
      \vskip2pt%
    \fi%
  }%

  \ifx\beamer@sidebarside\beamer@lefttext%
    \defbeamertemplate*{sidebar right}{sidebar theme}
    {%
      \vfill%
      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
      \vskip2pt}
  \fi

\setbeamertemplate{section in sidebar}%{sidebar theme}
{%
  \vbox{%
    \vskip1ex%
    \beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionheadnumber
~\insertsectionhead}%
  }%
}
\setbeamertemplate{section in sidebar shaded}%{sidebar theme}
{%
  \vbox{%
    \vskip1ex%
    \beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionheadnumber
~\insertsectionhead}%
  }%
}
\makeatother

\title{Some title}
\author{author}
\institute{my workplace}
\date{\today}

\AtBeginSection[]
{
  \begin{frame}
    \frametitle{Table of Contents}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section[Outline]{First Section}
\frame{\tableofcontents}

\section{Introduction}

\begin{frame}
\frametitle{Basics}
\begin{itemize}
\item A
\pause
\item B
\pause
\item C
\end{itemize}
\end{frame}

\subsection{More basics}

\begin{frame}
\frametitle{something goes here}
more stuff
\end{frame}

\section{My work}

\begin{frame}
my stuff...
\end{frame}

\end{document}

第一张幻灯片的图片:

在此处输入图片描述

答案2

总结一下:

(i)使用\title[]{Some title}\author[]{author}欺骗 LaTeX 认为简称/作者是空字符串,如所表示的[]

(ii) 使用 Gonzalo Medina 的优秀解决方案打印出编号项目。

相关内容