[Tex/LaTex] beamer, how to explicitly call the “normal itemize icon”

beameritemizelists

I want to have beamer slides where the change between one slide and the next is that the standard itemize symbol is replaced by a tick or a cross. My first attempt:

\begin{itemize}
\item[\onslide<2->{\tick}] Foo
\item[\onslide<3->{\cross}] Bar
\item[\onslide<4->{\tick}] Foo, again.
\end{itemize}

Unfortunately this doesn't quite work, since the normal item symbol isn't there (that is, there is nothing to the left of each item until the tick or cross appears). So I want to do something like this:

\begin{itemize}
\item[\only<1>{\normalsymbol}\only<2->{\tick}] Foo
\item[\only<1-2>{\normalsymbol}\only<3->{\cross}] Bar
\item[\only<1-3>{\normalsymbol}\only<4->{\tick}] Foo, again.
\end{itemize}

At the moment I've just found the inner theme I'm using and copied the code that defines the itemize symbol and done a \newcommand. But this is not all that satisfactory, since if I want to change innerthemes, I'll have to redefine it. So for my current theme (Dresden) I have:

\newcommand{\normalsymbol}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}

So my question has two parts: is there a command that holds the current inner theme's item symbol? And, is there a better way to achieve what I want? I'm particularly fond of using <+-> when I can, so I can add items without changing all the numbers…

To reiterate, what the above code is supposed to do is have all the items appear on the first slide. Then on each progressive slide, the itemize symbol is replaced by a tick or a cross, depending on whether I like the item or not. The code above does what I want, but it's unsatisfactory because (1) the \normalsymbol macro has to be set by hand and (2) the slide transitions have to be specified explicitly.

Best Answer

For the first, beamer uses templates (itemize item, itemize subitem, itemize subsubitem) to typeset the item symbol. See the section "Itemizations, Enumerations, and Descriptions" (11.1 in my version) in the beamer manual. If you read the source files beamerinnerthemedefault.sty and beamerbaseauxtemplates.sty you can see the syntax for declaring other choices for this template. So to define ticks (by which I understand checkmarks) and cross item icons you can do something like this:

\usepackage{pifont}
\defbeamertemplate{itemize item}{cross}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths\ding{54}}}
\defbeamertemplate{itemize subitem}{cross}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{54}}}
\defbeamertemplate{itemize subsubitem}{cross}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{54}}}

\defbeamertemplate{itemize item}{tick}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths\ding{52}}}
\defbeamertemplate{itemize subitem}{tick}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{52}}}
\defbeamertemplate{itemize subsubitem}{tick}{\tiny\raise1.25pt\hbox{\donotcoloroutermaths\ding{52}}}

Then if you wanted to make those icons the default you would just do:

\setbeamertemplate{itemize item}[cross] % and so on.

But to use your custom icons to highlight the current item you can do this:

\documentclass{beamer}
\useinnertheme{rectangles}% or whatever inner theme you want

% template defs from above

\makeatletter
\newenvironment{crossenv}{%
  \only{%
    \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
    \setbeamertemplate{itemize \beameritemnestingprefix item}[cross]
  }% overlay/action specification gets added here by beamer
}{%
}
\newenvironment{tickenv}{%
  \only{%
    \beamer@computepref\@itemdepth% sets \beameritemnestingprefix
    \setbeamertemplate{itemize \beameritemnestingprefix item}[tick]
  }% overlay/action specification gets added here by beamer
}{%
}
\makeatother  

\begin{document}

\begin{frame}{Single list}
  \begin{itemize}
    \item<1- | tick@+-> foo
    \item<1- | cross@+-> bar
    \item<1- | tick@+-> foo, again
  \end{itemize}
\end{frame}

\begin{frame}{Nested lists}
  \begin{itemize}[<1-| cross@+>]
    \item foo
    \item bar
      \begin{itemize}
        \item bar one 
        \item bar none
          \begin{itemize}
            \item bar who?
            \item bar none
          \end{itemize}
      \end{itemize}
    \item baz
  \end{itemize}
\end{frame}
\end{document}

Because the crossenv enviroment surrounds each selected item, the change in template is local. After the crossenv environment the template returns to whatever it was before. This means you don't need to know what the symbol is by default. So this will work with any inner theme you are using.

Final Edits: I think I finally got what you wanted. You have to only change the template at the current itemize level, which requires a bit of h@ckery. But diving into beamerbaselocalstructure.sty revealed a solution.

Final Final Edits: Now with ticks and crosses both.

sample code output

Related Question