ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Henning Hraban Ramm <hraban@fiee.net>
Subject: Re: Problem with letter module
Date: Mon, 6 Feb 2012 12:40:53 +0100	[thread overview]
Message-ID: <229FB39E-E4D1-4EDC-8E43-4E4D212DAB7E@googlemail.com> (raw)
In-Reply-To: <9D5A94D1-B97A-45F3-98AC-A1FC37FAA602@fiee.net>


Am 06.02.2012 um 00:05 schrieb Henning Hraban Ramm:

> Am 2012-01-19 um 00:21 schrieb Wolfgang Schuster:
> 
>> There isn’t a new documentation yet but I’ll give a short overview.
> ...
> 
> Since my letter/invoice setup doesn’t work anymore (and perhaps you remember it was a tricky one) - can we expect some docs anytime soon?

I'll write one when I’m in the right mood.

For a few changes read the following I posted a while ago: http://www.ntg.nl/pipermail/ntg-context/2012/064695.html

> E.g. \copyletterelement is gone, and I guess my "\startsetups letter:location" and \defineletterelement doesn’t do anything, or any of the other setup commands, at least my logo and sender data don’t show up…

I made few changes in the recent version of the module which breaks backward compatibility with old styles.

1. External styles

The predefined styles are loaded from external files with the \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.

2. Setup commands

Previously there has been only the \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 the \setupletterlayer and \setupletterframe command, the first is used to move the layer to it’s position on the page with the “x” and “y” keys and you can select one letter elements (which are created with \defineletterelement) with the “alternative” key. With the \setupletterframe you can change the “width” and “height” of the element.

The “sections” (which are used for the “subject” and “content”) are configured with the \setuplettersection command 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 the \setuplettersoptions command.

The old \setupletterstyle command had been reduced to change the style and color for the variables which are set with \setupletter (or \startletter), e.g. you can say \setupletter[date][textstyle=bold,color=red] 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: https://bitbucket.org/wolfs/correspondence/downloads/commands.pdf

3. \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 ti handle this the \defineletterlement command needed a additional argument. The syntax for the command is now

   \defineletterelement[<type>][<element>][<name>]{<content>}

As a 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 \copyletterelement command is no longer available, when you miss a few default just send me a mail and I’ll add them.

4. \startsetups

The old version used \startsetups for the content of the elements. With the current version all internals use now \letterelement but there is a method to feed them with the \startsetups argument, all you need is \setupletteroptions[option=setups] in your document. Nevertheless also the names for \startsetups have been changed to follow the unique named mentioned above and the old name “letter:location” is now “letter:layer:location”.

5. Layout

The layout of the letter environment can be changed with the \setupletterlayout command, it is possible to use a different layout for the first (firstpage) and the following (secondpage) pages but starting from the second page one can also set different value for left (leftpage) and right (rightpage) pages.

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2012-02-06 11:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 20:14 Romain Diss
2012-01-18 23:21 ` Wolfgang Schuster
2012-01-19 14:28   ` Romain Diss
2012-01-19 19:52     ` Wolfgang Schuster
2012-01-19 22:06       ` Romain Diss
2012-01-19 22:24         ` Wolfgang Schuster
2012-01-19 22:57           ` Romain Diss
2012-01-19 23:05             ` Wolfgang Schuster
2012-01-19 23:20               ` Romain Diss
2012-01-19 23:59                 ` Wolfgang Schuster
2012-01-20 21:44                   ` Romain Diss
2012-01-21  0:16                     ` Hans Hagen
2012-01-21  9:12                     ` Wolfgang Schuster
2012-01-19 14:28   ` Romain Diss
2012-01-19 22:08     ` Wolfgang Schuster
2012-02-05 23:05   ` Henning Hraban Ramm
2012-02-06 11:40     ` Wolfgang Schuster [this message]
     [not found] <mailman.1854.1326987164.4232.ntg-context@ntg.nl>
2012-01-19 17:47 ` Michael Green
2012-01-19 20:12   ` Romain Diss
  -- strict thread matches above, loose matches on Subject: below --
2011-09-19  8:41 problem " Henning Hraban Ramm
2011-09-19 10:35 ` Hans Hagen
2011-09-19 12:13   ` Henning Hraban Ramm
2011-09-19 20:02     ` Wolfgang Schuster
2011-09-19 21:34       ` Henning Hraban Ramm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=229FB39E-E4D1-4EDC-8E43-4E4D212DAB7E@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=hraban@fiee.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).