From: mroth@afit.af.mil (Mark A. Roth)
Newsgroups: comp.text.tex
Subject: business card style version 1.2
Date: Wed, 23 Dec 92 10:41:33 EST
Organization: Info-Tex<==>Comp.Text.Tex Gateway
X-Gateway-Source-Info: Mailing List

Thanks to several good comments from the net, I have a more generic and a
safer version of buscard.sty.  Enjoy!
Mark Roth
---------------cut here--------------
%buscard.sty version 1.2 23 Dec 92
%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
%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
\cardwidth 3.5in \cardcontentheight 108.5pt \cardcontentwidth 225pt
\newdimen\headerwidth \newdimen\sealindent \sealindent 39pt
\headerwidth\cardcontentwidth \addtolength{\headerwidth}{-\sealindent}
\addtolength{\headerwidth}{-3pt}
\headheight 0pt \headsep 0pt \parindent 0pt \parskip 0pt \footheight 0pt
\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{#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@seal{}\newif\if@sealhere \@sealherefalse
\def\seal#1{\ifx\bc@e#1\else%
\def\bc@seal{#1}\@sealheretrue\input psfig \pssilent\fi}
\fboxsep 17pt
\def\bc@makecard{\ \hspace*{-10pt}\vspace*{-.5pt}
\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
\vspace*{-8pt}
\psfig{figure=\bc@seal,width=.71in}%print the seal scaled to fit specified width
\vspace*{-.61in}
\vbox to .41in{
\hspace*{\sealindent} \begin{minipage}{\headerwidth}
\begin{center}
{\footnotesize\sf \bc@organization}
{\scriptsize\sf \bc@department}
\end{center}
\vfill
\end{minipage}
}
\else
\begin{center}
{\footnotesize\sf \bc@organization}
{\scriptsize\sf \bc@department}
\end{center}
\vfill
\fi
%
%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

\newcounter{card} \newcounter{printedcard} \newcounter{pagecard}
\def\makecard#1{\ \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}\ \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 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 frames 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}
Newsgroups: comp.text.tex