2

I'm trying to make myself a beamer template with modified bullets for enumerate and itemize. I have a pdf image of the bullet point that I would like to use. I already have a working solution for itemize, but using the same approach

\newcommand{\bpebble}[0]{\includegraphics[height=1.3 ex]{./k_bluepebble.pdf}}
\setbeamertemplate{enumerate items}{\bpebble}

the numbering vanishes making the enumerate and itemize environments essentially indistinguishable. I've seen a near-satisfactory solution Use ball items in enumerate list with enumitem package in that it modifies the item in front of each enumerate list entry and superimposes a number on top of it, however this uses pgfplots and not an inserted pdf figure.

So, I'm seeking a way to include a pdf graphic into the list bullets and lay a number on top of it.

4
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Commented Jan 6, 2014 at 9:40
  • 2
    Does \setbeamertemplate{enumerate items}{\bpebble\hspace*{-1ex}\theenumi} work? Commented Jan 6, 2014 at 10:11
  • @UlrikeFischer it does, with a minor beauty spot. The lower edge of the pebble inserted by command \bpebble is on the same level than the base of the number inserted by \theenumi. Hence, the number is not in the middle of the pebble but a bit too low relative to it. Aside from that (and choosing an appropriate value for the parameter of \hspace) everything works and I think your proposed solution is a very good starting point. Danke. Commented Jan 7, 2014 at 13:49
  • Move the number a bit up: \raisebox{1pt}{\theenumi}. Commented Jan 7, 2014 at 14:14

1 Answer 1

4

Here's one possibility allowing you to insert an image as background for the counters in enumerate environments; the code illustrates the simple procedure up to level three of nesting (the maximum nesting level for beamer). The main command is \bpebble with three mandatory arguments:

\bpebble{<optionf for \includegraphics>}{<image file>}{<counter to be used over the image>}

The complete code:

\documentclass{beamer}
\usepackage{tikz}

\newcommand\bpebble[3]{%
  \tikz{
  \node[inner sep=0pt] 
    (image) {\includegraphics[#1]{#2}};%
  \node[inner sep=0pt] 
    at (image.center) {#3};%
  }
}

\setbeamertemplate{enumerate item}{\bpebble{height=2ex}{papiro}{\insertenumlabel}}
\setbeamertemplate{enumerate subitem}{\bpebble{height=1.8ex}{bricks}{\insertsubenumlabel}}
\setbeamertemplate{enumerate subsubitem}{\bpebble{height=1.6ex}{scroll}{\insertsubsubenumlabel}}

\setbeamercolor*{enumerate item}{fg=white} 
\setbeamercolor*{enumerate subitem}{fg=white} 
\setbeamercolor*{enumerate subsubitem}{fg=black} 

\begin{document}

\begin{frame}
\begin{enumerate}
\item First.
\item Second.
  \begin{enumerate}
  \item First.
  \item Second.
    \begin{enumerate}
    \item First.
    \item Second.
    \end{enumerate}
  \item Third.
  \end{enumerate}
\item Third.
\item Fourth.
\end{enumerate}
\end{frame}

\end{document}

The result:

enter image description here

You must log in to answer this question.

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