4

I'm working on a series of presentations and uses LaTeX slides for each part. I would like to continue numbering the slides for each part according to the previous part; for example, part 1 slides numbers from 1 to 50, part 2 slides from 51 to 100, and so on. Each part has a separate .tex file.

Is there any command to accomplish this?

For example, I want this file to start numbering from 50, not from 1:

\documentclass{beamer}      

\usetheme{Boadilla}  

\setbeamertemplate{footline{\hfill\insertframenumber/\inserttotalframenumber}       

\begin{document}

\begin{frame}
   text
\end{frame}

\begin{frame}
   text
\end{frame}

\begin{frame}
   text
\end{frame}

\end{document}
2
  • Are you using slides (as a documentclass) or beamer? Can you show a minimal working example of what you have and where you are stuck? Are you working on completely different documents?
    – Johannes_B
    Mar 25, 2018 at 12:30
  • Sorry, I added a sample
    – John
    Mar 25, 2018 at 12:37

1 Answer 1

5
\documentclass{beamer}      

\usetheme{Boadilla}  

\setbeamertemplate{footline}{\hfill\insertframenumber/\inserttotalframenumber}       

\addtocounter{framenumber}{50}

\begin{document}

\begin{frame}
   text
\end{frame}

  \begin{frame}
text

\end{frame}

\begin{frame}
text

\end{frame}

\end{document}

or if you want an automatic solution, give a custom label to the last frame in part 1, e.g.

\begin{frame}[label=lastframe]
text
\end{frame}

Assuming your first part is called part1.tex then you can do the following in your document to automatically resume the frame numbers:

\documentclass{beamer}      

\usetheme{Boadilla}  

\setbeamertemplate{footline}{\hfill\insertframenumber/\inserttotalframenumber}       

\usepackage{zref-xr}
\zxrsetup{toltxlabel}
\zexternaldocument*[main-]{part1}

\usepackage{refcount}

\setcounterref{framenumber}{main-lastframe}

\begin{document}

\begin{frame}
   text
\end{frame}

\begin{frame}
   text
\end{frame}

  \begin{frame}
text

\end{frame}

\begin{frame}
text

\end{frame}

\end{document}
1
  • Alternatively: \setcounter{framenumber}{50}
    – Marijn
    Mar 25, 2018 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .