我有以下代码,最后一节的进度条没有完成,标题中的进度条太细。我该如何改变这些?
\documentclass[10pt]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{appendixnumberbeamer}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\title{Title}
\subtitle{Subtitle}
\date{\today}
\author{Name}
\institute{Institute}
\begin{document}
\maketitle
\begin{frame}{Contents}
\setbeamertemplate{section in toc}[sections numbered]
\tableofcontents[hideallsubsections]
\end{frame}
\section{Introduction}
\begin{frame}{Introduction}
blablablablablablabla
\end{frame}
\end{document}
第一:这是最后一节,进度条尚未完成。
第二:我们几乎看不到标题中的进度条
答案1
要调整普通框架上进度条的宽度,可以使用
\setlength{\metropolis@progressinheadfoot@linewidth}{3pt}
(同样,可以修改标题页和章节页上的线的宽度)。
最后一节页面上的进度条是不完整的,因为它不是以节为单位显示进度,而是以页码显示进度,页码的值也与普通框架上的进度条显示的值相同。您可以更改定义以显示节号/总节号的分数(但是,如果进度条的含义在普通框架和节页面之间发生变化,可能会让观众感到困惑……):
\documentclass[10pt]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{appendixnumberbeamer}
\usepackage{booktabs}
\usepackage[scale=2]{ccicons}
\title{Title}
\subtitle{Subtitle}
\date{\today}
\author{Name}
\institute{Institute}
\makeatletter
\setlength{\metropolis@progressinheadfoot@linewidth}{3pt}
\setlength{\metropolis@titleseparator@linewidth}{3pt}
\setlength{\metropolis@progressonsectionpage@linewidth}{3pt}
\setbeamertemplate{progress bar in section page}{
\setlength{\metropolis@progressonsectionpage}{%
\textwidth * \ratio{\thesection pt}{\totvalue{totalsection} pt}%
}%
\begin{tikzpicture}
\fill[bg] (0,0) rectangle (\textwidth, \metropolis@progressonsectionpage@linewidth);
\fill[fg] (0,0) rectangle (\metropolis@progressonsectionpage, \metropolis@progressonsectionpage@linewidth);
\end{tikzpicture}%
}
\makeatother
\usepackage{totcount}
\newcounter{totalsection}
\regtotcounter{totalsection}
\AtBeginDocument{%
\pretocmd{\section}{\refstepcounter{totalsection}}{\typeout{Yes, prepending was successful}}{\typeout{No, prepending was not it was successful}}%
}%
\begin{document}
\maketitle
\begin{frame}{Contents}
\setbeamertemplate{section in toc}[sections numbered]
\tableofcontents[hideallsubsections]
\end{frame}
\section{Introduction}
\begin{frame}{Introduction}
blablablablablablabla
\end{frame}
\section{Introduction}
\begin{frame}{Introduction}
blablablablablablabla
\end{frame}
\end{document}