From e9a4f1887ce6787440123006b1a85ef9496a17bb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 22 Feb 2007 19:56:52 +0000 Subject: epsdice 2.1 (19feb07) git-svn-id: svn://tug.org/texlive/trunk@3984 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/epsdice/diceface.eps | 79 -------------------- Master/texmf-dist/tex/latex/epsdice/epsdice.cfg | 3 +- Master/texmf-dist/tex/latex/epsdice/epsdice.eps | 11 --- Master/texmf-dist/tex/latex/epsdice/epsdice.sty | 94 ++++++++++++++++-------- 4 files changed, 63 insertions(+), 124 deletions(-) delete mode 100644 Master/texmf-dist/tex/latex/epsdice/diceface.eps delete mode 100644 Master/texmf-dist/tex/latex/epsdice/epsdice.eps (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/epsdice/diceface.eps b/Master/texmf-dist/tex/latex/epsdice/diceface.eps deleted file mode 100644 index ed34082f061..00000000000 --- a/Master/texmf-dist/tex/latex/epsdice/diceface.eps +++ /dev/null @@ -1,79 +0,0 @@ -%!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 index 88570999419..c4f5e366989 100644 --- a/Master/texmf-dist/tex/latex/epsdice/epsdice.cfg +++ b/Master/texmf-dist/tex/latex/epsdice/epsdice.cfg @@ -1,2 +1 @@ -\def\dicefile{epsdice} - +\def\dicefile{dice} diff --git a/Master/texmf-dist/tex/latex/epsdice/epsdice.eps b/Master/texmf-dist/tex/latex/epsdice/epsdice.eps deleted file mode 100644 index 75f75eb2100..00000000000 --- a/Master/texmf-dist/tex/latex/epsdice/epsdice.eps +++ /dev/null @@ -1,11 +0,0 @@ -%!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 index 444264952a7..0540f7b408b 100644 --- a/Master/texmf-dist/tex/latex/epsdice/epsdice.sty +++ b/Master/texmf-dist/tex/latex/epsdice/epsdice.sty @@ -1,31 +1,43 @@ -% -% 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 -% +%% +%% 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}[2001/02/15 Version 1.1 (TAH)] +\ProvidesPackage{epsdice}[2007/02/15 by Thomas Heim (v. 2.1)] \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}% +\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}{% @@ -35,22 +47,40 @@ Make sure the argument is either 1, 2, 3, 4, 5, or 6.\MessageBreak \or \includegraphics[height=1.75ex,viewport= 3 4 38 39,% clip=true]{\dicefile}% -\or +\or \includegraphics[height=1.75ex,viewport= 46 4 81 39,% clip=true]{\dicefile}% -\or +\or \includegraphics[height=1.75ex,viewport= 89 4 124 39,% clip=true]{\dicefile}% -\or +\or \includegraphics[height=1.75ex,viewport= 132 4 167 39,% clip=true]{\dicefile}% -\or +\or \includegraphics[height=1.75ex,viewport= 175 4 210 39,% clip=true]{\dicefile}% -\or +\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'. -- cgit v1.2.3