Changes

Jump to navigation Jump to search
6,703 bytes added ,  18:13, 2 December 2017
PDF document added for Modern CV cover letter example
File
\stopCC
 
\stoptext
</texcode>
 
==Letterhead==
 
The following style was presented in the PracTeX Journal by Joseph Hogg, you find the article under the following link:
 
* http://www.tug.org/pracjourn/2006-3/hogg/
 
<texcode>
% Context file for letterhead
\setuppapersize[letter][letter]
\setuplayout[height=9in,backspace=80pt,location=middle]
\setupbodyfont[serif,12pt] \setupwhitespace[big]
\setupcolors[state=start]
% Set up addressee here, From and Date
\define\Toperson{A. U. Thor}
\define\Totitle{Editor}
\define\Tocompany{Great \TeX\ Journal}
\define\Tostreet{P. O. Box 3.1415926}
\define\TocityStateZip{\TeX town, 67890-12345}
\define\Tocountry{USA}
\define\Fromperson{Ben Lee User}
\define\Mydate{\currentdate}
% End addressee, From and Date
\setupheader[state=none] \setupfooter[state=empty]
\setupfootertexts[{\ssx {\Mydate} --- {\em from}
{\Fromperson} {\em to} {\Toperson} --- page {\pagenumber}
of {\totalnumberofpages}}]
%\showframe
%\showboxes
%\showsetups
 
\starttext
% Heading
{\ssb Ben Lee User} \hfill {\ssx voice: (123) 456-7890}\crlf {\ssx P. O.
Box 2.718281} \hfill {\ssx fax: (123) 456-7891}\crlf
{\ssx Punktown, 12345-67890} \hfill {\ssx email: ben.lee.user@tex.edu}%
\textrule \blank[10*medium]
% Address
\Toperson\crlf \Totitle\crlf \Tocompany\crlf \Tostreet\crlf
\TocityStateZip%\crlf
%\Tocountry
\blank[8*medium] \textrule
% Letter
\hfill\Mydate \blank[2*big]
 
Dear Thor:
 
Here's a setup for a business or personal letter that produces a
letterhead and the addressee's information on the letter. This allows
the sender to use envelopes with windows to avoid separately addressing
envelopes. I usually print a dozen or so of these envelopes with my
return address in advance.
 
Vertical spacing of addresses and other features is controlled by the
\type{\blank[..]} command. I experiment with this depending on the
number of lines in the address or where I want to place horizontal
lines.
 
% Jump to a new page to see the footer
I'll jump to a new page to illustrate the footer for the second and
subsequent pages. \page
 
There is no footer on the first page and no page number. Many letters
are only one page long. But on those with two or more pages, it is
useful to have page numbers and other identifying information.
 
\blank[2*big]
 
Very truly yours,
 
[signature space]
 
\blank[4*big]
 
Ben Lee User
\stoptext
[[User:Thomas|Thomas]]
 
==Modern CV like cover letter==
 
This example is separated into 2 files : the environment file and a letter sample. Layout was made based on swiss standards for cover letters.
 
