Cover letter with style - part five
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 letter1
Ok, ready to go. Well...almost: you need a logo. For this time, I will provide one (Save link as...) so you can proceed with the tutorial. It is a simple vectorial image, edited with Inkscape. If you don't have Inkscape installed, you already know what to do:
sudo apt-get 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. I already explained how to install new fonts in linux, so I won't bother you further.
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

replace it 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:

There's only one option you should change: enable the "Convert texts to paths". What it does is converting... well, text into vectorial outlines (so font informations are then discarded) If you don't check that option, acrobat reader will consider text as text in your final pdf document. In brief, it will make the text selectable, like this

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. A little digression: 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:

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.

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, please. End of digression.
Ok, time is come to add our picture as the page background. For the purpose I will use a tiny package called eso-pic.
-
\ProvidesFile{standard.lco}[%
-
2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]
-
-
\usepackage{fontspec}
-
\usepackage{marvosym}
-
\usepackage{eso-pic}
-
-
% ==============================================
-
% PERSONAL DATA
-
% ==============================================
-
\setkomavar{fromname}{Iulius Caesar}
-
\setkomavar{fromaddress}{Van Eeghenlaan 69\\1691QT Amsterdam\\Nederland}
-
\setkomavar{fromphone}{+31 (0)22 7394203}
-
\setkomavar{fromemail}{iulius@gmail.com}
-
\setkomavar{fromfax}{+31 (0)71 5144543}
-
\setkomavar{fromurl}{http://stefano.italians.nl}
-
\setkomavar{frombank}{Postbank 9307157}
-
\setkomavar{place}{Amsterdam}
-
\setkomavar{signature}{Iulius Caesar}
-
-
% ==============================================
-
% FORMATTING STUFF
-
% ==============================================
-
-
% === font settings
-
\defaultfontfeatures{Mapping=tex-text}
-
\setmainfont {Adobe Garamond Pro}
-
\setsansfont {Gill Sans Std}
-
-
%set the font size and leading
-
\renewcommand{\normalsize}{\fontsize{12.5}{17}\selectfont}
-
-
% === header settings
-
\firsthead{
-
\centering
-
{\addfontfeature{LetterSpace=20.0}\fontsize{36}{36}\selectfont\scshape \usekomavar{fromname}}\\[5mm]
-
\fontsize{21}{21}\selectfont\scshape Programmer and Architect at Initech
-
}
-
-
% === footer settings
-
\firstfoot{
-
\centering
-
\addfontfeature{LetterSpace=20.0}\scshape
-
{
-
\renewcommand{\\}{\ {\large\textperiodcentered}\ }
-
\usekomavar{fromaddress}
-
}\\
-
{\Large\Letter} \usekomavar{fromemail} \ {\Large\Telefon} \usekomavar{fromphone}
-
-
% === watermark settings
-
\newcommand\BackgroundPicture{
-
\put(0,0){
-
\parbox[b][\paperheight]{\paperwidth}{
-
\vfill
-
\centering
-
\includegraphics[width=0.8\paperwidth,height=0.8\paperheight,%
-
keepaspectratio]{sample_logo_transparent.eps}%
-
\vfill
-
}}}
-
-
% the picture is centered on the page background
-
\AddToShipoutPicture{\BackgroundPicture}
-
-
-
\endinput
At line 6 I imported the package and at line 62 I added the background picture, which is defined in lines 51-59. 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:

Our mighty page came to life. Hope you like it. Happy experimenting.
Click here for the last part of the tutorial.
- Note that in this part of the tutorial there is nothing specific to XeLaTex, so ideally you can use these instructions to add a watermark also to plain Latex documents. [↩]
I had to add \usepackage{graphicx} in order for \includegraphics command to work.
Thanks for the great guide!
Ok with ADude’s comment. By the way, you’ve explained already how to install fonts on Linux, but how does it work on windows XP. There are several folders in which font files are. The default folder for windows, and several folders for MikTeX… Besides, does the name of the .otf files change anything? I had issues to install fonts, and use them to be honest….
Thanks a lot, and sorry to use linux only occasionally….
Hi Stefano,
I tried to get the background logo in the letter. But, it is showing error when I add the statement ‘\AddToShipoutPicture{\BackgroundPicture}’
The error that I am getting is :
Undefined control sequence.
\ESO@HookI ->\BackgroundPicture
l.195 \opening{Dr. Hamilton:} \body
\closing{Respectfully,}
?
I tried to correct it for hours, but still the same problem.
I am using windows 7 OS. So, I typed the contents of the .lco file in the preamble itself. I hope u can provide some ideas as to how I can fix it.
Arun
Hi,
Arun, R1, I don’t use Windows, sorry.