Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In Beamer, I would like to be able to use ball items (with a number inside) in an enumerate list whose layout is defined by the package enumitem.

This question is closely related to Make enumerate have beamer themes when using enumitem. Actually a hint is given but does not work.

Hereafter, my MWE. If you remove \protect\usebeamertemplate{enumerate item}, the MWE works.

\documentclass[12pt]{beamer}
\usepackage{enumitem}
\setbeamertemplate{enumerate item}[ball]
\setenumerate[1]{%
  label=\protect\usebeamerfont{enumerate item}
        \protect\usebeamercolor[fg]{enumerate item}
        \protect\usebeamertemplate{enumerate item}
        \insertenumlabel.}
\begin{document}
\begin{frame}
  \begin{enumerate}
    \item First item
    \item Second item
  \end{enumerate}
\end{frame}
\end{document}

Would you have any suggestions to include properly the item template? Thanks.

share|improve this question
    
Related: Trouble combining enumitem and beamer –  Werner Jun 20 '12 at 18:29

1 Answer 1

up vote 10 down vote accepted

I would suggest not to use enumitem with beamer, since this combination could produce more damages than benefits. Take for example the code given in the answer you linked to in your question:

\documentclass[12pt]{beamer}
\usetheme{Singapore}
\usepackage{enumitem}
\setenumerate[1]{%
  label=\protect\usebeamerfont{enumerate item}%
        \protect\usebeamercolor[fg]{enumerate item}%
        \insertenumlabel.}
\begin{document}
\begin{frame}
  \begin{enumerate}
    \item First item
    \item Second item
  \end{enumerate}
\end{frame}
\end{document}

This code works and apparently everything it's OK, but something this code "hides" is that now enumerate is not overlay-aware and this is a serious drawback; adding the typical overlay specification

\documentclass[12pt]{beamer}
\usetheme{Singapore}
\usepackage{enumitem}
\setenumerate[1]{%
  label=\protect\usebeamerfont{enumerate item}%
        \protect\usebeamercolor[fg]{enumerate item}%
        \insertenumlabel.}
\begin{document}
\begin{frame}
  \begin{enumerate}[<+->]
    \item First item
    \item Second item
  \end{enumerate}
\end{frame}
\end{document}

you get the error message

! Package enumitem Error: <+-> undefined.

See the enumitem package documentation for explanation. Type  H <return>  for immediate help.  ...                                    

l.14 \end{frame}

If you want to customize the list-like environments, you can do it by redefining the corresponding elements as they are defined in beamer. For example, the definitions for the enumerate item template for each one of the predefined options (default, ball, circle, square) can be found in the file beamerbaseauxtemplates.sty. You can then change this definitions according to your needs; a little example, increasing the size of the circle and adding a final dot after the label of the enumeration:

\documentclass[12pt]{beamer}

\makeatletter
\setbeamertemplate{enumerate item}
{
  \begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
    \usebeamercolor[fg]{item projected}
    {\pgftransformscale{2}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
    {\pgftransformshift{\pgfpoint{0pt}{0.5pt}}
      \pgftext{\usebeamerfont*{item projected}\insertenumlabel.}}
  \end{pgfpicture}%
}
\makeatother

\begin{document}

\begin{frame}
\begin{enumerate}
  \item First item
  \item Second item
\end{enumerate}
\end{frame}

\end{document}

enter image description here

share|improve this answer
    
Thanks Gonzalo. I modified my file beamerbaseauxtemplates.sty as you mentioned and the results are as expected. –  RolPasto Jun 21 '12 at 7:48
    
@RolPasto it's not a good idea to modify LaTeX files directly; you can save a copy and edit the copy or do the changes in your document. –  Gonzalo Medina Jun 21 '12 at 12:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.