In the letter it is possible to specify the following options :
* full name of recipient (not to be provided if unknown)
* gender of recipient (not to be provided if full name wasn't given)
* if the sender address has to be put in an international format
 
Here is the letter sample :
<texcode>
% ENGLISH, TO MALE RECIPIENT
\mainlanguage[en]
\def\fullname{John Smith}
\def\gender{male}
 
% % FRENCH, TO FEMALE RECIPIENT
% \mainlanguage[fr]
% \def\fullname{Jeanne Petit}
% \def\gender{female}
 
% % ENGLISH, TO UNKNOWN RECIPIENT, INTERNATIONAL
% \mainlanguage[en]
% \define\international
 
\environment {cover-letter-env}
 
\starttext
 
\startletter[toaddress={Enterprise \\ Street \\ City \labeltext{date}},
subject={Application for the role of \quote{C++ embedded systems engineer} posted on Jobup}]
 
\setupindenting[yes,small]
 
I am an electronic engineer specialized on software development of embedded systems and your job offer caught my attention.
 
...
 
Thank you in advance for your time and consideration and blablabla. I look forward to hearing from you.
 
\stopletter
 
\stoptext
</texcode>
 
And, finally, here is the environment file :
<texcode>
\def\secondwordtmp#1 #2\relax{#2}
\def\secondword#1{\expandafter\secondwordtmp#1\relax}
 
\startenvironment cover_letter
 
\usemodule[letter]
\useletterstyle[swiss]
\usesymbols[mvs]
\setupsymbolset[martinvogel 2]
 
\def\lastname{\secondword{\fullname}}
 
\setuplabeltext [en] [greetings={\rightaligned{Yours sincerely,}}]
\setuplabeltext [fr] [greetings={}]
 
\doifdefinedelse {fullname}
{\def\to_name{\bold{\labeltext{\gender:title} \fullname{}}} % hack temp
\setuplabeltext [en] [male:title=Mr, female:title=Ms,
date={\blank[7mm]{\em \currentdate}}]
\setuplabeltext [en] [opening={{Dear \labeltext{\gender:title} \lastname{},}}]
\setuplabeltext [fr] [male:title=M., female:title=Mme,
male:longtitle=Monsieur, female:longtitle=Madame,
date={\blank[7mm]{\em Fribourg, le \currentdate}}]
\setuplabeltext [fr] [opening={{\labeltext{\gender:longtitle},}}]}
{\setuplabeltext [en] [HR={Human Resources}]
\setuplabeltext [fr] [HR={Ressources humaines}]
\def\to_name{\bold{\labeltext{HR}}}
\setuplabeltext [en] [opening={{Dear Hiring Manager,}}]
\setuplabeltext [fr] [opening={{Madame, Monsieur,}}]}
 
\def\CH{}
\setuplabeltext [country={}]
\doifdefined {international}
{\setuplabeltext [en] [country={{, Switzerland}}]
\setuplabeltext [fr] [country={{, Suisse}}]
\def\CH{CH-}}
 
\doif {\currentlanguage} {fr}
{\setcharacterspacing[frenchpunctuation]}
 
\setupbodyfont[sans, 12pt]
\setupwhitespace[big]
 
\setuplettersection
[reference,date,specialnotation,closing]
[leftmargin=.55\textwidth]
 
\setupletterlayer[head][alternative=left,
y=16mm,
style=slanted,
color=darkgray]
\setupletterlayer[backaddress][state=stop]
 
\setupletterlayer[address][preset=lefttop,
x=.7\textwidth]
 
\setupletterlayer[reference][y=7cm]
\setuplettertext[date=]
 
\setupletterlayout[firstpage][topspace=9.5cm]
 
\setupletterdescription[enclosure,postscript][headstyle=boldslanted]
\setuplettersection[appendices][style=slanted,color=darkgray,spacebefore={samepage,5*line}]
\setupletterstyle[fromname,toname][style=bold] % Bug : ne fonctionne pas pour toname !
\setuplettertext[postscript={\color[black]{PS: }}]
 
\setupletter
[fromname={My Name},
fromaddress={Street 1\\\CH{}1700 My-City\labeltext{country}},
fromphone={\symbol[Mobilefone] +41 98 765 43 21\\\symbol[Telephone] +41 12 345 67 89},
frommail={\symbol[Letter] my_email@address.com},
toname={\to_name{}},
opening={\labeltext{opening}},
date=,
closing={\labeltext{greetings}},
signature={\bold{My Name}}]
 
\stopenvironment
</texcode>
 
And here is the PDF document generated after compilation: [[File:modern-cv-cover-letter.pdf]].
 
Remark : there are still 1 or 2 hacks in the environment file, but I don't know how to make them better as I am not very experimented with ConTeXt, TeX and the use of the letter module.
 
Jonas Baggett
[[Category:Sample documents]]
6

edits

Navigation menu