I am trying to use the package epsdice in a beamer presentation.

This package provides the command \epsdice which takes a numerical argument between 1 and 6 and draws the corresponding face of a die. (It's quite useful for teaching Probability.)

I have noticed the following problem. If I use \setbeamercovered{dynamic}, then any instance of \epsdice inside an overlay appears in all the frames, ignoring the overlay specification.

I'm guessing that this is because all epsdice does is to include a portion of a PDF file containing the corresponding face of the die and there is no way to control its opacity.

Still, if anyone has any ideas on how I could get this to work, I'd be grateful.

  • Weirdly, I was about to ask a question about epsdice from a different perspective: epsdice doesn't work in XeLaTeX exactly because XeLaTeX doesn't seem to support clipping. We need someone like Andrew Stacey or Jake to come along and throw together a superior dice package in five minutes… – Seamus Jan 19 '12 at 17:37

For fun, here's a very quick mock up of a tikz replacement. Still needs tweaking, obviously.

  \draw[very thick, rounded corners] (0,0) rectangle (1,1);
  \node[ellipse,fill=black,minimum height=0.1em] at (0.5,0.5){};

a die

Clearly, I have too much time on my hands. Here's a customisable tikz-y replacement for epsdice:

  dot hidden/.style={},
  line hidden/.style={},
  dot colour/.style={dot hidden/.append style={color=#1}},
  dot colour/.default=black,
  line colour/.style={line hidden/.append style={color=#1}},
  line colour/.default=black


  \draw[thick, rounded corners=0.5,line hidden] (0,0) rectangle (1,1);
    \fill[dot hidden] (0.5,0.5) circle (\dotsize);
  \fill[dot hidden] (0.2,0.2) circle (\dotsize);
  \fill[dot hidden] (0.8,0.8) circle (\dotsize);
    \fill[dot hidden] (0.2,0.8) circle (\dotsize);
    \fill[dot hidden] (0.8,0.2) circle (\dotsize);
      \fill[dot hidden] (0.8,0.5) circle (\dotsize);
      \fill[dot hidden] (0.2,0.5) circle (\dotsize);


\drawdie[line colour=red]{4}

\drawdie[dot colour=blue]{6}

This uses the trick of optional arguments from over here. The mandatory argument is the number and the optional argument takes one of two keys line colour=<colour> and dot colour=<colour> where <colour> is any colour tikz recognises.

enter image description here

| improve this answer | |
  • 1
    I have a presentation to give in 20 minutes, so I'll have to stop messing around now, but with some tweaking, this could be a reasonable replacement. Not as quick to compile as a font, I expect… – Seamus Jan 19 '12 at 17:46
  • 1
    This would make the basis of a useful tikz library, I think. I modified it a bit to use for my purposes but the basic idea was really helpful - thanks! – cfr Jul 26 '14 at 14:48
  • @cfr Yes, one day I might even turn this into a library... – Seamus Jul 27 '14 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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