2 %% This is file `epsdice.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% epsdice.dtx (with options: `package')
9 %% This is a generated file; it is part of the `epsdice' package.
11 %% Copyright (c) 2007 Thomas A. Heim
13 %% This program can be redistributed and/or modified under the terms
14 %% of the LaTeX Project Public License (LPPL) distributed from CTAN
15 %% archives in directory macros/latex/base/lppl.txt; either
16 %% version 1 of the License, or any later version.
18 %% This file is distributed in the hope that it will be useful,
19 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
20 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 %% Bug reports ON UNMODIFIED VERSIONS of this package, or
23 %% suggestions for improvement and additional features
24 %% should be directed to the author (thomas.heim@unibas.ch)
26 \NeedsTeXFormat{LaTeX2e}
27 \ProvidesPackage{epsdice}[2007/02/15 by Thomas Heim (v. 2.1)]
28 \RequirePackage{graphicx}
29 \RequirePackage{ifthen}
30 \InputIfFileExists{epsdice.cfg}{}{\def\dicefile{dice}}
32 \newcommand*\epsdice[2][white]{%
33 \setcounter{eps@face}{\number #2}%
34 \ifthenelse{\value{eps@face}>6}{\theeps@face\setcounter{eps@face}{0}}{}%
35 \ifthenelse{\value{eps@face}<0}{\theeps@face\setcounter{eps@face}{0}}{}%
36 \ifthenelse {\equal{#1}{black}} {\addtocounter{eps@face}{6}} {}%
37 \eps@dice{\value{eps@face}}}
38 \newcommand*\eps@dice[1]{%
39 \setcounter{eps@face}{\number #1}%
40 \ifcase\value{eps@face}%
41 \PackageError{EPSDICE}{%
42 Argument is not a number, or its value\MessageBreak
43 lies outside the allowed range for dice}{%
44 Make sure the argument is either 1, 2, 3, 4, 5, or 6.\MessageBreak
45 -- Just go on and I'll write whatever you typed;\MessageBreak
46 the output may not make much sense, though}%
48 \includegraphics[height=1.75ex,viewport= 3 4 38 39,%
49 clip=true]{\dicefile}%
51 \includegraphics[height=1.75ex,viewport= 46 4 81 39,%
52 clip=true]{\dicefile}%
54 \includegraphics[height=1.75ex,viewport= 89 4 124 39,%
55 clip=true]{\dicefile}%
57 \includegraphics[height=1.75ex,viewport= 132 4 167 39,%
58 clip=true]{\dicefile}%
60 \includegraphics[height=1.75ex,viewport= 175 4 210 39,%
61 clip=true]{\dicefile}%
63 \includegraphics[height=1.75ex,viewport= 218 4 253 39,%
64 clip=true]{\dicefile}%
66 \includegraphics[height=1.75ex,viewport= 3 47 38 82,%
67 clip=true]{\dicefile}%
69 \includegraphics[height=1.75ex,viewport= 46 47 81 82,%
70 clip=true]{\dicefile}%
72 \includegraphics[height=1.75ex,viewport= 89 47 124 82,%
73 clip=true]{\dicefile}%
75 \includegraphics[height=1.75ex,viewport= 132 47 167 82,%
76 clip=true]{\dicefile}%
78 \includegraphics[height=1.75ex,viewport= 175 47 210 82,%
79 clip=true]{\dicefile}%
81 \includegraphics[height=1.75ex,viewport= 218 47 253 82,%
82 clip=true]{\dicefile}%
86 %% End of file `epsdice.sty'.