Changes

Jump to navigation Jump to search
5,304 bytes added ,  08:43, 11 March 2006
no edit summary
\stopmode
</texcode>
 
==Another Approach==
 
Here is an alternative to the approach suggested by Holger. My university introduced a new official letterhead some months ago, and I was quite impressed to see that they even provided a LaTeX class for it. Of course, there was no ConTeXt support, so I decided to do it myself. My aim was merely to copy the official style, so my approach is far less fancy than the one before: you get a letter with a logo in the upper right corner, fields for information about the sender (assuming that the sender sits in a department of a university), and commands for the parts of a typical letter.
 
Instructions: copy the code below into a file, modify the generic information provided there to your needs, and save this file somewhere where ConTeXt can find it (the canonical place would be $HOMETEXMF/tex/context/third) as t-letterhead.tex. See below for usage instructions.
 
<texcode>
\protect
 
\setuppapersize[A4][A4] % or [letter][letter]; in that case, you'll have to fidget with the dimensions
 
\setuplayout[header=0mm,topspace=20mm,backspace=22mm,footer=0mm,width=160mm] % margins etc.
 
\enableregime[utf] % or whatever you prefer
 
\setupcolors[state=start] % in case you want any colored output
 
\mainlanguage[en] % or whatever you prefer
 
\setupbodyfont[modern,8pt] % this is the small bodyfont for the letterhead; we'll change to a bigger size for the actual letter later
 
\setuptabulate[before={\blank[0pt]},after={\blank[0pt]}] % there's a tabular, and I don't want any blank lines around it
 
\setuppagenumbering[state=stop]
 
\definelayer[myletter][x=1mm,y=1mm,width=\paperwidth,height=22mm] % The elements of the letterhead are defined as layers. This first layer contains the logo; you'll have to
\setlayer[myletter][x=104mm,y=11mm]{\externalfigure[Logo][width=56mm,height=20mm]} % supplyan image file yourself.
 
\definelayer[myuni][x=1mm,y=1mm,width=\paperwidth,height=24mm] % Second layer: Small column, right-aligned, with name of university and your name, in a narrow column
\setlayer[myuni][x=110.5mm,y=42mm]{\framed[width=50mm,height=22mm,frame=off]{\lbox to % below the logo.
35mm{\ss Name\\ of My University \\ (My Town) \\
\blank[line] \\ {\bf My Name} \\ Supreme Headmaster}}}
 
\definelayer[dept][x=1mm,y=1mm,width=\paperwidth,height=24mm] % Third layer, left-aligned, opposite layer 2. This column contains you contact information and the date.
\setlayer[dept][x=163mm,y=42mm]{\framed[width=40mm,height=22mm,frame=off]{\rbox
to 35mm{\ss Faculty of \\ Arts and Sciences \\
\blank[2*line] \\ Department of \\ High Energe Metaphysics\\
\blank[2*line]\\ 33 Main Street \\ Capital, DC 12345 \\ \starttabulate[|lw(4mm)|lw(36mm)|]
\NC Tel.: \NC (123) 456-7890 \NC\NR \NC Fax.: \NC (098) 7654-321 \NC\NR
\stoptabulate \\ Administrator: Highly Efficient \\
\starttabulate[|lw(4mm)|lw(36mm)|] \NC Tel.: \NC (012) 345-6789 \NC\NR
\stoptabulate \\ mymail@myaddress\\ www.my.website.edu \\ \blank[2*line]\\ Mytown,
\currentdate}}}
 
\definelayer[send][x=0mm,y=1mm,width=\paperwidth,height=15mm] % Fourth layer: one line, in fine print, that contains a short sender address; will be on top of the
\setlayer[send][x=9.4mm,y=44mm]{\framed[width=100mm,height=13mm,frame=off]{\ss % envelope's window.
\vii {\bf My University} $\cdot$ My Name $\cdot$
Dept. of Metaphysics $\cdot$ Capital, DC 12345}}
 
\setupblackrules[width=7mm, height=0.1mm]
 
\definelayer[foldingmarkslayer][state=repeat] % Fifth layer: the folding marks; this code is copied from Hraban's suggestion.
\setlayer[foldingmarkslayer][y=107mm, x=-1mm]{\blackrule}
\setlayer[foldingmarkslayer][y=148.5mm, x=-1mm]{\blackrule[width=10mm]}
\setlayer[foldingmarkslayer][y=202mm, x=-1mm]{\blackrule}
 
\setupbackgrounds [page][background={foldingmarkslayer,myletter,myuni,dept,send}] % Make all layers active for page.
 
\long\def\addressee#1{\strut\blank[23*medium]\switchtobodyfont[11pt]\setupwhitespace[none]#1} % Defines field for receiver's address and places it at right position.
 
\long\def\lettersubject#1{\blank[3*line]{\bf Re: #1}} % Subject line, in bold face.
 
\long\def\letteropening#1{\blank[line]#1} % opening...
 
\long\def\letterbody#1{\blank[line]\setupwhitespace[medium]#1} % the main body
 
\long\def\letterclosing#1{\blank[line]#1\blank[3*line]} % and the closing formula
 
\setupalign[right] % I prefer letters with a ragged right, but you don't have to...
 
\ss % I want the sans font for the entire letter, but of course you can change to \tt or \rm, if you want
 
\unprotect
 
</texcode>
 
Here's an example how this module can be used:
 
<texcode>
\usemodule[t-letterhead]
 
\starttext
 
\addressee{Prof.\crlf
Heinrich Seltsam\crlf
Dept. of Physics\crlf
University of Southern Wyoming \crlf
123 Einstein Str.\crlf
Scumbag, WY 76543}
 
\lettersubject{My New Letterstyle}
 
\letteropening{Estimated Colleague,}
 
\letterbody{\dorecurse{6}{\input tufte\par}}
 
\letterclosing{Sincerely Yours}
 
Larry
 
\stoptext
</texcode>
 
Any feedback welcome. I'm not sure if the \long\defs for the several parts of the letters are very elegant and would be grateful if some of the moew knowledgeable folks could suggest something better. But overall, I like the simplicity of this style.
 
Thanks to all those who contributed the original suggestions, they have been a great inspiration!
 
[[User:Thomas|Thomas]]
 
[[Category:Sample documents]]
gardener
112

edits

Navigation menu