忽略备份幻灯片中的页码

发布于 2024-07-16 10:17:00 字数 173 浏览 4 评论 0原文

我正在使用乳胶中的投影仪文档类来进行演示。 我将有许多备份幻灯片,供离线查看、参考等。Beamer 有一项功能,可以在每张幻灯片上以 {page#}/{total pages} 的形式显示演示文稿的进度。 如果{总页数}等于我的总页数(不包括备份幻灯片),我真的很高兴(我不想阻止第一页上的观众!)。 有谁知道如何做到这一点?

I am using the beamer document class in latex to make a presentation. I will have a number of back up slides which are there for offline viewing, reference etc. Beamer has a feature that shows the progress through the presentation as {page#}/{total pages} on each slide. I would really like it if {total pages} was equivalent to my total number of pages w/out counting the back up slides (I don't want to discourage my audience on the first page!). Does anyone know how this can be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

半世晨晓 2024-07-23 10:17:00

现在可以通过所有“备份”幻灯片上的以下选项来实现:

\begin{frame}[noframenumbering]{My Title}
\end{frame}

来源

这将导致最终数字(例如 25/25)显示在此类页面上。

一如既往,品味问题。

This can now be achieved with the following option on all "backup" slides:

\begin{frame}[noframenumbering]{My Title}
\end{frame}

Source

This will cause the final number (e.g. 25/25) to be displayed on such pages.

As always, a matter of taste.

习惯成性 2024-07-23 10:17:00

这可以通过 appendixnumberbeamer 包来完成。 只需将 \usepackage{appendixnumberbeamer} 添加到序言中,并在第一张备份幻灯片之前使用 \appendix 即可。

This can be done with the appendixnumberbeamer package. Just add \usepackage{appendixnumberbeamer} to the preamble and use \appendix before the first backup slide.

带刺的爱情 2024-07-23 10:17:00

我定义了两个命令来执行此操作:

\newcommand{\beginbackup}{
   \newcounter{framenumbervorappendix}
   \setcounter{framenumbervorappendix}{\value{framenumber}}
}
\newcommand{\backupend}{
   \addtocounter{framenumbervorappendix}{-\value{framenumber}}
   \addtocounter{framenumber}{\value{framenumbervorappendix}} 
}

然后,您可以在备份幻灯片之前和之后使用 \beginbackup\backupend 来调整幻灯片数量。

对于我的投影仪模板,我还喜欢添加

\setbeamertemplate{footline}{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor~~(\insertshortinstitute)
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{} \hspace*{2ex} % hier hat's sich geändert
  \end{beamercolorbox}}%
  \vskip0pt%
}

\beginbackup 命令的定义,以隐藏备份幻灯片中的总页码,否则您会得到类似“24/18”的内容。

使用所有这些,您的幻灯片将在备份之前对所有幻灯片进行“x/Y”编号,其中 Y 是第一张备份幻灯片之前的幻灯片总数,并且备份幻灯片将继续之前幻灯片的编号。

I have defined two commands to do this:

\newcommand{\beginbackup}{
   \newcounter{framenumbervorappendix}
   \setcounter{framenumbervorappendix}{\value{framenumber}}
}
\newcommand{\backupend}{
   \addtocounter{framenumbervorappendix}{-\value{framenumber}}
   \addtocounter{framenumber}{\value{framenumbervorappendix}} 
}

You can then use \beginbackup and \backupend before and after your backup slide to adjust the number of slides.

For my beamer template I also like to add

\setbeamertemplate{footline}{
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor~~(\insertshortinstitute)
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{} \hspace*{2ex} % hier hat's sich geändert
  \end{beamercolorbox}}%
  \vskip0pt%
}

in the definition of the \beginbackup command to hide to total page number in the backup slides, otherwise you'll get something like "24/18".

Using all this, your slides will be numbered like "x/Y" for all slides before the backup, where Y is the total number of slides before the first backup slide, and the backup slides will continue the numbering of the previous slides.

∞觅青森が 2024-07-23 10:17:00

要手动将总帧数固定为某个数字(例如 25),您可以

\renewcommand{\inserttotalframenumber}{25}

在 \begin{document} 命令之后添加以下命令。

您还可以在备份幻灯片开始之前添加 \appendix 命令,以便相应的部分/小节不会出现在目录/导航结构中。

应该可以调整上面的更新命令,以便它自动使用附录之前的最后一个帧号,但我不知道该怎么做。

To manually fix the total frame count to a certain number, say 25, you could add the following command

\renewcommand{\inserttotalframenumber}{25}

right after the \begin{document} command.

You can also add the \appendix command right before the beginning of your backup slides, so that the corresponding sections/subsections do not appear in the table of contents/navigation structure.

It should be possible to tweak the renewcommand above so that it automatically uses the last frame number before the appendix, but I don't know how to do it.

悸初 2024-07-23 10:17:00

只需在 \begin{document} 之后插入

\renewcommand{\inserttotalframenumber}{\pageref{lastslide}}

,并将标记放在

\label{lastslide}

最后一张幻灯片上即可。

Just insert

\renewcommand{\inserttotalframenumber}{\pageref{lastslide}}

after \begin{document}, and place the marker

\label{lastslide}

on your last slide.

℡Ms空城旧梦 2024-07-23 10:17:00

