Cover Letter with Style - Part Five

Feb 01, 2014

A tutorial illustrating a way to obtain stylish cover letters with XeLaTeX

This is the fifth part of the tutorial Cover letter with style. You can find the fourth part here.

In this part I will show you how to add your logo as a watermark to your cover letter

Ok, you need a logo first. I will provide one (Save link as…) so you can proceed with the tutorial. It is a simple vectorial image, edited with Inkscape. On Ubuntu and other debian based distributions, you can install it with:

sudo apt-get install inkscape

On mac, you can use Homebrew

brew install inkscape

Actually, if you are able to, I suggest to compile and install Inkscape from the svn sources, but it is not mandatory.

Another thing you need is to install a couple of fonts in a way the logo will look like as I designed. The fonts are: Diavlo and Fontin. Designed by Jos Buivenga, they are free to use.

Once the fonts and Inkscape are installed, grab the svg sample logo I made for you. Launch Inkscape, open the file and customize a little bit. For example, you could select the name

Inkscape name selected

replace it with yours and then adjust the its displacement with ALT+(arrows up/down/left/right), which are the keys to adjust the font tracking and kerning in Inkscape. There’s a plenty of Inkscape tutorials out there, so I am confident you will come up with a decent logo for yourself.

For the moment, I suggest you to do just little changes and save the file as Encapsulated Postscript (.eps). Before saving, Inkscape shows you this dialog:

Inkscape saving dialog

There’s only one option you should change: enable the “Convert texts to paths”. What it does is converting text into vectorial outlines, so font informations are discarded. If you don’t check that option, the pdf reader will make the text selectable, like this

Inkscape selectable text

And, in general, you don’t want that happening for a background image, don’t you?

Anyway, now you should have your beautiful logo, says sample_logo_transparent.eps. For the name of my logo I used the word ‘transparent’, but the eps’s don’t really support transparency. If you go back to Inkscape and look carefully at the fill properties of the text:

Inkscape fill property

you will notice that the opacity is 100% and the color of the outlines is just a light gray, giving the impression, in the final document, of transparency. At first one could think to use indeed opacity parameter and save the logo as pdf (which supports transparency) but the final result is awful.

Inkscape fill property

The above picture is not a screenshot gone bad, it is the actual result if you try to import the image as pdf (supporting transparency) instead of an encapsulated postscript (which doesn’t support transparency, so you are forced to fake using light colors). If someone obtains better results in importing images as pdf’s, let me know.

Ok, time is come to add our picture as the page background. For the purpose I will use a tiny package called eso-pic.

 1 \ProvidesFile{standard.lco}[%
 2   2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]
 3 
 4 \usepackage[english]{babel}
 5 \usepackage{fontspec}
 6 \usepackage{fix-cm}
 7 \usepackage{marvosym}
 8 \usepackage{eso-pic}
 9  
10 .
11 .
12 .
13 
14 % === watermark settings
15 \newcommand\BackgroundPicture{
16    \put(0,0){
17      \parbox[b][\paperheight]{\paperwidth}{
18        \vfill
19        \centering
20        \includegraphics[width=0.8\paperwidth,height=0.8\paperheight,%
21                         keepaspectratio]{sample_logo_transparent.eps}%
22        \vfill
23      }}}
24 
25 % the picture is centered on the page background
26 \AddToShipoutPicture{\BackgroundPicture}
27 
28 \endinput

At line 8 I imported the package and at line 62 I added the background picture, which is defined in lines 15-23. The command \BackgroundPicture will put a box big as the entire page. Inside the box, the image, centered orizontally (with \centering) and vertically (with a pair of enclosing \vfill)

Finally! Let’s run xelatex and see the result:

Sample letter with logo

Our mighty page came to life.

Click here for the last part of the tutorial.