5

I want to be able to repeat a numbered item from an earlier slide under the same number. I know I can do the following, if the item I want to repeat is from the immediately preceding slide:

\documentclass[pdf]{beamer}
   \usepackage[utf8]{inputenc}
   \usepackage{tipa}
   \usecolortheme{beaver}
   \setbeamercovered{highly dynamic}
   \mode<presentation>{}
       \newcounter{saveenumi}
       \newcommand{\seti}{\setcounter{saveenumi}{\value{enumi}}}
       \newcommand{\conti}{\setcounter{enumi}{\value{saveenumi}}}

       \resetcounteronoverlays{saveenumi}
       \AtBeginSection[]
      {
       \begin{frame}<beamer>
       \frametitle{}
       \tableofcontents[currentsection]
       \end{frame}
      }
 \begin{document}
 \begin{frame}
     \begin{enumerate}
     \item First.
     \seti
     \end{enumerate}   
\end{frame}
\begin{frame}
    \begin{enumerate}
    \conti
    \item Second.
    \end{enumerate}    
\end{frame}
\begin{frame}
    \begin{enumerate}
    \conti
    \item Second again.
    \seti
    \end{enumerate} 
\end{frame} \end{document}

But I want to be able to repeat an arbitrary item from an arbitrary slide. I also know I could do this:

 \documentclass[pdf]{beamer}
   \usepackage[utf8]{inputenc}
   \usepackage{tipa}
   \usecolortheme{beaver}
   \setbeamercovered{highly dynamic}
   \mode<presentation>{}

      \begin{document}
         \begin{frame}
            \begin{enumerate}
            \item First.\label{1}
            \end{enumerate}
         \end{frame}
        \begin{frame}
            \begin{itemize}
            \item[\ref{1}] First again.
            \end{itemize}
        \end{frame}
      \end{document}

But that is clunky and often ugly, as \item[\ref{1}] doesn't automatically preserve the style and alignment of the numbering labels from previous slides.

2 Answers 2

4

You could use the refcount package to have an expandable reference number that you can play with. This allows you to use the tricks of your first code in the last one.

\documentclass[pdf]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{tipa}
\usepackage{refcount}
\usecolortheme{beaver}
\setbeamercovered{highly dynamic}
\mode<presentation>{}

\begin{document}
   \begin{frame}
      \begin{enumerate}
      \item First.\label{1}
      \item Second.\label{2}
      \item Third.\label{3}
      \end{enumerate}
   \end{frame}
  \begin{frame}
      \begin{enumerate}\setcounter{enumi}{\the\numexpr\getrefnumber{1}-1}
      \item First again.\setcounter{enumi}{\the\numexpr\getrefnumber{3}-1}
      \item Third again.
      \end{enumerate}
  \end{frame}
\end{document}

enter image description here

Obviously you can cast this into a macro.

\documentclass[pdf]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{tipa}
\usepackage{refcount}
\usecolortheme{beaver}
\setbeamercovered{highly dynamic}
\mode<presentation>{}
\newcommand{\repeateditem}[1]{%
\setcounter{enumi}{\the\numexpr\getrefnumber{#1}-1}%
\item}
\begin{document}
   \begin{frame}
      \begin{enumerate}
      \item First.\label{1}
      \item Second.\label{2}
      \item Third.\label{3}
      \end{enumerate}
   \end{frame}
  \begin{frame}
      \begin{enumerate}
      \repeateditem{1} First again.
      \repeateditem{3} Third again.
      \end{enumerate}
  \end{frame}
\end{document}
0

Maybe I didn't get it right, but why another list in another frame?

mwe

\documentclass{beamer}
\geometry{paperheight=1.5in,paperwidth=2in}
\begin{document}
   \begin{frame}
      \begin{enumerate}
      \item \only<1>{First}\only<2>{First again}\label{1}
      \item<1> Second\label{2}
      \item \only<1>{Third}\only<2>{Third again}\label{3}
      \end{enumerate}
   \end{frame}
\end{document}

For non contiguous slides and without the space for the lost item:

\documentclass{beamer}
\geometry{paperheight=1.5in,paperwidth=2in}
\begin{document}
   \begin{frame}<1>[label=xxx]
      \begin{enumerate}
      \item \only<1>{First}\only<2>{First again}\label{1}
      \only<1>{\item Second\label{2}}\only<2>{\stepcounter{enumi}}
      \item \only<1>{Third}\only<2>{Third again}\label{3}
      \end{enumerate}
   \end{frame}

\begin{frame}
    Another frame
\end{frame}

\againframe<2>{xxx} 

\end{document}
3
  • This could work if I wanted to have the item repeated on the slide that immediately follows the one initially introducing it, but not if I wanted to repeat the item several slides after it initially appears (same problem as with my first solution in the OP). Also, I'd like to avoid the item gap on the subsequent slide.
    – bozidarka
    Commented Oct 13, 2019 at 22:53
  • 1
    @bozidarka See the second example added to the answer. What now?
    – Fran
    Commented Oct 13, 2019 at 23:12
  • Yes, that works for the example, although I'd like to track a single item, rather than have to repeat the whole frame.
    – bozidarka
    Commented Oct 14, 2019 at 12:31

You must log in to answer this question.

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