3

I'm using the beamer presentation package and trying to combine the examples from this post How to iterate over a comma separated list? with the beamer package.

In modifying the top example, chaning

\documentclass{beamer}
\usepackage{xparse}

\ExplSyntaxOn

\NewDocumentCommand{\makeenumerate}{ m }
 {
  \begin{frame}
  \clist_map_inline:nn { #1 } { \frame \fbox{##1} }
  \end{frame}
 }

\ExplSyntaxOff

\begin{document}

\makeenumerate{a, b ,c, d, ,e }

\end{document}

I want to have a b c d and e all in separate beamer frames. I'm not sure how to get this to work, and which method of iterating over a comma separated list is best to use i've tried them all and none work.

pyCthon
  • 289
  • 2
  • 10

1 Answers1

7

One issue you currently have is trying to create a \frame inside another frame. Moreover, \frame takes an argument, which you're not supplying in a proper way.

Here is the etoolbox implementation that inserts each item in the list on a separate frame:

enter image description here

\documentclass{beamer}
\usepackage{etoolbox}

\makeatletter
\newcommand\makeenumerate[1]{%
  \forcsvlist{\makeenumerate@item}{#1}
}
\newcommand\makeenumerate@item[1]{%
  \begin{frame}
    \fbox{\Huge #1}
  \end{frame}}
\makeatother

\begin{document}

\makeenumerate{a, b ,c, d, ,e }

\end{document}
Werner
  • 603,163