Business Card with Latex

So, I needed some business cards for a meeting but I rarely ever need more than 8 or so at a time (yes, I’m aware that they look less classy, but having some done would have taken to long) I decided to make some with Latex.
So, here i swhat I have done:

First I declared a Xetex-Preamble to be able to use the fonts from my linux system and don’t have to bother with encoding

 documentclass[a4paper,11pt]{article}
 usepackage[cm-default]{fontspec}
 usepackage{xunicode}
 usepackage{xltxtra}
 usepackage{graphicx} 
 setmainfont[Mapping=tex-text]{Ubuntu}
 setsansfont[Mapping=tex-text]{Ubuntu}
 setmonofont[Mapping=tex-text]{Cantarell}

Next I got rid of all elements that by default come with the article documentclass and redefined width and height of the paper to match an A4 sheet and some other dimensions.

 pagestyle{empty}
 setlength{unitlength}{1mm}
 setlength{paperheight}{297mm}
 setlength{paperwidth}{210mm}
 setlength{oddsidemargin}{-7mm}
 setlength{topmargin}{32mm}
 setlength{textheight}{280mm}

After that I declared all text elements that should be on the card.

 newcommand{bcname}{Caspar David Dzikus}
 newcommand{bctitleA}{KodeKitchen Writer}
 newcommand{bctitleB}{}
 newcommand{bccontactA}{555-555-5555}
 newcommand{bccontactB}{caspar@kodekitchen.com}
 newcommand{bccontactC}{http://kodekitchen.com}
 newcommand{bcsub}{coding and stuff}

The document itself is pretty straightforward: The card itself is a picture which is then repeated ten times (five rows, two columns) in another picture. To help cut the cards marks are placed in the corner of each card (which is 80 x50mm)

 begin{document}
 begin{picture}(170,209)(0,0)
 multiput(0,0)(0,50){5}{
    multiput(0,0)(80,0){2}{
       begin{picture}(80,50)(0,0)
       % marks for cutting
       put(-1,0){line(1,0){2}}
       put(0,49){line(0,1){2}}
       put(-1,50){line(1,0){2}}
       put(0,-1){line(0,1){2}}
       put(80,49){line(0,1){2}}
       put(80,-1){line(0,1){2}}
       put(79,0){line(1,0){2}}
       put(79,50){line(1,0){2}}

      put(13,39.5){textsf{LARGEbcname}}
      put(13,34){textsf{scriptsizebctitleA}}
      put(13,31){textsf{scriptsizebctitleB}}
      put(13,24){tt{normalsizebccontactA}}
      put(13,19){tt{normalsizebccontactB}}
      put(13,14){tt{normalsizebccontactC}}
      put(55,8){textsf{scriptsizebcsub}}

     end{picture}
     }
 }
 end{picture}

end{document}

And this is what you get

Advertisements