summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/epsdice/epsdice.sty
blob: 0540f7b408bebfbfdbbb0d9b128146be26f4f741 (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
%%
%% This is file `epsdice.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% epsdice.dtx  (with options: `package')
%% 
%% This is a generated file; it is part of the `epsdice' package.
%% 
%% Copyright (c) 2007  Thomas A. Heim
%% 
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License (LPPL) distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%% 
%%   This file is distributed in the hope that it will be useful,
%%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%%   Bug reports ON UNMODIFIED VERSIONS of this package, or
%%   suggestions for improvement and additional features
%%   should be directed to the author (thomas.heim@unibas.ch)
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{epsdice}[2007/02/15 by Thomas Heim (v. 2.1)]
\RequirePackage{graphicx}
\RequirePackage{ifthen}
\InputIfFileExists{epsdice.cfg}{}{\def\dicefile{dice}}
\newcounter{eps@face}
\newcommand*\epsdice[2][white]{%
\setcounter{eps@face}{\number #2}%
\ifthenelse{\value{eps@face}>6}{\theeps@face\setcounter{eps@face}{0}}{}%
\ifthenelse{\value{eps@face}<0}{\theeps@face\setcounter{eps@face}{0}}{}%
\ifthenelse {\equal{#1}{black}} {\addtocounter{eps@face}{6}} {}%
\eps@dice{\value{eps@face}}}
\newcommand*\eps@dice[1]{%
\setcounter{eps@face}{\number #1}%
\ifcase\value{eps@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}%
\or
  \includegraphics[height=1.75ex,viewport= 3 47 38 82,%
  clip=true]{\dicefile}%
\or
  \includegraphics[height=1.75ex,viewport= 46 47 81 82,%
  clip=true]{\dicefile}%
\or
  \includegraphics[height=1.75ex,viewport= 89 47 124 82,%
  clip=true]{\dicefile}%
\or
  \includegraphics[height=1.75ex,viewport= 132 47 167 82,%
  clip=true]{\dicefile}%
\or
  \includegraphics[height=1.75ex,viewport= 175 47 210 82,%
  clip=true]{\dicefile}%
\or
  \includegraphics[height=1.75ex,viewport= 218 47 253 82,%
  clip=true]{\dicefile}%
\fi}
\endinput
%%
%% End of file `epsdice.sty'.