Jump to navigation Jump to search
fix pragma links & typos
* Netherlands
* France
* AmericaUSA The predefined styles are loaded from external files with the {{cmd|useletterstyle}} command, in the past these files had names in the form <style>.nls. The name system has changed and personal styles have to follow the form “letter-<style>.tex”, you could also use “mkiv” and “mkii” as extensions. To load the style you need only the <style> part as argument for the command because the “letter-” part is always added. It doesn't matter if you use .tex or .mkiv as file extension because the file is found in either case.  == \startletter, \stopletter == The letter environment has only optional arguments which acts like a localversion of {{cmd|setupletter}} where the values are only used in the environment.When you use your document only for a single letter without anything elseyou can even drop {{cmd|starttext}} and {{cmd|stoptext}}, because this is handled by {{cmd|startletter}}and {{cmd|stopletter}}. == Setup == Previously there has been only the {{cmd|setupletterstyle}} command to change the values of the elements, now the various types of elements have dedicated commands. The “layers” (which are used for the “head”, “address” or “reference line”) are configured with {{cmd|setupletterlayer}} and {{cmd|setupletterframe}} command, the first is used to move the layer to its position on the page with the “x” and “y” keys and you can select one letter elements (which are created with {{cmd|defineletterelement}}) with the “alternative” key. With {{cmd|setupletterframe}} you can change the “width” and “height” of the element. Thus, for example, the following will produce a small, sans serif header, 10pt from the bottom of the page and centered.  <texcode>\defineletterelement[layer][foot][example]% {This is my footer.}\setupletterlayer[foot][alternative=example,style=\tfx\sans,y=10pt] \setupletterframe[foot][align=middle]</texcode>  The “sections” (which are used for the “subject” and “content”) are configured with {{cmd|setuplettersection}} which allows you to change the alignment and spacing before and after the element. Global settings like the bodyfont, whitespace or language can be changed with {{cmd|setuplettersoptions}}. The old {{cmd|setupletterstyle}} command had been reduced to change the style and color for the variables which are set with {{cmd|setupletter}} (or {{cmd|startletter}}), e.g. you can say <tt>\setupletter[date][textstyle=bold,color=red]</tt> to change the layout of the date in the reference line. A complete list with all values for the various commands can be seen in the following document: [ commands.pdf] === List of Layers and Sections === These layers are defined and configurable:* head, nexthead, lefthead, righthead* foot, nextfoot, rightfoot, leftfoot* address, backaddress* reference, location* topmark, botmark, cutmark, endmark, usermark* lettermain, letternext These sections are defined and configurable:* '''(default)''' title, subject, opening, content, closing, appendices* '''(block style layouts)''' head, date, reference, specialnotation, address === Changing the order of elements === The order of elements can be changed using {{cmd|setupletterelements}}. For example, to place the subject after the opening (as is standard in Britain), use the following:  \setupletterelements [section] [title, opening, subject, content, closing, appendices]  === \defineletterelement === One limitation of the old module was that element names had been shared between layers and section (i.e. it was impossible to have a layer and a section with the same name). This limitation was removed and it’s now possible to layers and sections with the same name but to handle this the {{cmd|defineletterlement}} command needed a additional argument. The syntax for the command is now  \defineletterelement[<type>][<element>][<name>]{<content>} As an example I show a definition for the head with the name “test” which prints the value of the “firstname” key.  \defineletterelement[layer][head][test]{\correspondenceparameter{firstname}} The old <tt>\copyletterelement</tt> command is no longer available. === \startsetups === The old version used <tt>\startsetups</tt> for the content of the elements. With the current version all internals use now {{cmd|letterelement}} but there is a method to feed them with the {{cmd|startsetups}} argument, all you need is <tt>\setupletteroptions[option=setups]</tt> in your document. Nevertheless also the names for {{cmd|startsetups}} have been changed to follow the unique named mentioned above and the old name “letter:location” is now “letter:layer:location”. === Layout === The layout of the letter environment can be changed with {{cmd|setupletterlayout}}, it is possible to use a different layout for the first (<tt>firstpage</tt>) and the following (<tt>secondpage</tt>) pages, but starting from the second page one can also set different value for left (<tt>leftpage</tt>) and right (<tt>rightpage</tt>) pages. === Variables/Labels === There is only one way to set values for the letter variables, this is {{cmd|setupletter}}with it’s keyval syntax, e.g. <tt>\setupletter[name=…,address=…]</tt>.(<tt>\setlettervalue</tt> from the previous version is gone and won’t come back.) To change the labels in the reference line for the “Date” string, you haveto use {{cmd|setuplettertext}}, a special version of {{cmd|setuplabeltext}} onlyfor the letter module.
== Features ==
It is possible to change the default input method to the one use used by HansHagen in the m-letter module or Donald Knuths Knuth’s letter style in the TeXbook. 
== Further Information ==
* httphttps://wolfgangbitbucket.schuster.googlepages.comorg/wolfs/correspondence/letter
The manual for the module was included in some versions of the package and is available from:
== Examples ==
=== List of enclosures/attachments ===
symbol=bullet, % or "none"
\input knuth
=== Hraban’s complicated logo and address setup ===
Same as in [[Invoice]] sample.
\setuplanguage [nl] [date={year, –, mm, –, dd}] % ISO 8601 date
\setupbodyfont [rm, 10pt]
\setupinterlinespace[3.0ex] % default: 2.8ex
\setbreakpoints[compound] % break at / and -
whitespace=1.5ex, %3ex
% Sender address in envelope window
backaddress={Pragma ADE · H.\,Hagen · Riderstraat 27 · NL-8061 GH Hasselt}
% Define logo for the first page
% Other logo for subsequent (right) pages
% We put our logo in the head
name={Hans Hagen},
street={Ridderstraat 27},
city={NL-8061 GH Hasselt},
phone={+31 (0)38 477\,53\,69},
mobile={+31 (0)38 477\,53\,69},
% center around the :
\NC person \NC\correspondenceparameter{name} \NC\NR
\NC location \NC\correspondenceparameter{street}\\\correspondenceparameter{city}\NC\NR
\NC phone \NC\correspondenceparameter{phone}\\\correspondenceparameter{mobile} \NC\NR
\NC internet \NC\correspondenceparameter{email}\\\correspondenceparameter{web} \NC\NR
\NC skype \NC\correspondenceparameter{skype} \NC\NR
% Our own recipient setup without too much space before the address
% Subject and date on the same line, date below logo
%\bTD{\tf 2012-12-12}\eTD
% account information at the foot, below the logo
\NC financial \NC \NC\NR
\NC tax no. \NC 1234567890 \NC\NR
\NC UStID \NC NL\,123\,456\,789 \NC\NR
\NC Account \NC 123\,456\,890\\Context bank, BIC NLPRCOHA \NC\NR
\NC IBAN \NC NL12\,345\,678\,908\,12 \NC\NR
% switch off reference line
% Move the text a bit up
% Adjust text start on subsequent pages
% Move marks to the paper rim (won't print on most printers)
toname={MIT\\Prof. Donald Knuth},
toaddress={13, Anywhere Outthere\\Utopia, MA\\USA},
subject={Regression in latest release of i\TEX}]
\input knuth
Best regards,
Hans Hagen
The manual for module is included in newer versions of the package or available from:
* http[[Category://]]* http[[Category://]][[Category:Layout]][[Category:Sample documents]][[Category:Modules]]

Navigation menu