Cover letter with style - part three

This is the third part of the tutorial Cover letter with style. You can find the second part here.

It's time to setup a custom header for our cover letter. I usually put my name and my current job title in the header, accordingly to my big ego. In KOMA-Script, there are several ways to define your own header; each one offers an increasing degree of freedom but also an increasing complication in use. Luckily enough, for our purposes, we can use the easiest.

So, the simplest way to change your header is by the \firsthead command. That will set the custom header just for the first page of the document. But we're talking about a cover letter: don't even think to make it longer than a page. Enough said, I will modify the template now

  1. \ProvidesFile{standard.lco}[%
  2.   2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]
  3.  
  4. \usepackage{fontspec}
  5.  
  6. % ==============================================
  7. %  PERSONAL DATA
  8. % ==============================================
  9. \setkomavar{fromname}{Iulius Caesar}
  10. \setkomavar{fromaddress}{Van Eeghenlaan 69\\1691QT Amsterdam\\Nederland}
  11. \setkomavar{fromphone}{+31 (0)22 7394203}
  12. \setkomavar{fromemail}{iulius@gmail.com}
  13. \setkomavar{fromfax}{+31 (0)71 5144543}
  14. \setkomavar{fromurl}{http://stefano.italians.nl}
  15. \setkomavar{frombank}{Postbank 9307157}
  16. \setkomavar{place}{Amsterdam}
  17. \setkomavar{signature}{Iulius Caesar}
  18.  
  19. % ==============================================
  20. %  FORMATTING STUFF
  21. % ==============================================
  22.  
  23. % === font settings
  24. \defaultfontfeatures{Mapping=tex-text}
  25. \setmainfont {Adobe Garamond Pro}
  26. \setsansfont {Gill Sans Std}
  27.  
  28. %set the font size and leading
  29. \renewcommand{\normalsize}{\fontsize{12.5}{17}\selectfont}
  30.  
  31. \firsthead{
  32.    \centering
  33.          \usekomavar{fromname}\\
  34.          Programmer and Architect at Initech
  35. }
  36.  
  37. \endinput

So, I have specified the following: the header shall be centered and will be comprised of two lines (the \\ is the latex command to break the line). The first line will be our name. I didn't write it directly because it is already set at line 9. Instead, I used \usekomavar to lookup the fromname variable. Here I am adhering to the D-FRY principle: don't fucking repeat yourself. The second line is the job title. You can choose to define a variable as well, if you plan to use the job title more than once in your letter.

Now, render the letter again, to see the result

header one

Well, it sucks. I will increase the font size, and use the small caps version.

  1. \ProvidesFile{standard.lco}[%
  2.   2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]
  3.  
  4. \usepackage{fontspec}
  5.  
  6. % ==============================================
  7. %  PERSONAL DATA
  8. % ==============================================
  9. \setkomavar{fromname}{Iulius Caesar}
  10. \setkomavar{fromaddress}{Van Eeghenlaan 69\\1691QT Amsterdam\\Nederland}
  11. \setkomavar{fromphone}{+31 (0)22 7394203}
  12. \setkomavar{fromemail}{iulius@gmail.com}
  13. \setkomavar{fromfax}{+31 (0)71 5144543}
  14. \setkomavar{fromurl}{http://stefano.italians.nl}
  15. \setkomavar{frombank}{Postbank 9307157}
  16. \setkomavar{place}{Amsterdam}
  17. \setkomavar{signature}{Iulius Caesar}
  18.  
  19. % ==============================================
  20. %  FORMATTING STUFF
  21. % ==============================================
  22.  
  23. % === font settings
  24. \defaultfontfeatures{Mapping=tex-text}
  25. \setmainfont {Adobe Garamond Pro}
  26. \setsansfont {Gill Sans Std}
  27.  
  28. %set the font size and leading
  29. \renewcommand{\normalsize}{\fontsize{12.5}{17}\selectfont}
  30.  
  31. \firsthead{
  32.    \centering
  33.          \fontsize{36}{36}\selectfont\scshape \usekomavar{fromname}\\
  34.          \fontsize{21}{21}\selectfont\scshape Programmer and Architect at Initech
  35. }
  36.  
  37. \endinput

Now the header looks like this

header two

Much better. But I'm still not quite happy. So, I will increase the letter spacing, just for the first line. I will change the so called "feature" LetterSpace.

  1. \ProvidesFile{standard.lco}[%
  2.   2002/07/09 v0.9a LaTeX2e unsupported letter-class-option]
  3.  
  4. \usepackage{fontspec}
  5.  
  6. % ==============================================
  7. %  PERSONAL DATA
  8. % ==============================================
  9. \setkomavar{fromname}{Iulius Caesar}
  10. \setkomavar{fromaddress}{Van Eeghenlaan 69\\1691QT Amsterdam\\Nederland}
  11. \setkomavar{fromphone}{+31 (0)22 7394203}
  12. \setkomavar{fromemail}{iulius@gmail.com}
  13. \setkomavar{fromfax}{+31 (0)71 5144543}
  14. \setkomavar{fromurl}{http://stefano.italians.nl}
  15. \setkomavar{frombank}{Postbank 9307157}
  16. \setkomavar{place}{Amsterdam}
  17. \setkomavar{signature}{Iulius Caesar}
  18.  
  19. % ==============================================
  20. %  FORMATTING STUFF
  21. % ==============================================
  22.  
  23. % === font settings
  24. \defaultfontfeatures{Mapping=tex-text}
  25. \setmainfont {Adobe Garamond Pro}
  26. \setsansfont {Gill Sans Std}
  27.  
  28. %set the font size and leading
  29. \renewcommand{\normalsize}{\fontsize{12.5}{17}\selectfont}
  30.  
  31. \firsthead{
  32.    \centering
  33.          {\addfontfeature{LetterSpace=20.0}\fontsize{36}{36}\selectfont\scshape \usekomavar{fromname}}\\[5mm]
  34.          \fontsize{21}{21}\selectfont\scshape Programmer and Architect at Initech
  35. }
  36.  
  37. \endinput

I used the command \addfontfeature to set the LetterSpace feature equal to 20. To find the right factor, I just did some experiments. Mind the use of a pair of {} to enclose the entire first line. In this way the change of letter spacing is local to the first line and don't apply to the second line. I also set up half centimeter of space between the lines, with the command \\[put your vertical distance here]

So, render again the letter and see the result:

header three

Well, now take a look at the entire page so far

step 4 completed

Perfect. In the next part I will show how to setup up the footer and then we will be ready for the watermarks, logo and barcode...

2 Comments so far

  1. Sagun on August 30th, 2009

    Very nice.

    Thanks

    Sagun

  2. hii on April 23rd, 2010

    Hello

    can i get the finished coded cover letter for latex , the cover latter from casear? thank you

Leave a reply