1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
%
% EPSDICE.STY by Thomas Heim
%
% LICENSE: LPPL
%
% a small package to include dice faces in .eps format
%
% provides the command \epsdice{#1}
% taking one argument, an integer from 1 to 6
%
% See the file dicetest.tex for further info!
%
% Version 1.1 now works with pdfLaTeX as well
%
% 2001/02/15 -- thomas.heim@unibas.ch
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{epsdice}[2001/02/15 Version 1.1 (TAH)]
\RequirePackage{graphicx}
\RequirePackage{ifthen}
\InputIfFileExists{epsdice.cfg}{}{\def\dicefile{epsdice}}
%
\newcounter{face}
\newcommand*\epsdice[1]{%
\setcounter{face}{\number #1}%
\ifthenelse{\value{face}>6}{\theface\setcounter{face}{0}}{}%
\ifthenelse{\value{face}<0}{\theface\setcounter{face}{0}}{}%
\ifcase\value{face}%
\PackageError{EPSDICE}{%
Argument is not a number, or its value\MessageBreak
lies outside the allowed range for dice}{%
Make sure the argument is either 1, 2, 3, 4, 5, or 6.\MessageBreak
-- Just go on and I'll write whatever you typed;\MessageBreak
the output may not make much sense, though}%
\or
\includegraphics[height=1.75ex,viewport= 3 4 38 39,%
clip=true]{\dicefile}%
\or
\includegraphics[height=1.75ex,viewport= 46 4 81 39,%
clip=true]{\dicefile}%
\or
\includegraphics[height=1.75ex,viewport= 89 4 124 39,%
clip=true]{\dicefile}%
\or
\includegraphics[height=1.75ex,viewport= 132 4 167 39,%
clip=true]{\dicefile}%
\or
\includegraphics[height=1.75ex,viewport= 175 4 210 39,%
clip=true]{\dicefile}%
\or
\includegraphics[height=1.75ex,viewport= 218 4 253 39,%
clip=true]{\dicefile}%
\fi}
%
\endinput
|