Document ClassesExclude last Frame from Page Counting

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Exclude last Frame from Page Counting

Post by marie2011 »

Dear forum members,

I was wondering how to make the following. I am preparing a presentation. After saying thank you I should put the title page again. So I wrote \thispagestyle{empty} so than there is not page on the slide. I do not want the last slide to be part of the pagination. That means I would like to have 1/3 and not 1/4, as it appears now. Do you know if this is possible?

Here is my minimal working example:

Code: Select all

\documentclass[10pt]{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{pdfpages}
\usepackage{tabularx}
\usepackage{tabu}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{amsfonts}

\usepackage{color}
\newcommand*{\bluebullet}{{\usebeamercolor[fg]{item}{\textbullet \ }}}

\usefonttheme[stillsansserifsmall]{serif}
\usefonttheme{structuresmallcapsserif}
\usetheme{Pittsburgh}
\usecolortheme{seahorse}

\setbeamertemplate{footline}[frame number]
\beamertemplatenavigationsymbolsempty

\addto{\captionsspanish}{%
  \renewcommand*{\tablename}{Tabla}
}

\thispagestyle{empty}
\title{Title page}
\author{}
\date{}

\makeatletter
\setbeamertemplate{title page}
{
  \vbox{}
  \vfill
  \begin{centering}
      \vskip0.25em%
      {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}         
      \vskip2.25em%
    \begin{beamercolorbox}[sep=8pt,center]{title}
      \usebeamerfont{title}\inserttitle\par%
      \ifx\insertsubtitle\@empty%
      \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
      \fi%     
    \end{beamercolorbox}%
    \vskip0.5em\par
    \begin{beamercolorbox}[sep=8pt,center]{author}
      \usebeamerfont{author}\insertauthor
    \end{beamercolorbox}\vskip-0.5em\par
    \begin{beamercolorbox}[sep=8pt,center]{date}
      \usebeamerfont{date}\insertdate
    \end{beamercolorbox}\vskip0.5em% Cambiar aquí
  \end{centering}
  \vfill
}
\makeatother

\begin{document}
\selectlanguage{spanish}
\begin{frame}
  \titlepage
\end{frame}

\setcounter{framenumber}{0}

\begin{frame}
1
\end{frame}

\begin{frame}
2
\end{frame}
\begin{frame}
3
\end{frame}
\thispagestyle{empty}
\begin{frame}
  \titlepage
\end{frame}

\end{document}
Many thanks in advance.

Regards,

Marie

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Exclude last Frame from Page Counting

Post by Stefan Kottwitz »

Hi Marie,

you could simply write

Code: Select all

\addtocounter{framenumber}{-1}
before the final frame which doesn't count. If there's no frame number shown and no reference to it, it shouldn't matter that steh frame number isn't stepped up.

Btw. good minimal example, it would just be good if it would be more minimal, i.e. without unrelated packages. I don't want to install tabu, pdfpages and all those packages just for testing the example with the frame numbers problem. It would be shorter and clearer.

Stefan
LaTeX.org admin
Post Reply