2

I have this code:

\documentclass{beamer}
\mode<presentation> {
\usetheme{Warsaw}
}
\usepackage{tikz}

\AtBeginSection[] 
{
\begin{frame}
\tableofcontents[currentsection]
\end{frame}
 }
\begin{document}

\begin{frame}
\frametitle{Hello}
\begin{center}
\begin{tikzpicture}
    \foreach \t in {1,...,40}
    {
        \only<\t>{\node [circle,draw] (a) at (22:11) {\t};}
    }
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

I would like to have a blank frame in the first slide then I start counting.

I want exactly this:

\begin{tikzpicture}
    \foreach \t in {1,...,40}
    {
        \only<\t+1>{\node [circle,draw] (a) at (22:11) {\t};}
    }
\end{tikzpicture}

But this is does not work. I think the problem is with \t+1.

Werner
  • 603,163

2 Answers2

4

You could try a conditional: \ifnum\t = 1 \else \only<\t>...\fi

\documentclass{beamer}
\mode<presentation> {
\usetheme{Warsaw}
}
\usepackage{tikz}

\AtBeginSection[] 
{
\begin{frame}
\tableofcontents[currentsection]
\end{frame}
 }
\begin{document}

\begin{frame}
\frametitle{Hello}
\begin{center}
\begin{tikzpicture}
    \foreach \t in {0,1,...,40}
    {
      \ifnum\t = 1
      \else
      \only<\t>{\node [circle,draw] (a) at (22:11) {\t};}
      \fi
    }
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}
  • Thanks. With this I will have on slide 2 number 2, on slide 3 number 3 etc. I want to have on slide 2 number 1, on slide 3 number 2 etc. – 1-approximation Nov 27 '15 at 19:28
3

There are probably a whole host of packages that could help here. However, the following is sufficient to evaluate the expression:

\number\numexpr\t+1\relax

Here's the "complete" context:

\begin{tikzpicture}
  \foreach \t in {1,...,40}
  {%
    \only<\number\numexpr\t+1\relax>{\node [circle,draw] (a) at (22:11) {\t};}%
  }%
\end{tikzpicture}

Note the occasional (sometimes necessary, not in your example though) use of % at line ends. For more on this, see What is the use of percent signs (%) at the end of lines?

Werner
  • 603,163