您可以将所有备份幻灯片放在附录中并使用 appendixnumberbeamer 包。

\documentclass[12pt]{beamer}
\usepackage{appendixnumberbeamer}
\begin{document}
\begin{frame}{Frames that counts}
\end{frame}
\appendix
\begin{frame}{Backup slides}
\end{frame}
\end{document}

You can put all of your backup slides in appendix and use the appendixnumberbeamer package.

\documentclass[12pt]{beamer}
\usepackage{appendixnumberbeamer}
\begin{document}
\begin{frame}{Frames that counts}
\end{frame}
\appendix
\begin{frame}{Backup slides}
\end{frame}
\end{document}
苄①跕圉湢 2024-07-23 10:17:00

Fanfan,感谢您的回答,您的回答引导我找到了这个 sty 文件,该文件可以包含在投影仪文档类中,该类将自动仅计算附录之前的帧数,然后重新启动附录幻灯片的单独计数,非常漂亮整洁的。

http://www.ensta.fr/~lelong/Latex/appendixnumberbeamer.sty

还要感谢 Jérôme LELONG 将其在线提供。

Fanfan, thanks for your answer, your answer steered me to this sty file that one can include in a beamer document class that will automatically count only the number of frames before the appendix, and then restart the a separate count for the appendix slides, pretty neat.

http://www.ensta.fr/~lelong/Latex/appendixnumberbeamer.sty

Thanks also to Jérôme LELONG for having this available online.

将军与妓 2024-07-23 10:17:00

伟大的命令 \insertpresentationendpage 将解决您的问题。 只需将 \appendix 放在备份幻灯片的开头即可。

\documentclass[t]{beamer}

\usepackage[absolute,overlay]{textpos}
\setbeamertemplate{navigation symbols}{}

\def\insertpresentationendframe{\inserttotalframenumber}
\makeatletter
\g@addto@macro{\appendix}{\immediate\write\@auxout{\string\@writefile{nav}{\noexpand\headcommand{\noexpand\def\noexpand\insertpresentationendframe{\the\c@framenumber}}}}}
\makeatother

\setbeamertemplate{footline}{%
    \begin{picture}(54,12.5)(0,0)
    \put(0.9,0.52){%
        \begin{minipage}[b][12.5mm][c]{112.5mm}
        \raggedleft
        \insertframenumber/\insertpresentationendframe
        \end{minipage}
    }
    \end{picture}
}

\begin{document}

    \begin{frame}
        slide in the main part
        \only<2>{blub}
    \end{frame}

    \appendix
    \section*{Backup}

    \begin{frame}
        \frametitle{backup}
        not counting in the total frame number
    \end{frame}

\end{document}

在此处输入图像描述

The great command \insertpresentationendpage will take care of your problem. Just place \appendix at the begin of your backup slides.

\documentclass[t]{beamer}

\usepackage[absolute,overlay]{textpos}
\setbeamertemplate{navigation symbols}{}

\def\insertpresentationendframe{\inserttotalframenumber}
\makeatletter
\g@addto@macro{\appendix}{\immediate\write\@auxout{\string\@writefile{nav}{\noexpand\headcommand{\noexpand\def\noexpand\insertpresentationendframe{\the\c@framenumber}}}}}
\makeatother

\setbeamertemplate{footline}{%
    \begin{picture}(54,12.5)(0,0)
    \put(0.9,0.52){%
        \begin{minipage}[b][12.5mm][c]{112.5mm}
        \raggedleft
        \insertframenumber/\insertpresentationendframe
        \end{minipage}
    }
    \end{picture}
}

\begin{document}

    \begin{frame}
        slide in the main part
        \only<2>{blub}
    \end{frame}

    \appendix
    \section*{Backup}

    \begin{frame}
        \frametitle{backup}
        not counting in the total frame number
    \end{frame}

\end{document}

enter image description here

记忆里有你的影子 2024-07-23 10:17:00

另一种可能性 - 最近添加到投影仪 - 是使用 appendixframenumber 模板:

\documentclass[t]{beamer}

\setbeamertemplate{footline}{
  \hfill%
  \usebeamercolor[fg]{page number in head/foot}%
  \usebeamerfont{page number in head/foot}%
  \setbeamertemplate{page number in head/foot}[appendixframenumber]%
  \usebeamertemplate*{page number in head/foot}\kern1em\vskip2pt%
}

\begin{document}

    \begin{frame}
        slide in the main part
        \only<2>{blub}
    \end{frame}

    \appendix
    \section*{Backup}

    \begin{frame}
        \frametitle{backup}
        not counting in the total frame number
    \end{frame}

\end{document}

Another possibility - which was recently added to beamer - is to use the appendixframenumber template:

\documentclass[t]{beamer}

\setbeamertemplate{footline}{
  \hfill%
  \usebeamercolor[fg]{page number in head/foot}%
  \usebeamerfont{page number in head/foot}%
  \setbeamertemplate{page number in head/foot}[appendixframenumber]%
  \usebeamertemplate*{page number in head/foot}\kern1em\vskip2pt%
}

\begin{document}

    \begin{frame}
        slide in the main part
        \only<2>{blub}
    \end{frame}

    \appendix
    \section*{Backup}

    \begin{frame}
        \frametitle{backup}
        not counting in the total frame number
    \end{frame}

\end{document}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文