目录以任意数字开头

目录以任意数字开头

Beamer Presentation在大学里教概率课。第一堂课我介绍了第一章,包括第 1 到第 4 节,所以演示文稿中的目录编号从 1 到 4。第二堂课我继续介绍第 5 到第 8 节,它们仍然是第一章。现在我希望目录从第 5 开始到第 8 结束。可以这样做吗?

答案1

请注意,您也可以将讲座代码保存在单个文件中,并使用beamer\includeonlylecture选择地包含讲座。这会自动保持章节编号正确:

\documentclass{beamer}
\usepackage{beamerthemeshadow}
\includeonlylecture{lecturetwo}
\begin{document}

\part{Chapter First}
\lecture{Lecture One}{lectureone}
\section{Section First}
\begin{frame}{Chapter First}{Section First}
    In the first section\dots
\end{frame}
\section{Section Second}
\begin{frame}{Chapter First}{Section Second}
    In the second section\dots
\end{frame}
\section{Section Third}
\begin{frame}{Chapter First}{Section Third}
    In the third section\dots
\end{frame}
\section{Section Fourth}
\begin{frame}{Chapter First}{Section Fourth}
    In the fourth section\dots
\end{frame}
\lecture{Lecture Two}{lecturetwo}
\section{Section Fifth}
\begin{frame}{Chapter First}{Section Fifth}
    In the fifth section\dots
\end{frame}
\section{Section Sixth}
\begin{frame}{Chapter First}{Section Sixth}
    In the sixth section\dots
\end{frame}
\section{Section Seventh}
\begin{frame}{Chapter First}{Section Seventh}
    In the seventh section\dots
\end{frame}
\section{Section Eighth}
\begin{frame}{Chapter First}{Section Eighth}
    In the eighth section\dots
\end{frame}

\end{document}

生成:

仅限第二堂讲座

注释掉以下\includeonlylecture行:

两场讲座

编辑:忘记目录:

目录

\documentclass{beamer}
\usepackage{beamerthemeshadow}
\includeonlylecture{lecturetwo}
\begin{document}

\part{Chapter First}
\begin{frame}
\tableofcontents
\end{frame}
\lecture{Lecture One}{lectureone}
\section{Section First}
\begin{frame}{Chapter First}{Section First}
    In the first section\dots
\end{frame}
\section{Section Second}
\begin{frame}{Chapter First}{Section Second}
    In the second section\dots
\end{frame}
\section{Section Third}
\begin{frame}{Chapter First}{Section Third}
    In the third section\dots
\end{frame}
\section{Section Fourth}
\begin{frame}{Chapter First}{Section Fourth}
    In the fourth section\dots
\end{frame}
\lecture{Lecture Two}{lecturetwo}
\section{Section Fifth}
\begin{frame}{Chapter First}{Section Fifth}
    In the fifth section\dots
\end{frame}
\section{Section Sixth}
\begin{frame}{Chapter First}{Section Sixth}
    In the sixth section\dots
\end{frame}
\section{Section Seventh}
\begin{frame}{Chapter First}{Section Seventh}
    In the seventh section\dots
\end{frame}
\section{Section Eighth}
\begin{frame}{Chapter First}{Section Eighth}
    In the eighth section\dots
\end{frame}

\end{document}

但是,这不会调整编号。我猜这取决于你是想按照当天的业务顺序还是按照章节/课程的业务顺序进行编号……

答案2

在第二个演示中设置适当的值就足够了\beamer@tocsectionnumber,例如使用

\beamer@tocsectionnumber=4

因此第一节的编号将为 5,并将节编号设置为相同的值。完整示例:

\documentclass{beamer}
\usepackage{beamerthemeshadow}

\makeatletter
\beamer@tocsectionnumber=4
\setcounter{section}{4}
\makeatother

\begin{document}

\begin{frame}
\tableofcontents
\end{frame}

\section{Test section five}
\begin{frame} test\end{frame}
\section{Test section five}
\begin{frame} test\end{frame}
\section{Test section five}
\begin{frame} test\end{frame}
\section{Test section five}
\begin{frame} test\end{frame}

\end{document}

在此处输入图片描述

相关内容