1

I would like to stop the page numbering for some slides that are basically the same. Does anyone know how to do it?

I attach a (MWE) example below. As you can see in the first slide I highlight in red the title of column 1, in the second slide (identical to the previous one) I highlight column 2. Latex counts two slides, whereas I would like to count only the first.

\documentclass[10pt,notes=show,beamer]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amssymb}
\usepackage{mathpazo}
\usepackage{hyperref}
\usepackage{multimedia}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{color}


\setcounter{MaxMatrixCols}{10}

%%%%%%%%%%% BEAMER TEMPLATE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>
{
    \usetheme[compress]{Singapore}
    \setbeamercovered{transparent}
}
\setbeamertemplate{footline}[frame number]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% END PREAMBLE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}


\begin{frame}{First slide}

\begin{table}
    \begin{tabular}{ll}
        \textcolor{red}{Column 1} & Column 2  \\
        \hline \hline
        num1    & num2   \\
        \hline
    \end{tabular}
\end{table}

\end{frame}

\begin{frame}{Second slide}

\begin{table}
    \begin{tabular}{ll}
        Column 1 & \textcolor{red}{Column 2}  \\
        \hline \hline
        num1    & num2   \\
        \hline
    \end{tabular}
\end{table}

\end{frame}

\end{document}
2
  • Just to be more clear, now latex counts a total of two pages and displays 1/2 and 2/2, whereas I would like to see 1/1 and 1/1
    – Alessandro
    Sep 4 '18 at 14:58
  • 1
    Off-topic: you don't need \usepackage{hyperref}, \usepackage{graphicx} and \usepackage{color} with beamer. Sep 4 '18 at 15:09
2

The solution is the command \alert:

\documentclass{beamer}
\mode<presentation>
{
    \usetheme[compress]{Singapore}
    \setbeamercovered{transparent}
}
\setbeamertemplate{footline}[frame number]
\begin{document}

\begin{frame}{First slide}

    \begin{table}
        \begin{tabular}{ll}
            \alert<1>{Column 1} & \alert<2>{Column 2}\\
            \hline \hline
            num1    & num2   \\
            \hline
        \end{tabular}
    \end{table}

\end{frame}
\end{document}

enter image description here

2
  • Thanks a lot! It works perfectly! I just have a follow-up question: what if I would like to highlight Column1/Column2 with a color that is not red? Can I still use the command \alert?
    – Alessandro
    Sep 4 '18 at 15:17
  • 1
    The color of \alert can be changed: tex.stackexchange.com/questions/96864/… However, if you want more flexibility, you should probably use \textcolor (see also @Skillmon's answer)
    – bmv
    Sep 4 '18 at 15:21
2

Do you know the commands \only and \visible added by beamer? Those might help you. If you really want to use two frame environments, you could decrease the counter by 1 or use the handy option noframenumbering (the latter might be preferred as it's the way beamer wants you to do it). The following uses both approaches:

\documentclass[10pt,notes=show,beamer]{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{hyperref}
\usepackage{color}


%%%%%%%%%%% BEAMER TEMPLATE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>
{
    \usetheme[compress]{Singapore}
    \setbeamercovered{transparent}
}
\setbeamertemplate{footline}[frame number]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% END PREAMBLE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}


\begin{frame}{First slide}

\begin{table}
    \begin{tabular}{ll}
        \textcolor{red}{Column 1} & Column 2  \\
        \hline \hline
        num1    & num2   \\
        \hline
    \end{tabular}
\end{table}

\end{frame}

%\addtocounter{framenumber}{-1}% possible alternative

\begin{frame}[noframenumbering]{Second slide}

\begin{table}
    \begin{tabular}{ll}
        Column 1 & \textcolor{red}{Column 2}  \\
        \hline \hline
        num1    & num2   \\
        \hline
    \end{tabular}
\end{table}

\end{frame}

\begin{frame}{combined}% >>>
  \begin{table}
    \begin{tabular}{ll}
      \only<1>{\textcolor{red}}{Column 1}
        & \only<2>{\textcolor{red}}{Column 2}\\
      \hline\hline
      num1 & num2 \\
      \hline
    \end{tabular}
  \end{table}
\end{frame}% <<<


\end{document}

As @samcarter pointed out, beamer alters the command \textcolor to also support \textcolor<1>{red}{Column 1} and \textcolor<2>{red}{Column 2}. So instead of \only<1>{\textcolor{red}}{Column 1} one could also use that.

7
  • Maybe a bit easier: \textcolor<2>{red}}{Column 2} Sep 4 '18 at 15:07
  • @samcarter you even hacked \textcolor? I didn't know that, but I think showing the more basic commands like \only gives more opportunities, as one could add almost arbitrary stuff there.
    – Skillmon
    Sep 4 '18 at 15:09
  • I'm innocence! It's beamer who redefined many of the basic commands. Sep 4 '18 at 15:10
  • @samcarter I thought you were part of the team maintaining beamer. Sorry if that was wrong.
    – Skillmon
    Sep 4 '18 at 15:11
  • Instead of \addtocounter{framenumber}{-1} you could also use noframenumbering as option for the second frame. Sep 4 '18 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.