我希望导航栏中每个小节都只有一个点,而不是每个框架都只有一个点。
我想要将页码显示在顶部(标题右侧第二个蓝色条纹内)。
非常感谢您的帮助。这是我的小例子。(这里的结果应该有 3 个点,页码应该在第 2 部分下的蓝色栏内)
\documentclass[12pt,a4paper,compress]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usetheme{Berlin}
\author{John Gerick}
\title{My Stuff}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\tableofcontents[hideallsubsections]
\end{frame}
\section{Section 1}
\begin{frame}
\tableofcontents[sections={1}]
\end{frame}
\subsection{Subsection 1.1}
\begin{frame}
first frame of 1.1
\end{frame}
\begin{frame}
second frame of 1.1
\end{frame}
\subsection{Subsection 1.2}
\begin{frame}
first frame of 1.2
\end{frame}
\begin{frame}
second frame of 1.2
\end{frame}
\begin{frame}
third frame of 1.2
\end{frame}
\section{Section 2}
\begin{frame}
\tableofcontents[sections={2}]
\end{frame}
\subsection{Subsection 2.1}
\begin{frame}
first frame of 2.1
\end{frame}
\begin{frame}
second frame of 2.1
\end{frame}
\end{document}
答案1
对于问题的第二部分,您可以将标题重新定义为以下内容以包含框架编号:
\documentclass[12pt,a4paper,compress]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
%\usepackage{graphicx}
\usetheme{Berlin}
\makeatletter
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\insertnavigation{\paperwidth}\vskip2pt
\end{beamercolorbox}%
\ifbeamer@theme@subsection%
\begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\insertframenumber\quad\insertsubsectionhead
\end{beamercolorbox}%
\fi%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
\makeatother
\author{John Gerick}
\title{My Stuff}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\tableofcontents[hideallsubsections]
\end{frame}
\section{Section 1}
\begin{frame}
\tableofcontents[sections={1}]
\end{frame}
\subsection{Subsection 1.1}
\begin{frame}
first frame of 1.1
\end{frame}
\begin{frame}
second frame of 1.1
\end{frame}
\subsection{Subsection 1.2}
\begin{frame}
first frame of 1.2
\end{frame}
\begin{frame}
second frame of 1.2
\end{frame}
\begin{frame}
third frame of 1.2
\end{frame}
\section{Section 2}
\begin{frame}
\tableofcontents[sections={2}]
\end{frame}
\subsection{Subsection 2.1}
\begin{frame}
first frame of 2.1
\end{frame}
\begin{frame}
second frame of 2.1
\end{frame}
\end{document}
答案2
我找到了一个非常接近我在这里锁定的解决方案 这一页。修复后即可生效包冲突。现在改变\defbeamertemplate*{当前小节中的迷你框架}{柏林}如下所示,我完全实现了我想要的效果。现在我为每个子部分都添加了一个项目符号,无论使用哪种 pdf 查看器,只要单击项目符号,即可转到该子部分的第一帧。
为了完全控制导航点,您现在需要为要添加的每个项目符号开始一个带有框架的子部分。
固定代码:
\documentclass[12pt,a4paper,compress]{beamer}
\PassOptionsToPackage{subsection=false}{useoutertheme{miniframes}}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usetheme{Berlin}
\makeatletter
\setbeamertemplate{headline}{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}{section in head/foot}
\vskip2pt\insertnavigation{\paperwidth}\vskip2pt
\end{beamercolorbox}%
\ifbeamer@theme@subsection%
\begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}
\end{beamercolorbox}
\begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\insertsubsectionhead \hspace*{\fill} \insertframenumber / \inserttotalframenumber
\end{beamercolorbox}%
\fi%
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
\end{beamercolorbox}
}
\let\beamer@writeslidentry@miniframeson=\beamer@writeslidentry
\def\beamer@writeslidentry@miniframesoff{%
\expandafter\beamer@ifempty\expandafter{\beamer@framestartpage}{}% does not happen normally
{%else
% removed \addtocontents commands
\clearpage\beamer@notesactions%
}
}
\newcommand*{\miniframeson}{\let\beamer@writeslidentry=\beamer@writeslidentry@miniframeson}
\newcommand*{\miniframesoff}{\let\beamer@writeslidentry=\beamer@writeslidentry@miniframesoff}
\makeatother
\defbeamertemplate*{mini frame in current subsection}{Berlin}
{%
\begin{pgfpicture}{0pt}{0pt}{0.1cm}{0.1cm}
\pgfpathcircle{\pgfpoint{0.05cm}{0.05cm}}{0.05cm}
\pgfusepath{fill,stroke}
\end{pgfpicture}%
}
\author{John Gerick} \title{My Stuff}
\begin{document}
\miniframesoff
\begin{frame} \titlepage\end{frame}
\begin{frame} \tableofcontents[hideallsubsections] \end{frame}
\section{Section 1} \begin{frame} \tableofcontents[sections={1}] \end{frame}
\subsection{Subsection 1.1}
\miniframeson
\begin{frame} first frame of 1.1 \end{frame}
\miniframesoff
\begin{frame} second frame of 1.1 \end{frame}
\subsection{Subsection 1.2}
\miniframeson
\begin{frame} first frame of 1.2 \end{frame}
\miniframesoff
\begin{frame} second frame of 1.2 \end{frame}
\begin{frame} third frame of 1.2 \end{frame}
\section{Section 2}
\begin{frame} \tableofcontents[sections={2}] \end{frame}
\subsection{Subsection 2.1}
\miniframeson
\begin{frame} first frame of 2.1 \end{frame}
\begin{frame} second frame of 2.1 \end{frame}
\end{document}