From 43d20e0b5552eb99d52f1fccf0fe955c4d8e7bf0 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 13 Jan 2006 00:09:08 +0000
Subject: ticket

git-svn-id: svn://tug.org/texlive/trunk@1387 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/ticket/ticket.sty | 186 ++++++++++++++++++++++++++
 1 file changed, 186 insertions(+)
 create mode 100644 Master/texmf-dist/tex/latex/ticket/ticket.sty

(limited to 'Master/texmf-dist/tex/latex/ticket/ticket.sty')

diff --git a/Master/texmf-dist/tex/latex/ticket/ticket.sty b/Master/texmf-dist/tex/latex/ticket/ticket.sty
new file mode 100644
index 00000000000..36bed4738ce
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ticket/ticket.sty
@@ -0,0 +1,186 @@
+%%
+%%
+%% This is file `ticket.sty',
+%%
+%% File: ticket.sty Copyright (c) 1999,2000, Thomas Emmel
+%% <emmel@mechanik.tu-darmstadt.de>
+%%
+%%
+% This package may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.2
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+%   http://www.latex-project.org/lppl.txt
+% and version 1.2 or later is part of all distributions of LaTeX 
+% version 1999/12/01 or later.
+%
+% This package consists of the file ticket.sty 
+%%
+% HISTORY:
+%
+%  v0.1a-0.1d non-official implementations 
+%
+%  v0.2       fixing some minor bugs and add examples
+%
+%  v0.3a      checking for an old calc-package
+%  v0.3b      use internal values if tdf-file is not specified
+%  v0.3c      \ticketreset added.
+
+\def\fileversion{v0.3c}
+\def\filedate{2000/10/10}
+
+\ProvidesPackage{ticket}[\filedate\space\fileversion]
+\typeout{Package: `ticket' \fileversion\space <\filedate> (Thomas Emmel)}
+
+\newif\if@crossmark    \@crossmarkfalse
+\newif\if@circlemark   \@circlemarkfalse
+\newif\if@boxed        \@boxedfalse
+\newif\if@extern       \@externfalse
+
+\DeclareOption{boxed}{\@boxedtrue}
+\DeclareOption{crossmark}{\@crossmarktrue}
+\DeclareOption{circlemark}{\@circlemarktrue}
+
+\DeclareOption*{\edef\ticketToUse{\CurrentOption.tdf}\@externtrue}%
+
+\ProcessOptions
+%
+\RequirePackage{ifthen}
+\RequirePackage{calc}
+% older calc packages have a small bug
+\@ifpackagelater{calc}{1998/07/06}%
+      {% Yes. OK! 
+       }
+      {% No. 
+        \PackageWarning{ticket}
+        {Package calc too old (older than v4.1b).}%
+        }%
+
+\pagestyle{empty}
+
+% standard definitions
+\topmargin=0pt
+\headheight=0pt
+\headsep=0pt
+\oddsidemargin=0pt
+\footskip=0pt
+\voffset=0pt
+\hoffset=0pt
+\unitlength=1mm
+
+%
+\newcounter{ticket@x}
+\newcounter{ticket@y}
+\setcounter{ticket@x}{1}
+\setcounter{ticket@y}{1}
+
+\newcounter{ticket@num@X}% Number of tickets in horizontal direction
+\newcounter{ticket@num@Y}% Number of tickets in vertical direction
+\setcounter{ticket@num@X}{2}% default value
+\setcounter{ticket@num@Y}{3}% default value
+
+\def\ticketNumbers#1#2{\setcounter{ticket@num@X}{#1}%
+                       \setcounter{ticket@num@Y}{#2}}
+
+%
+
+\newdimen\ticketWidth% width of a ticket
+\newdimen\ticketHeight% height of a ticket
+
+\newdimen\ticket@dis@X% horizontal space between tickets
+\newdimen\ticket@dis@Y% vertical space between tickets
+\ticket@dis@X=0mm% default value
+\ticket@dis@Y=0mm% default value
+
+\def\ticketSize#1#2{\gdef\ticket@size@X{#1}\ticketWidth=#1\unitlength%
+                    \gdef\ticket@size@Y{#2}\ticketHeight=#2\unitlength}
+
+\def\ticketDistance#1#2{\ticket@dis@X=#1\unitlength%
+                        \ticket@dis@Y=#2\unitlength}
+
+%% now load ticket definitions from file
+\if@extern
+\InputIfFileExists{\ticketToUse}
+  {\typeout{load \ticketToUse}}
+  {\errmessage{\ticketToUse\space not found! Please use another file}}
+\else
+  \unitlength=1mm
+  \hoffset=0mm
+  \voffset=0mm
+  \ticketNumbers{2}{2}
+  \ticketSize{50}{20} 
+  \ticketDistance{5}{10}
+\fi
+
+%% temporary length
+\newdimen\ticket@shift@x
+\newdimen\ticket@shift@y
+
+\def\ticketreset{\setcounter{ticket@x}{1}\setcounter{ticket@y}{1}%
+ \setlength{\ticket@shift@y}{0pt}%
+ \setlength{\ticket@shift@x}{0pt}}
+
+% the heart: a "counter"
+\newcommand{\ticket@counter}{%
+  \ifthenelse{\value{ticket@y}<\value{ticket@num@Y}}%
+    {\stepcounter{ticket@y}\\[-\baselineskip]}%
+    {\setcounter{ticket@y}{1}%
+      \ifthenelse{\value{ticket@x}<\value{ticket@num@X}}%
+        {\stepcounter{ticket@x}\\[-\baselineskip]}%
+        {\setcounter{ticket@x}{1}\setcounter{ticket@y}{1}\newpage}}%
+      \setlength{\ticket@shift@y}{(\ticketHeight+\ticket@dis@Y)*(\theticket@y-1)}%
+      \setlength{\ticket@shift@x}{(\ticketWidth+\ticket@dis@X)*(\theticket@x-1)}%
+      }%
+
+% default content...
+% users should renew this command
+\newcommand{\ticketdefault}{%
+%
+\put( 5, 5){Ticket....}
+} 
+
+% the main command: \ticket 
+% users should define a command like \myticket to get more than one parameter
+\newcommand{\ticket}[1]{%
+% position global
+\raisebox{-\ticket@shift@y}[0mm][0mm]{%
+\raisebox{-\ticketHeight}[0mm][0mm]{%
+\hspace*{\ticket@shift@x}%
+%
+% open a picture of zero size and place some crosses
+\begin{picture}(0,0)%
+\if@crossmark
+  \put(0,0){\ticket@cross}%
+  \put(0,\ticket@size@Y){\ticket@cross}%
+  \put(\ticket@size@X,0){\ticket@cross}%
+  \put(\ticket@size@X,\ticket@size@Y){\ticket@cross}%
+\fi
+\if@circlemark
+  \put(0,0){\circle{1}}%
+  \put(0,\ticket@size@Y){\circle{1}}%
+  \put(\ticket@size@X,0){\circle{1}}%
+  \put(\ticket@size@X,\ticket@size@Y){\circle{1}}%
+\fi
+\if@boxed
+  \put(0,0){\line(1,0){\ticket@size@X}}
+  \put(0,0){\line(0,1){\ticket@size@Y}}
+  \put(\ticket@size@X,\ticket@size@Y){\line(-1,0){\ticket@size@X}}
+  \put(\ticket@size@X,\ticket@size@Y){\line(0,-1){\ticket@size@Y}}
+\fi
+% put the default content into the ticket
+\ticketdefault%
+% put the variable content into the ticket
+#1%
+\end{picture}}}\ticket@counter}
+
+\def\ticket@cross{%
+  \begin{picture}(0,0)%
+    \put(-1,0){\line(1,0){2}}\put(0,-1){\line(0,1){2}}%
+    \end{picture}}
+
+
+
+
+\endinput
+
+
-- 
cgit v1.2.3

