summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/bizcard/bizcard.dtx
blob: b023bd8f80edc7ff9dcf53535588d7a88fcaddcc (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
\def\fileversion{1.1} % ^^A -*-latex-*-
\def\filedate{1999/09/04} 
%\iffalse meta-comment
%<*driver>
\documentclass{ltxdoc}

\newcommand*{\bizcard}{\textsf{bizcard}}

\begin{document}

\DocInput{bizcard.dtx}

\end{document}
%</driver>
%\fi
% ^^A $Id: bizcard.dtx,v 1.2 1999/08/30 19:46:53 skirsch Exp skirsch $
%%\CheckSum{73}
%%\CharacterTable
%% {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%  Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%  Digits        \0\1\2\3\4\5\6\7\8\9
%%  Exclamation   \!     Double quote  \"     Hash (number) \#
%%  Dollar        \$     Percent       \%     Ampersand     \&
%%  Acute accent  \'     Left paren    \(     Right paren   \)
%%  Asterisk      \*     Plus          \+     Comma         \,
%%  Minus         \-     Point         \.     Solidus       \/
%%  Colon         \:     Semicolon     \;     Less than     \<
%%  Equals        \=     Greater than  \>     Question mark \?
%%  Commercial at \@     Left bracket  \[     Backslash     \\
%%  Right bracket \]     Circumflex    \^     Underscore    \_
%%  Grave accent  \`     Left brace    \{     Vertical bar  \|
%%  Right brace   \}     Tilde         \~}
%
%\changes{1.0}{1999/08/30}{Based on a \LaTeX2.09 style by Silvano Balemi.}
%\changes{1.1}{1999/09/04}{Version check for \texttt{geometry}. Simpler
%example.}
%
%\title{\bizcard: A \LaTeXe\ package for business/visiting/calling
%cards\thanks{This file has version number \fileversion, last revised
%\filedate.}}
%
%\author{Sebastian Marius Kirsch\\
%  \texttt{skirsch@t-online.de}}
%
%\date{\filedate}
%
%\maketitle
%
%\begin{abstract}
%This is a package for typesetting business/visiting/calling
%cards\footnote{I'm unsure about the correct term; my dictionary says
%visiting/calling card, but `visiting card' sounds awfully like a
%literal translation of the German `Visitenkarte', and I've only heard
%them referred to as `business cards', so that's what I'm calling them.}
%in the standard size \(2''\times 3.5''\). 
%\end{abstract}
%
%\section{Introduction}
%
%This style is an adaption of \texttt{card.sty} by Silvano Balemi, a
%\LaTeX2.09 style for the same purpose. The original style file can be
%found under 
%\begin{quote}
%  \texttt{CTAN:macros/latex209/contrib/misc/card.sty}
%\end{quote}
%I adapted
%it to \LaTeXe, wrote the documentation (the docs in Silvano's original
%file are, unfortunately, slightly wrong), and changed the size of the
%cards to the American standard size \(2''\times 3.5''\). (At least,
%there is a standard for biz cards in the USA.)
%
%If you are interested in other uses for business cards, and a reason
%why they \emph{have} to have the proportions \(4\times7\), go to
%
%\begin{quote}
%|http://users.aol.com/polygons/bcards/bcards1.html| or\\
%|http://world.std.com/~j9/sponge/|
%\end{quote}
%                                %
%\section{Requirements}
%
%If the package finds that the current text area is not large enough for
%a sheet of biz cards (\(179\,\mathrm{mm}\times 255\,\mathrm{mm}\)), it
%will load the \texttt{geometry} package (from
%\texttt{CTAN:macros/latex/contrib/supported/geometry/} to set a
%sufficiently large text area. 
%
%If you do not have the \texttt{geometry} package, or your version is
%too old, you can load a different package to enlarge the text area
%(eg. \texttt{vmargin} or \texttt{typearea}) before loading \bizcard\
%and thereby avoid loading \texttt{geometry}.
%
%\section{Installation}
%
%The actual package is produced by running \TeX\ on |bizcard.ins|. This
%produces |bizcard.sty|, the style file, which must be moved where \TeX\
%can find it. 
%
%\section{Options}
%
%The package accepts four options that affect how the dimensions of the
%cards are marked:
%
%\begin{description}
%\item[\texttt{star}] (default) tiny stars in the corners of the cards.
%\item[\texttt{none}] no marks. Figure out for yourself where the
%  cards end. Allegedly useful for double-sided cards.
%\item[\texttt{frame}] full frames around the cards. Useful for designing
%  new cards.
%\item[\texttt{flat}] non-invasive marks that are outside the cards
%  (like crop marks.) Most useful if you are cutting the cards on a
%  guillotine cutting machine.
%\end{description}
%
%\section{The \texttt{bizcard} environment}
%
%The \texttt{bizcard} environment contains the description of the
%card. It is implemented via a \texttt{picture} environment with the
%|\unitlength| of \(1\,\mathrm{mm}\) and the dimensions
%\(89\times51\). Therefore, you can use all the \texttt{picture}
%commands in it---indeed, you have to. 
%
%The \texttt{bizcard} environment will print one page of 10 biz cards.
%
%\section{Example}
%
%The package is used like this:
%
%    \begin{macrocode}
%<*example>
\documentclass[a4paper]{article}

\usepackage[flat]{bizcard}

\begin{document}

\begin{bizcard}
  \sffamily
  
  \put(19,38){\makebox(50,5){\Large\bfseries Sebastian Kirsch}}
  \put(19,32){\makebox(50,5){\large -- origami art --}}
  
  \put(7,14){\makebox(79,4)[tl]{Marh{\"o}ferstra{\ss}e 23A}}
  \put(7,10){\makebox(79,4)[tl]{66978 Clausen}}
  \put(7,6){\makebox(79,4)[tl]{Germany}}
  
  \put(43,14){\makebox(10,4)[tr]{e-mail:}}
  \put(57,14){\makebox(25,4)[tr]{skirsch@t-online.de}}
  
  \put(43,10){\makebox(10,4)[tr]{phone:}}
  \put(57,10){\makebox(25,4)[tr]{+49\,6333\,4653}}
  
  \put(43,6){\makebox(10,4)[tr]{fax:}}
  \put(57,6){\makebox(25,4)[tr]{+49\,6333\,7222}}
\end{bizcard}

\end{document}
%</example>
%    \end{macrocode}
%
%\section{Legal rubbish}
%\bizcard: A \LaTeXe package for business/visiting/calling cards
%
%Copyright \copyright\ 1999 Sebastian Marius Kirsch\texttt{%
% $\langle$skirsch@t-online.de$\rangle$}
%
%This program is free software; you can redistribute it and/or modify
%it under the terms of the GNU General Public License as published by
%the Free Software Foundation; either version 2, or (at your option)
%any later version.
%
%This program 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.  See the
%GNU General Public License for more details.
%
%You should have received a copy of the GNU General Public License
%along with this program; see the file COPYING.
%If not, write to the Free Software Foundation,
%59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
%%
%\StopEventually
%
%\section{The \texttt{docstrip} modules}
%
%This file contains three modules to direct \texttt{docstrip} in
%generating the external files:
%
%\begin{tabular}[t]{ll}
%driver & A short driver for producing the documentation\\
%package & The package itself\\
%example & The example mentioned above
%\end{tabular}
%
%\section{The Code}
%
%\subsection{Introduction}
%
%First we have to introduce ourselves.
%
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bizcard}%
  [\filedate\space v\fileversion\space  Package for business cards]
%    \end{macrocode}
%
%\subsection{Marks}
%
%    \begin{macrocode}
\newcommand*{\bizcard@marks}{}
%    \end{macrocode}
%
%Create no marks. Useful when printing double-sided cards.
%
%    \begin{macrocode}
\DeclareOption{none}{\renewcommand{\bizcard@marks}{}}
%    \end{macrocode}
%
% Draws the full frame around each card. Useful for designing a card.
%
%    \begin{macrocode}
\DeclareOption{frame}{\renewcommand{\bizcard@marks}{%
    \multiput(0,0)(0,51){6}{\line(1,0){178}}
    \multiput(0,0)(89,0){3}{\line(0,1){255}}}}
%    \end{macrocode}
%
% Creates small star at all corners of all cards.
%
%    \begin{macrocode}
\DeclareOption{star}{\renewcommand{\bizcard@marks}{%
\multiput(0,0)(0,51){6}{\makebox(0.0,0.1)[c]{{\tiny +}}}
\multiput(89,0)(0,51){6}{\makebox(0.0,0.1)[c]{{\tiny +}}}
\multiput(178,0)(0,51){6}{\makebox(0.0,0.1)[c]{{\tiny +}}}}}
%    \end{macrocode}
%
% These marks are not invasive. Marks are not put on the cards.
%
%    \begin{macrocode}
\DeclareOption{flat}{\renewcommand{\bizcard@marks}{%
\thinlines
\multiput(0,-.5)(89,0){3}{\line(0,-1){5}}
\multiput(0,255.5)(89,0){3}{\line(0,1){5}}
\multiput(-.5,0)(0,51){6}{\line(-1,0){5}}
\multiput(178.5,0)(0,51){6}{\line(1,0){5}}}}
%    \end{macrocode}
%
%Default marks are star marks.
%
%    \begin{macrocode}
\ExecuteOptions{star}

\ProcessOptions
%    \end{macrocode}
%
%\subsection{Type area}
%
%If the package finds that the dimensions of the body are too small to
%contain a sheet of biz cards, it will call the \texttt{geometry}
%package to make enough room. 
%
%    \begin{macrocode}
\RequirePackage{ifthen}

\ifthenelse{%
  \lengthtest{\textwidth<178.8mm}\or\lengthtest{\textheight<255mm}}{%
  \RequirePackage[body={178.8mm,255mm},noheadfoot]{geometry}[1998/04/08]%
  }{}
%    \end{macrocode}
%
%\subsection{The \texttt{bizcard} environment}
%
%The \texttt{bizcard} environment uses two \texttt{picture} environments
%to typeset both the single card and the full sheet of pages.
%
%    \begin{macrocode}
\newsavebox{\bizcard@box}

\newenvironment{bizcard}{%
  \setlength{\unitlength}{1mm}%
  \begin{lrbox}{\bizcard@box}%
    \begin{picture}(89,51)%
      }{%
    \end{picture}%
  \end{lrbox}%
  \thispagestyle{empty}%
  \noindent\begin{picture}(178,255)(0,0)%
    \multiput(0,0)(0,51){5}{\usebox{\bizcard@box}}
    \multiput(89,0)(0,51){5}{\usebox{\bizcard@box}}
    \bizcard@marks 
  \end{picture}
  }
%</package>
%    \end{macrocode}
%
%\Finale
\endinput