Article View: comp.text.tex
Article #11085buscard.sty version 1.4
From: Mark A. Roth
Date: Fri, 08 Jan 1993 19:49
Date: Fri, 08 Jan 1993 19:49
231 lines
9166 bytes
9166 bytes
Another update to the business card style. This allows specification of
the seal width and height, and uses cut marks instead of full boxes. Plus
lots of cleanup, and less hard coding of numbers.
Enjoy,
Mark Roth
--------------cut here---------------
%buscard.sty version 1.4 8 Jan 93
%changes: 1.1: now works if empty entries present, can even print a blank card
% 1.2: uses psfig macros to set seal,
% new command to specify organization name and seal file
% 1.3: puts small cut marks instead of boxes around cards
% 1.4: adds specifications for sealwidth, sealheight, and sealoffset
%business card style by Mark A. Roth, 22 Dec 92. Email: mroth@afit.af.mil
%see end of file for example of use.
\documentstyle{article}
\nofiles
\makeatletter
%I need a 7pt sans serif font, which the standard LaTeX NFSS set doesn't have
\@ifundefined{new@fontshape}
{\errmessage{Sorry. This style uses the new font selection scheme. You'll
have to modify it to work with old style LaTeX.}
\endinput}{}
\new@fontshape{cmss}{m}{n}{%
<5>cmss8 at5pt%
<6>cmss8 at6pt%
<7>cmss8 at7pt%
<8>cmss8%
<9>cmss9%
<10>cmss10%
<11>cmss10 at10.95pt%
<12>cmss12%
<14>cmss12 at14.4pt%
<17>cmss17%
<20>cmss17 at20.74pt%
<25>cmss17 at24.88pt%
}{}
\pagestyle{empty}
\oddsidemargin -.25in \evensidemargin -.25in \marginparsep 0pt
\textwidth 7.1in \textheight 11in \topmargin -54pt \tabcolsep 0pt
\newdimen\cardwidth \newdimen\cardcontentheight \newdimen\cardcontentwidth
\newdimen\psfigsealheight \newdimen\psfigsealwidth
\cardwidth 3.5in \cardcontentheight 108.5pt \cardcontentwidth 225pt
\newdimen\headerwidth \headerwidth\cardcontentwidth
\headheight 0pt \headsep 0pt \parindent 0pt \parskip 0pt \footheight 0pt
%
%new def of @iframebox to get partial tic marks instead of boxes
%comment this out if you want whole boxes as in version 1.2
%if there's a better way please let me know
%
\long\def\@iframebox[#1][#2]#3{\leavevmode
\savebox\@tempboxa[#1][#2]{\kern\fboxsep #3\kern\fboxsep}\@tempdima\fboxrule
\advance\@tempdima \fboxsep \advance\@tempdima \dp\@tempboxa
\hbox{\lower \@tempdima\hbox
{\vbox{\hrule \@height \fboxrule \@width 3pt
\hbox{\vrule \@height 3pt \@width \fboxrule \hskip-\fboxrule
\vbox{\vskip\fboxsep \box\@tempboxa\vskip\fboxsep}\hskip
-\fboxrule\vrule \@height 3pt \@width \fboxrule}%
\hrule \@height \fboxrule \@width 3pt}}}}
%
\def\bc@e{}
\def\bc@organization{\mbox{}\\[2pt]}
\def\organization#1{\ifx\bc@e#1\else\def\bc@organization{#1\\[2pt]}\fi}
\def\bc@department{\mbox{}\\}
\def\department#1{\ifx\bc@e#1\else\def\bc@department{#1\\}\fi}
\def\bc@name{}
\def\name#1{\ifx\bc@e#1\else\def\bc@name{\ \\[-20pt]#1\\}\fi}
\def\bc@rank{}
\def\rank#1{\ifx\bc@e#1\else\def\bc@rank{#1\\}\fi}
\def\bc@title{}
\def\title#1{\ifx\bc@e#1\else\def\bc@title{#1\\}\fi}
\def\bc@right{}
\def\right#1{\def\bc@right{#1}}
\def\bc@left{}
\def\left#1{\def\bc@left{#1}}
\def\bc@email{}
\def\email#1{\def\bc@email{#1}}
\def\bc@workphone{}
\def\workphone#1{\def\bc@workphone{#1}}
\def\bc@fax{}
\def\fax#1{\def\bc@fax{#1}}
\def\bc@address{}
\def\address#1{\def\bc@address{#1}}
\def\bc@sealheight{0pt}\def\bc@sealwidth{0pt}
\def\bc@sealfile{}\def\bc@sealoffset{0pt}
\newif\if@sealhere \@sealherefalse
\def\seal#1{\ifx\bc@e#1\else%
\def\bc@sealfile{#1}\if@sealhere\else\input psfig \pssilent\@sealheretrue\fi\fi}
\def\sealwidth#1{\ifx\bc@e#1\else\def\bc@sealwidth{#1}%
\setlength{\psfigsealwidth}{\bc@sealwidth}%
\addtolength{\psfigsealwidth}{2.3pt}%
\addtolength{\headerwidth}{-\psfigsealwidth}\fi}
\def\sealheight#1{\ifx\bc@e#1\else\def\bc@sealheight{#1}%
\setlength{\psfigsealheight}{\bc@sealheight}%
\addtolength{\psfigsealheight}{2.3pt}\fi}
\def\sealoffset#1{\ifx\bc@e#1\else\def\bc@sealoffset{#1}\fi}
\fboxsep 17pt
\def\bc@makecard{\ \hspace*{-10.4pt}\vspace*{-.7pt}
\ifx\bc@right\bc@e\def\bc@right{\bc@email\hspace*{2pt}\\\bc@workphone\\%
\ifx\bc@fax\bc@e\else FAX: \bc@fax\fi}\fi
\ifx\bc@left\bc@e\def\bc@left{\bc@address}\fi
\framebox[\cardwidth]{%
\begin{minipage}{\cardcontentwidth}
\vbox to \cardcontentheight{
\if@sealhere
\ifx\bc@sealwidth\bc@e\errmessage{You must specify sealwidth and sealheight.}\fi
\vspace*{-8pt}
%print the seal scaled to fit specified width
\vbox to \psfigsealheight{\hbox to \psfigsealwidth{
\psfig{figure=\bc@sealfile,height=\bc@sealheight,width=\bc@sealwidth}%
}
\vspace*{-\bc@sealheight}\hspace*{\bc@sealwidth}%
\begin{minipage}[t]{\headerwidth}
\begin{center}
{\footnotesize\sf \bc@organization}
{\scriptsize\sf \bc@department}
\end{center}
\end{minipage}
}
\vfill
\vspace*{\bc@sealoffset}
\else %if no seal
\begin{center}
{\footnotesize\sf \bc@organization}
{\scriptsize\sf \bc@department}
\end{center}
\fi %end of if@sealhere
%
\vfill
%if name, rank, and title all empty then print a blank
\ifx\bc@name\bc@e\ifx\bc@rank\bc@e\ifx\bc@title\bc@e\def\bc@name{\mbox{}}%
\fi\fi\fi
\begin{center}
{\large\rm\bc@name}
{\scriptsize\sf\bc@rank}
{\scriptsize\sf\bc@title}
\end{center}
\vfill
\hbox to \cardcontentwidth{
\scriptsize\sf
\begin{tabular}[b]{l}
\bc@left
\end{tabular}
\hfill
\begin{tabular}[b]{r}
\bc@right
\end{tabular}
} %end hbox to cardcontentwidth
} %end vbox to cardcontentheight
\end{minipage} %end of minipage
} %end of framebox
} %end \bc@makecard
\newdimen\twocardwidth\twocardwidth2\cardwidth
\addtolength{\twocardwidth}{-\fboxrule}
\def\bc@topvertcut{\ \hspace*{-13.7pt}
\hbox to \twocardwidth{%
\vrule height 3pt width \fboxrule\hfill
\vrule height 3pt width \fboxrule\hfill
\vrule height 3pt width \fboxrule}\vskip-1pt}
\newcounter{card} \newcounter{printedcard} \newcounter{pagecard}
\def\makecard#1{%
\bc@topvertcut\par%
\ \hspace*{-6.7pt}%
\setcounter{card}{#1}\setcounter{printedcard}{0}\setcounter{pagecard}{0}%
\@whilenum\c@card>\c@printedcard\do%
{\bc@makecard\bc@makecard\newline%
\addtocounter{printedcard}{2}%
\addtocounter{pagecard}{1}%
\ifnum\c@pagecard=5%
\ifnum\c@card>\c@printedcard%
\newpage\setcounter{pagecard}{0}\bc@topvertcut\ \hspace*{-6.7pt}%
\fi%
\fi%
}%end while
}%end makecard
\makeatother
\endinput
%sample file to create business cards; change this file to
%hold your information and feed it to your favorite LaTeX processor.
%send comments/problems to Mark Roth, mroth@afit.af.mil
%
%Fill in the following with your info, \address gets printed in the
%lower left corner, \email, \workphone and \fax in the lower right corner.
%If you want to do your own thing in the corners use commands \left and
%\right, separating lines with \\
%
\documentstyle{buscard}
%
%the seal is an encapsulated PostScript file, leave out it you don't have one
\seal{sealname.eps}
%the desired seal width and height must be specified, the style will scale
%your seal image to this width and height. Make sure your image specifies
%the minimal bounding box. An adjustment for vertical height of the seal
%can be made by specifying a dimension for sealoffset.
\sealheight{dimen} %specify height of seal, e.g., .5in, 50pt, ...
\sealwidth{dimen} %specify width of seal, e.g., .5in, 50pt, ...
\sealoffset{dimen} %specify vertical adjustment after seal, e.g., .5in, -50pt
%make this space adjustment if your name, etc. doesn't look centered
%
%the department is printed under the organization name at the top of the card
%leave them out if you don't want them
\organization{UNIVERSITY OF TYPESETTING}
\department{Dept. of Electrical and Computer Engineering}
%
%the next three entries are centered in the middle of the card
\name{JOHN J. DOE, Ph.D.} %this format is up to you!
\rank{MAJOR, USAF} %all fields are optional
\title{PROFESSOR OF ELECTRICAL ENGINEERING}
%
%lower left corner
\address{First Line\\ Second Line\\ Third Line}
%
%lower right corner
\email{doe@somewhere}
\workphone{(555) 555-5555, DSN 555-5555}
\fax{(555) 555-5555, DSN 555-5555} %word FAX is automatically supplied
%
%this is the same info using \right
%\right{doe@somewhere\\
% (555) 555-5555, DSN 555-5555\\
% FAX: (555) 555-5555, DSN 555-5555} %you have to supply word FAX
%
%if you don't want cut marks around the cards uncomment the following line
%\fboxrule 0pt
\begin{document}
%this command prints the cards, 10 per page, in even numbers
\makecard{2} %change the number here to the number of cards you want
%don't try more than 10 to start, just in case don't like
%your cards on the first attempt
\end{document}
Technical Details
Message-ID:
<9301081949.AA16713@hawkeye.afit.af.mil>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!info-texShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!info-tex From: mroth@afit.af.mil (Mark A. Roth) Newsgroups: comp.text.tex Subject: buscard.sty version 1.4 Message-ID: <9301081949.AA16713@hawkeye.afit.af.mil> Date: Fri, 8 Jan 93 14:49:26 EST Organization: Info-Tex<==>Comp.Text.Tex Gateway X-Gateway-Source-Info: Mailing List Lines: 231