2

I want to use resume in my beamer presentation, so I declared using the package enumitem, but I had an error:

! Undefined control sequence. .../enumerate \beameritemnestingprefix

I don't know where the problem is!

\documentclass[11pt]{beamer}
\usetheme{Madrid}
\usepackage{enumitem}
\begin{document}

 \begin{frame}
   \begin{enumerate}
     \item one
     \item two
   \end{enumerate}
  \end{frame}

  \begin{frame}
   \begin{enumerate}[resume*]
     \item three
   \end{enumerate}
 \end{frame}

\end{document}

if I don't use enumitem I receive this when compiling

resume* three

5
  • i didn't understand this solution .
    – Hind Dev
    Commented Mar 13, 2016 at 18:00
  • 1
    @HindDev: enumitem is not compatible with beamer. So, if you want to "resume" a list that was started before, you'll have to manually set that up...
    – Werner
    Commented Mar 13, 2016 at 18:40
  • 1
    I think tex.stackexchange.com/a/55001/38080 is much more easy to use
    – Rmano
    Commented Mar 13, 2016 at 18:42
  • @Werner , thank you , but manually didn't give me the same bullet
    – Hind Dev
    Commented Mar 13, 2016 at 18:58
  • I tried this before it inserts a duplicate frame I didn't like it
    – Hind Dev
    Commented Mar 13, 2016 at 19:03

1 Answer 1

4

enumitem is incompatible with beamer. You can either save the counter and re-use it later in the document, or use a \label-\ref approach for saving and restoring:

\documentclass{beamer}

\usetheme{Madrid}
\usepackage{refcount}

\begin{document}

\begin{frame}
  \begin{enumerate}
    \item one
    \item two
    \label{end-enumerate}% Save counter at end of enumerate
  \end{enumerate}
\end{frame}

\begin{frame}
  \begin{enumerate}
    \setcounterref{enumi}{end-enumerate}
    \item three
  \end{enumerate}
\end{frame}

\end{document}

The above requires you to use a separate for each enumerate list you want to "resume". If you're using this sequentially, then you can automate it to some extent:

\documentclass{beamer}

\usetheme{Madrid}
\usepackage{refcount}

\newcounter{saveenumi}
\newcommand{\saveenumerate}{%
  \stepcounter{saveenumi}%
  \label{saveenumi-\thesaveenumi}}
\newcommand{\restoreenumerate}{%
  \setcounterref{enumi}{saveenumi-\thesaveenumi}}

\begin{document}

\begin{frame}
  \begin{enumerate}
    \item one
    \item two
    \saveenumerate
  \end{enumerate}
\end{frame}

\begin{frame}
  \begin{enumerate}
    \restoreenumerate
    \item three
  \end{enumerate}
\end{frame}

\end{document}

beamer also provides it's own frame-specific overlay specification. In your minimal example, you can use:

\documentclass{beamer}

\usetheme{Madrid}

\begin{document}

\begin{frame}
  \begin{enumerate}
    \item<-2> one
    \item<2> two
    \item<3> three
  \end{enumerate}
\end{frame}

\end{document}
1
  • thank you very much, it works, I didn't knew that in Latex we can use like a variable memories for saving a thing
    – Hind Dev
    Commented Mar 13, 2016 at 19:11

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