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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
%
% EPSDICE.TEX
%
% some notes on the package EPSDICE by Thomas Heim
%
% LICENSE: LPPL
%
% 2001/02/11 -- thomas.heim@unibas.ch
%
\documentclass[11pt]{article}
\usepackage{epsdice}
%\pagestyle{empty}
%
\title{Package `epsdice' --- a scalable dice font}
\author{2001/02/11 -- Version 1.0 \\[.5ex] Thomas Heim \\[.5ex]
(thomas.heim@unibas.ch)}
\date{}
\begin{document}
\maketitle
\section{Introduction}
Dice fonts are already available in \textsc{metafont} format.
\begin{quote}
\verb+\begin{ShamelessPlug}+ \\[.5ex]
I should know, I wrote one myself: \verb+dice3d.mf+ \\[.5ex]
\verb+\end{ShamelessPlug}+
\end{quote}
For some applications it seems preferable, however, to have the fonts
in scalable form. The package \verb+epsdice+ fills this gap.
\texttt{epsdice.sty} provides a single command,
\verb+\epsdice{#1}+. It takes one argument, an integer from 1 to 6.
The value of a counter is allowed as an argument, too, so automatic
representation of (generated or input) data is possible as well.
Depending on the value of the argument, \verb+\epsdice+ includes the
appropriately clipped region from the encapsulated PostScript file
\verb+epsdice.eps+ that contains simple drawings of dice faces.
The drawings scale with the current font because the height of
the included graphics file is set in terms of `ex' units.
%
\section{Requirements and limitations}
\verb+epsdice+ relies on the \verb+graphicx+ package with package
option \verb+[dvips]+ to include the encapsulated PostScript file.
It also uses the \verb+ithen+ package to validate the arguments
(error checking).
Although the PostScript file is rather small,
including it too many times may not be desirable.
%
\section{Configuring this package}
To install the package,
simply move the following files somewhere in your ``local texmf tree'':
\verb+epsdice.{sty, eps, cfg}+, as well as \verb+diceface.eps+.
I suggest a new subdirectory
\verb+/$LOCALTEXMF/tex/latex/epsdice/*+, where \verb+$LOCALTEXMF+ stands
for your ``local texmf tree'' (what a surprise). Refresh your
\TeX-system's file name database, and that's it, you're all set!
The remainder of this section applies only if you want to change
the default settings.
The command \verb+\epsdice+ works by including an encapsulated postscript
file, so this file must be found by \LaTeXe.
The package comes with a configuration file \verb+epsdice.cfg+ containing
the file name in the variable \verb+\dicefile+. By default, this variable
points to the file \verb+epsdice.eps+ (without file name extension).
If you don't like my drawings and would like to ``roll your own''
(PostScript code, not dice), a look at the file \verb+diceface.eps+
may help. It contains the same PostScript code as \verb+epsdice.eps+,
with some comments about what's going on.
If you intend to keep the \verb+.eps+ file with the dice drawings in a
different place or if you want to use your own version
you have to edit the configuration file \verb+epsdice.cfg+ accordingly,
by adding the path to the file name, or by changing the file name in the
variable \verb+\dicefile+.
If a configuration file does not exist, the file \verb+epsdice.eps+
is assumed to be located in the present working directory.
%
\section{Examples}
This text shows dice faces in an 11pt environment:
\epsdice{1} \epsdice{2} \epsdice{3} \epsdice{4} \epsdice{5} \epsdice{6}.
The pictures fit into the surrounding text.
{\Large
Here is some large text. The dice pictures scale accordingly:%
\footnote{\ldots as they do in footnotes, \epsdice{\value{footnote}},
like this.} \epsdice{3}. See?} The package works with standard counters,
too: Here's the result of \verb+\epsdice{\value{page}}+
\epsdice{\value{page}}.
%
\section{Errors}
Of course it doesn't make sense to ask for dice faces with arguments
other than 1, 2, 3, 4, 5, or 6. The package generates error
messages and simply prints the offending argument in the \TeX\ output.
Uncomment the final lines in this documentation to see this feature
in action.
% This generates `benign' errors: \epsdice{99} and \epsdice{-3}.
% The following is more serious, generating two different errors:
% \epsdice{epsfoo}. Nevertheless, output continues with a fall-back
% solution.
%
\end{document}
|