Business card example

This LaTeX business card template uses TikZ to position graphics elements.

%card-heinjd.tex: a business card layout document, using TikZ for layout and 
% rendering.  The user can specify all contents, and customize the location by 
% adjusting the coordinate info.  Font styles are also defined by styles.  This 
% can print either a single card or a sheet of them, based on the ``makesheet'' 
% boolean flag. 
%
%created by: Jeff Hein
%
%last modified: 2008-07-12

\documentclass[letterpaper]{article}

\usepackage{tikz}				%tikz graphics package for drawing with pgf
\usepackage{pgfplots}		%pgfplots package for plotting graphs
\usepackage{ifthen}			%for conditional statements
\usepackage{fp}				%for fixed point math computation

\usetikzlibrary{calc}

%graphics subdirectory for artwork, etc
%=============================
\graphicspath{{images/}}
%=============================

\pagestyle{empty}

%configuration


%boolean flag to indicate whether an Avery sheet or an individual card should be rendered
\newboolean{makesheet}

%true: creates a 8.5"x11" page with multiple cards spaced accordingly
%false: creates a single card
%=============================
\setboolean{makesheet}{false}
%=============================

\newcommand{\cardname}{Jeffrey D. Hein}
\newcommand{\cardtitle}{Ph.D. Candidate}
\newcommand{\cardaddra}{University of Manitoba}
\newcommand{\cardaddrb}{Dept. of Physics and Astronomy}
\newcommand{\cardaddrc}{301 Allen Building}
\newcommand{\cardaddrd}{Winnipeg, MB  R3T 2N2 ~  Canada}
\newcommand{\cardphone}{204-474-9289}
\newcommand{\cardfax}{204-474-6177}
\newcommand{\cardemail}{umheinjd@cc.umanitoba.ca}
\newcommand{\cardurl}{http://www.heinjd.com/}

%replace this with any desired artwork, or even a TikZ rendered image if desired
\newcommand{\artwork}{\includegraphics[height=1.5cm]{UM_logo_col_vert.pdf}}


%card dimension configuration
\FPset{\cardheight}{2}			%card height, in inches
\FPset{\cardwidth}{3.5}			%card width, in inches


%font styles
\tikzset{header_text/.style={color=red!50!black,font=\LARGE\bfseries}}
\tikzset{subheader_text/.style={color=red!50!black,font=\normalsize\bfseries}}
\tikzset{body_text/.style={color=black,font=\footnotesize,anchor=west}}

\tikzset{address_text/.style={color=black,font=\scriptsize\bfseries,anchor=north west}}
\tikzset{email_text/.style={color=black,font=\footnotesize,anchor=west}}


%main card rendering command
\newcommand{\drawcard}{%
%
	\coordinate (top left) at (0, \cardheight in);
	\coordinate (top right) at ( \cardwidth in,\cardheight in);
	\coordinate (bottom left) at (0,0);
	\coordinate (bottom right) at (\cardwidth in,0);



	\coordinate (name) at ($ (top left) + (.5 cm, -1.5 cm) $);
	\coordinate (title) at ($ (name) + (0, 1 mm) $);

	\coordinate (logo) at ($ (top right) + (-.25cm, -.25 cm) $);

	\coordinate (phonelabel) at ($ (bottom left) + (.3cm,.8cm) $);
	\coordinate (phone) at ($ (phonelabel) + (1 cm,0) $);

	\coordinate (faxlabel) at ($ (bottom left) + (.3cm,.5cm) $);
	\coordinate (fax) at ($ (faxlabel) + (1 cm,0) $);

	\coordinate (urllabel) at ($ (bottom left) + .4*(bottom right) + (0,.5 cm)$);
	\coordinate (url) at ($ (urllabel) + (1 cm,0) $);

	\coordinate (emaillabel) at ($ (bottom left) + .4*(bottom right) + (0,.8 cm)$);
	\coordinate (email) at ($ (emaillabel) + (1 cm,0) $);

	\coordinate (addrd) at ($ (bottom left) + 0.46*(bottom right) + (-.5 cm, 1.5 cm) $);
	\coordinate (addrc) at ($ (addrd) + (.0 cm, .3 cm) $);
	\coordinate (addrb) at ($ (addrc) + (.0 cm, .3 cm) $);
	\coordinate (addra) at ($ (addrb) + (.0 cm, .3 cm) $);



	%outer border (remove for proof)
	%TODO: make those little v-things for the corners
	\draw (top left) rectangle (bottom right);

	\node[header_text,anchor=south west] at (name){\cardname};
	\node[subheader_text,anchor=north west] at (title){\cardtitle};

	\node[address_text] at (addra){\cardaddra};
	\node[address_text] at (addrb){\cardaddrb};
	\node[address_text] at (addrc){\cardaddrc};
	\node[address_text] at (addrd){\cardaddrd};

	\node[body_text] at (phonelabel){phone:};
	\node[email_text] at (phone){\cardphone};
	\node[body_text] at (faxlabel){fax:};
	\node[email_text] at (fax){\cardfax};


	\node[body_text] at (emaillabel){email:};
	\node[email_text] at (email){\cardemail};
	\node[body_text] at (urllabel){url:};
	\node[email_text] at (url){\cardurl};

	\node[anchor=north east] at (logo){\artwork};
}

\ifthenelse{\boolean{makesheet}}{}
{
	%for individual card, load the preview environment
	\usepackage[active,tightpage]{preview}
	\PreviewEnvironment{tikzpicture}
	\setlength\PreviewBorder{0mm}
}

%document begins here
\begin{document}

\ifthenelse{\boolean{makesheet}}
{
	%if making a sheet of business cards

	%define offsets for cards on sheet
	\FPset{\xoffset}{.5}				%card grid x offfset spacing, in inches
	\FPset{\yoffset}{.75}				%card grid y offset spacing, in inches

	\begin{tikzpicture}[remember picture,overlay]
		
		%card relative x positions, in inches.  
		\foreach \x in {0, 4}
		{
			%card y positions, in inches
			\foreach \y in {0, 2.5, 5, 7.5}
			{
				\coordinate (drawpoint) at ($ (current page.south west) + (\x in ,\y in) + (\xoffset in, \yoffset in) $);
	
				\begin{scope}[shift=(drawpoint)]
					\drawcard
				\end{scope}
			}
		}
	\end{tikzpicture}
}
{
	%draw a single card
	\begin{tikzpicture}
		\drawcard
	\end{tikzpicture}
}

\end{document}