From 595e9170a6c848f85334940ce295c14ba999bc0d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2006 23:54:57 +0000 Subject: epsdice git-svn-id: svn://tug.org/texlive/trunk@869 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/epsdice/diceface.eps | 79 ++++++++++++++++++++++++ Master/texmf-dist/tex/latex/epsdice/epsdice.cfg | 2 + Master/texmf-dist/tex/latex/epsdice/epsdice.eps | 11 ++++ Master/texmf-dist/tex/latex/epsdice/epsdice.sty | 56 +++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/epsdice/diceface.eps create mode 100644 Master/texmf-dist/tex/latex/epsdice/epsdice.cfg create mode 100644 Master/texmf-dist/tex/latex/epsdice/epsdice.eps create mode 100644 Master/texmf-dist/tex/latex/epsdice/epsdice.sty (limited to 'Master') diff --git a/Master/texmf-dist/tex/latex/epsdice/diceface.eps b/Master/texmf-dist/tex/latex/epsdice/diceface.eps new file mode 100644 index 00000000000..ed34082f061 --- /dev/null +++ b/Master/texmf-dist/tex/latex/epsdice/diceface.eps @@ -0,0 +1,79 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%BoundingBox: 0 0 258 43 +% +% commented version of EPSDICE.EPS by Thomas A. Heim +% +% LICENSE: LPPL +% +% 2001/02/09 -- thomas.heim@unibas.ch +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% face measures 32x32 and fits within a 43x43 bounding box +% +% ==> if you change these dimensions, you will have to adjust +% the bounding box of the clipped region in the .STY file! +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% the frame macro: a simple box with rounded corners +% +% takes one argument off the stack: n (x-offset is 43*(n - 1) ) +% +/frame { + 1 sub 43 mul % calculate 43*(n-1), given n on the stack + /o exch def % store result in o + gsave + newpath + o 0 translate % shift coordinate system by offset o in x + 32 5 moveto % + 32 10 5 -90 0 arc % the frame goes from 5 to 37 units both + 37 32 lineto % in x and y, with rounded corners having + 32 32 5 0 90 arc % radius 5 units, centered 5 units inward + 10 37 lineto % in both directions + 10 32 5 90 180 arc + 5 10 lineto + 10 10 5 180 270 arc + closepath + stroke + grestore +} def +% +% dot positions are designated by (x,y) labels from (1,1) to (3,3) +% +% change position and radius of filled circles as you like +% +% the dot macro: a filled circle +% +% takes three arguments off the stack: +% n (x-offset 43*(n - 1) ) +% x-label: 1, 2, or 3 +% y-label: 1, 2, or 3 +/dot { + /y exch def % store y-label of dot + /x exch def % store x-label of dot + 1 sub 43 mul % calculate 43*(n-1), given n on the stack + /o exch def % store result in offset o + gsave + newpath + o 0 translate % shift coordinate system by offset o in x + x 8 mul 5 add % x-position of dot: 8*x+5 (-> 13,21,29) + y 8 mul 5 add % y-position of dot: 8*y+5 (-> 13,21,29) + 3.5 0 360 arc % I like big dots (radius 3.5 units) + closepath + fill + grestore +} def +% +2 setlinewidth % lines 2 units wide +0 setgray % fill the dots in black +% +% now use the macros to draw the dice faces in loops +% +1 1 6 { frame } for % the six frames +2 1 6 { dup 1 2 3 { dup dot } for } for % (1,1), (3,3) on 2, 3, 4, 5, 6 +1 2 5 { 2 2 dot } for % (2,2) dot on 1, 3, 5 +4 1 6 { dup 1 3 dot 3 1 dot } for % (1,3), (3,1) dots on 4, 5, 6 +1 2 3 { 6 exch 2 dot } for % (1,2), (3,2) dots only on 6 +%%EOF + diff --git a/Master/texmf-dist/tex/latex/epsdice/epsdice.cfg b/Master/texmf-dist/tex/latex/epsdice/epsdice.cfg new file mode 100644 index 00000000000..88570999419 --- /dev/null +++ b/Master/texmf-dist/tex/latex/epsdice/epsdice.cfg @@ -0,0 +1,2 @@ +\def\dicefile{epsdice} + diff --git a/Master/texmf-dist/tex/latex/epsdice/epsdice.eps b/Master/texmf-dist/tex/latex/epsdice/epsdice.eps new file mode 100644 index 00000000000..75f75eb2100 --- /dev/null +++ b/Master/texmf-dist/tex/latex/epsdice/epsdice.eps @@ -0,0 +1,11 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%BoundingBox: 0 0 258 43 +/frame { 1 sub 43 mul /o exch def gsave newpath o 0 translate +32 5 moveto 32 10 5 -90 0 arc 37 32 lineto 32 32 5 0 90 arc +10 37 lineto 10 32 5 90 180 arc 5 10 lineto 10 10 5 180 270 arc +closepath stroke grestore } def /dot { /y exch def /x exch def +1 sub 43 mul /o exch def gsave newpath o 0 translate x 8 mul 5 +add y 8 mul 5 add 3.5 0 360 arc closepath fill grestore } def +2 setlinewidth 0 setgray 1 1 6 { frame } for 2 1 6 { dup 1 2 3 +{ dup dot } for } for 1 2 5 { 2 2 dot } for 4 1 6 { dup 1 3 dot +3 1 dot } for 1 2 3 { 6 exch 2 dot } for diff --git a/Master/texmf-dist/tex/latex/epsdice/epsdice.sty b/Master/texmf-dist/tex/latex/epsdice/epsdice.sty new file mode 100644 index 00000000000..444264952a7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/epsdice/epsdice.sty @@ -0,0 +1,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 + -- cgit v1.2.3