Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-21 Thread Wolfgang Schuster
On Sat, Apr 19, 2008 at 6:35 PM, Wolfgang Werners-Lucchini
[EMAIL PROTECTED] wrote:
 On 19 Apr 2008 at 14:41, [EMAIL PROTECTED] wrote:

   I still use the LaTeX class scrlttr2 for my letters.
   I use adress files bundled with that class. Adresses are macros
   and selected by a string-key.
 
  I know the \adrentry for scrlltr and could add this function but
  not at the moment and only as letter extension.
 
   Maybe it would be nice, if there could be a interface to such a key
   and a lua-function (which defaults to return) taking this key as
   argument. So everybody can write his own adress-import function.
 
  You should also take a look into Hans correspondence [1] manual,
  I prefer to make something based on a xml database on it is possible
  to write serial letters as told in the manual bot not to use some
  information for just one letter.
 
  I will add it on my todo list.

 The idea was NOT to use THIS or THAT adress format.
 Instead implementing something like a generic import interface.

Hi Wolfgang,

I took a look into the default definition for \adrentry and it simple
to add it to the module, a interface for different formats would be
indeed the optimum but I should first finish the interface.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-21 Thread Wolfgang Schuster
On Sat, Apr 19, 2008 at 1:49 PM, Antoine Junod [EMAIL PROTECTED] wrote:
 Wolfgang Schuster [EMAIL PROTECTED] writes:

 The discussion

 Before I start to give you information about my module and
 give you the chance to mention your own wishes or thoughts
 about the inteface I'm interested what do you use currently to
 write you own correspondence (letter, invoices etc.).
 
  [...]
 
  But with a « great letter module » (with french positions, of course :))…
 
  Show me a few example or give me values for the positions (address block,
  opening, line distance etc.)

 I use myself the lettre (and not letter :) package [1] for LaTeX. It
 is easy to use, clean but maybe a bit old in the way to do things
 (mainly because of the 'Concerne' stuff). But it gives a good example
 of how have to be letters in Suisse Romande and France.

 [1] http://www.ctan.org/tex-archive/help/Catalogue/entries/lettre.html

Hi Antoine,

I will made a still based on the examples in the manual.

I have to add also french labels for the reference line.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-21 Thread Antoine Junod
Wolfgang Schuster [EMAIL PROTECTED] writes:

 On Sat, Apr 19, 2008 at 1:49 PM, Antoine Junod [EMAIL PROTECTED] wrote:
 Wolfgang Schuster [EMAIL PROTECTED] writes:

 The discussion

 Before I start to give you information about my module and
 give you the chance to mention your own wishes or thoughts
 about the inteface I'm interested what do you use currently to
 write you own correspondence (letter, invoices etc.).
 
  [...]
 
  But with a « great letter module » (with french positions, of course :))…
 
  Show me a few example or give me values for the positions (address block,
  opening, line distance etc.)

 I use myself the lettre (and not letter :) package [1] for LaTeX. It
 is easy to use, clean but maybe a bit old in the way to do things
 (mainly because of the 'Concerne' stuff). But it gives a good example
 of how have to be letters in Suisse Romande and France.

 [1] http://www.ctan.org/tex-archive/help/Catalogue/entries/lettre.html

 Hi Antoine,

 I will made a still based on the examples in the manual.

Thanks you chief :)

A+
-AJ
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-19 Thread Wolfgang Schuster
Hi Willi,

 I will try to provide you with something. The difficulty is, that I
 do not have LaTeX running. So please some patience.

You could also draw something by hand and add values for
the distance from the top or left margin and the height and
width for the fields.

Take a look at the following examples:

http://www.din-5008-richtlinien.de/musterbriefboegen.php

Link: englische Version on page 180
http://www.komascript.de/scrdoc/

You could use both examples as template and I dont need
so many values.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-19 Thread Wolfgang Schuster
On Fri, Apr 18, 2008 at 8:40 PM, Wolfgang Werners-Lucchini
[EMAIL PROTECTED] wrote:
 On 18 Apr 2008 at 12:00, [EMAIL PROTECTED] wrote:

 Hallo Wolfgang,

  I still wait for comments about the user interface to set the
  values before I will release my module to the public although my last
  stable version is only available.

 I still use the LaTeX class scrlttr2 for my letters.
 I use adress files bundled with that class. Adresses are macros and
 selected by a string-key.

I know the \adrentry for scrlltr and could add this function but not
at the moment and only as letter extension.

 Maybe it would be nice, if there could be a interface to such a key
 and a lua-function (which defaults to return) taking this key as
 argument. So everybody can write his own adress-import function.

You should also take a look into Hans correspondence [1] manual,
I prefer to make something based on a xml database on it is possible
to write serial letters as told in the manual bot not to use some
information for just one letter.

I will add it on my todo list.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-19 Thread Antoine Junod
Wolfgang Schuster [EMAIL PROTECTED] writes:

The discussion
   
Before I start to give you information about my module and
give you the chance to mention your own wishes or thoughts
about the inteface I'm interested what do you use currently to
write you own correspondence (letter, invoices etc.).

 [...]

 But with a « great letter module » (with french positions, of course :))…

 Show me a few example or give me values for the positions (address block,
 opening, line distance etc.)

I use myself the lettre (and not letter :) package [1] for LaTeX. It
is easy to use, clean but maybe a bit old in the way to do things
(mainly because of the 'Concerne' stuff). But it gives a good example
of how have to be letters in Suisse Romande and France.

My 2 cents worth,
A+
-AJ

[1] http://www.ctan.org/tex-archive/help/Catalogue/entries/lettre.html
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Wolfgang Schuster
On Thu, Apr 17, 2008 at 5:34 PM, Henning Hraban Ramm [EMAIL PROTECTED] wrote:
 Am 2008-04-17 um 17:08 schrieb Wolfgang Schuster:
  You need a closing (Sincerely,) and signature, and don't forget
  enough
  topspace to accommodate a company logo/letterhead :-)
 
  You set closing and signature also with the optional argument for
  \startletter
 
  \startletter
[opening=Dear Idris\textcomma,
 closing=Sincerely\textcomma,
 signature=Wolfgang Schuster]

 Would you support an externalfigure for the signature?

 e.g.

 Yours,
 [my fancy signature graphics]
 Henning Hraban Ramm

You could write

\setupletter
  [data]
  [signature={\externalfigure[my_fancy_signature][height=2\lineheight]}]

Greetings
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Peter Münster
On Fri, Apr 18 2008, Wolfgang Schuster wrote:

  Then, for some reason that I forgot, I switched to scrlttr2.cls. And I
  patched it to get the same minimum-50%-feature. Unfortunately, this patch is
  no more working with recent versions of scrlttr2...
  (- http://pmrb.free.fr/work/OS/LaTeX/lettre.lco )
 
  I would welcome such a feature in your module!
 
 I dont't have such a feature in the module I find it interesting.
 
 Page breaks before the signature can still happen at the moment
 because I hadn't done anything against this problem but it is on
 my Todo list.

I don't know, if lettre.lco is readable for you, so here the idea in
clear-text:
- some vertical spaces (for example around the opening, between paragraphs,
  around the subject line, etc) can be decreased or increased by a global
  stretch-value (called tension in my file)
- at the first texexec run, this value has to be reset to 0
- if the last page gets filled to 50%, then trigger a next texexec-run,
  with a decremented stretch-value for a filling 25% and an incremented
  value for a filling 25%, until the last page is filled to 50%.

I think, there is already a command like \savetwopassdata or similar, so it
should be easy with ConTeXt. If you want, I can try to integrate this
feature after your public release.

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Wolfgang Schuster
On Fri, Apr 18, 2008 at 8:51 AM, Peter Münster [EMAIL PROTECTED] wrote:
 On Fri, Apr 18 2008, Wolfgang Schuster wrote:

   Then, for some reason that I forgot, I switched to scrlttr2.cls. And I
   patched it to get the same minimum-50%-feature. Unfortunately, this patch 
   is
   no more working with recent versions of scrlttr2...
   (- http://pmrb.free.fr/work/OS/LaTeX/lettre.lco )
  
   I would welcome such a feature in your module!
 
  I dont't have such a feature in the module I find it interesting.
 
  Page breaks before the signature can still happen at the moment
  because I hadn't done anything against this problem but it is on
  my Todo list.

 I don't know, if lettre.lco is readable for you, so here the idea in
 clear-text:

I will try it later today on my system, can you send me a example letter
before I had to take a look into scrguide.pdf.

 - some vertical spaces (for example around the opening, between paragraphs,
  around the subject line, etc) can be decreased or increased by a global
  stretch-value (called tension in my file)
 - at the first texexec run, this value has to be reset to 0
 - if the last page gets filled to 50%, then trigger a next texexec-run,
  with a decremented stretch-value for a filling 25% and an incremented
  value for a filling 25%, until the last page is filled to 50%.

Sounds interesting.

 I think, there is already a command like \savetwopassdata or similar, so it
 should be easy with ConTeXt. If you want, I can try to integrate this
 feature after your public release.

Hans posted at the end of 2007 (or begin 2008) a example to optimize the
output and will try to integrate it.

The feature can be enable with \setupletterstyle[optimize=yes] or a similar
key name.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Wolfgang Schuster
On Thu, Apr 17, 2008 at 5:32 PM, Henning Hraban Ramm [EMAIL PROTECTED] wrote:
 Am 2008-04-17 um 16:32 schrieb Wolfgang Schuster:
  I normally use InDesign for my business letters and invoices.
  Dou you use a template for your letters.

 Not an InDesign template file (.idt), but a single document (with
 master pages) for every purpose (German/Swiss/English, letter/
 invoice, private/business) that I overwrite every time. (I save a
 copy if the matter is important.)

  LaTeX has two packages to create invoices and we could also
  have one for ConTeXt but it makes only sense to use it with LuaTeX,
  TeX's arithmetic to limited for longer calculations.

 For other purposes I simply write my TeX code with a script, mostly
 only one file that contains the dynamical data and gets included.

 E.g.
 - cover for backup CD/DVDs (that script even has a GUI - it reads a
 disk; shows the directory tree, so you can select which parts you'd
 like to be visible; writes a TeX file; calls ConTeXt and opens the PDF)

 - my address book (pulls and formats data from a MySQL database)

 - business cards for one big company (I receive an Excel file with
 personnel data, save it as CSV and convert that to ConTeXt, PDF
 with one page per person gets imposed and printed on cardboard with
 pre-printed logo)

  Another problem were different letter heads for first, odd and even
  pages.
 
  Different header for the first and another one for the following
  headers
  is simple and possible with my module. The option to change the layout
  for odd and even pages is currently not supported but should be
  possible but it has to be integrated in the normal interface.

 My sheets have a pre-printed logo, I use the same for all pages of a
 letter.

 On the first page I need address and bank data.

Easy to do with layers,option state=start.

 On even pages (back side) there's no logo, so I don't need the big
 top border.

Harder to implement because I hide the layers from the user and
I don't know hoe I could support the doublesided option but it is
possible to one special layers (lefthead/righthead) for just this feature.

 Normally I leave out the first even page, e.g. my job application
 starts with an one-side letter, the following data (CV, references
 etc.) uses front and back page.

Different layouts for left and right pages are not supported because
letters are normally printed singlesided or the header has only on
the first page a different layout but this could be related to the
restrictions in Word why I newver saw this.

CV's are another topic and it makes sense to use a seperate
environment for them, this is what I did for myself.

 The application had the additional difficulty that there's the photo
 on the CV page, and I wanted the title in white *on* the photo...

I don't get what you mean, can you give me a example.

 At least in the online PDF - I used modes to produce both printed
 version (without logo, because that's pre-printed on my sheets) and
 email version (with logo)

\startmode[print]

\setupletterstyle[header=no]

\stopmode

  (It would have been *much* easier to use InDesign for that stuff,
  like for most other designs that I do...)
 
  This is also possible with ConTeXt because you could setup layers
  to place content dependent on left and right pages and the page layout
  could also change for left and right pages as long as you don't change
  the text width.

 I used layers and setups, but I had difficulties switching them on
 and off. And what not - can't remember everything.

A few things are easy and I can do basic things without any manuals but
advanced layouts are only possible with the source and trial and error.

It is even harder to place layers if you want to fix them on lines in grid mode
in the text with frames a content for the layer.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Willi Egger
Hi Wolfgang,

First of all thanks for this initiative! - Until now I composed a  
letter based on a template I build one day. Nothing special though.  
- Still a module which would allow for writing letters and quotes  
consistently  would make live easier.
As I am living in the Netherlands, we use commonly block-style  
letters. Will your module provide the possibility to use a header on  
the first page and e.g. a smaller something in the margin on the  
second and following pages? Will your module provide page-numbering  
switched on beginning at the second page if the document is longer  
than 1 page? - This last point is in my environment always a struggle...

The Dutch TeX users group has released on CTAN a ntgclass.zip  
(LaTeX). There are three articles which might help to enlighten  
you. Unfortunately two of the three articles are written in Dutch  
(briefdoc.pdf, brief.pdf). In case you intend to include ideas  
contained in this NEN-1026 style letter I am happy to help you  
translating the important parts of those articles.

I am looking forward to your module

Kind regards

Willi

On Apr 17, 2008, at 10:13 AM, Wolfgang Schuster wrote:

 Hi all,


 Preface


 most of the discussions in the last weeks on the list
 concerned LuaTeX and MkIV with the topic fonts, xml and bugs,
 currently not implemented functions and bug and in the last
 few days also mplib. I will try start with this mail a
 hopefully interesting discuassions wuth many people about the
 current state to use ConTeXt for correspondence in personal
 and business live.



 Introduction


 Although ConTeXt has many features and can be used for nearly
 every type of document with many features to adapt the layout
 to ones personal requirements we have still a few places where
 something is missing or force us to use another tool. I will
 focus myself for the moment on the missing support for a real
 module to write letter and other correspondence.



 The Past and the present


 A few modules had been written in the past to write letter but
 wether they are not available like Hans own module or it is to
 complicated to use.

 Hans own module m-letter.tex was never included in the main
 distribution and the documentation [1] was never finished but
 it is now possible to find a older version in the list
 archives. The strong point on the module are the possibility
 to change the size and position of the address and reference
 fields but it was nearly impossible to add extra information
 like values for sender or to make big changes in the layout.

 The second option to write a letter was and is Holger Schöners
 letterstyle environment [2], he provided a layout for german
 letters with a DIN style and macros to store address and
 sender information. What looked like a good solution to me at
 first glance had also many disadvatages, the names for the
 fields in the refrence line used hard to memorize name like
 \lettersenderkey... and no high level interface to set them.
 Another point to me which prevented me from using the style
 was the hard way to change the layout, the environment
 provided commands to change the values but all was done with
 simple definition and no setup command.

 A few user write their own simple setups and environemnts to
 write letter [2,3] but none of them was really confugrable or
 provided a real interface.



 The future


 The lack of any good soution for this topic forced me to write
 my own letter module for ConTeXt. I started myself with Hans
 letter module and added a extra field to add my own address
 but this was at a time where I was still new to ConTeXt and
 most of the content in m-letter.tex where confusing to me and
 I had problem to adapt the layout to my own requirements.
 After I gained a little bit more knowledge in TeX and ConTeXt
 is started to write a new module from scratch with the option
 to load style files and set the information for the address
 and all other information with a better interface.

 After nearly one and a helf years and 2 major revisions I have
 nearly finished my module and would will make it now available
 also to other users. But before I make my last stable version
 online I want to discuss a few points with interested users.



 The discussion


 Before I start to give you information about my module and
 give you the chance to mention your own wishes or thoughts
 about the inteface I'm interested what do you use currently to
 write you own correspondence (letter, invoices etc.).

 After this interesting question for me I will now make a few
 information about my module available.

 The module use by default the definition for german business
 letters as layout where the position for the address block and
 the reference line are defined. To change the layout for your
 own letter I provide the option to change the default settings
 with the one for all command \setupletterstyle, you could use
 it to set the page layout, the position for the different
 blocks for 

Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Peter Münster
On Fri, Apr 18 2008, Wolfgang Schuster wrote:

  I don't know, if lettre.lco is readable for you, so here the idea in
  clear-text:
 
 I will try it later today on my system, can you send me a example letter
 before I had to take a look into scrguide.pdf.

I'm sorry, it would be too much work for me, to find the right version of
scrlttr2.cls, that works with my lettre.lco. The file is 5 years old, and I
know that it's no more working for quite some time now.

Nevertheless, here an example, that should work with some old KOMA-version:

\documentclass[lettre]{scrlttr2}
\begin{document}
\begin{letter}{Madame Bla\\Bla bla\\160 rue bla\\72031 Le Mans Cedex 9}
\opening{Madame Bla,}%
\input tufte
\closing{Cordialement,}
\end{letter}
\end{document}

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Wolfgang Schuster
On Fri, Apr 18, 2008 at 9:50 AM, Willi Egger [EMAIL PROTECTED] wrote:
 Hi Wolfgang,

 First of all thanks for this initiative! - Until now I composed a
 letter based on a template I build one day. Nothing special though.

I started also with mayn hard coded values and only a few parameters
and replaced part by part.

 - Still a module which would allow for writing letters and quotes
 consistently  would make live easier.
 As I am living in the Netherlands, we use commonly block-style
 letters. Will your module provide the possibility to use a header on
 the first page and e.g. a smaller something in the margin on the
 second and following pages? Will your module provide page-numbering
 switched on beginning at the second page if the document is longer
 than 1 page? - This last point is in my environment always a struggle...

Very easy to do with ConTeXt because you could define different
layouts for every page and what I do is to set the headerheight for the
first page to 0pt and set it to another value like 1cm on the second
page. You could now write the pagenumber as headertext because there
is no header on the first page and the pagenumber will start on the
second page.

 The Dutch TeX users group has released on CTAN a ntgclass.zip
 (LaTeX). There are three articles which might help to enlighten
 you. Unfortunately two of the three articles are written in Dutch
 (briefdoc.pdf, brief.pdf). In case you intend to include ideas
 contained in this NEN-1026 style letter I am happy to help you
 translating the important parts of those articles.

Can you show me a few example letters with values for all fields,
I saw a few in Hans letter documentation [1] and the works depends
on one point, is the height and position for the reference and address
block fixed or did it depend on the content.

If the fields have a fixed height it is easy to write a style file but if the
height depends on the content a need a little bit more time and I will
implement it in a proper way, I have this problem also with american
block style and a solution should be integrated in a consistent way
with the rest of the module.

 I am looking forward to your module

I still wait for comments about the user interface to set the values
before I will release my module to the public although my last stable
version is only available.

Greetings
Wolfgang

[1] http://www.pragma-ade.com/show-man-29.htm
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Wolfgang Werners-Lucchini
On 18 Apr 2008 at 12:00, [EMAIL PROTECTED] wrote:

Hallo Wolfgang,

 I still wait for comments about the user interface to set the
 values before I will release my module to the public although my last
 stable version is only available.

I still use the LaTeX class scrlttr2 for my letters.
I use adress files bundled with that class. Adresses are macros and 
selected by a string-key.

Maybe it would be nice, if there could be a interface to such a key 
and a lua-function (which defaults to return) taking this key as 
argument. So everybody can write his own adress-import function.

Just an idea.

Grusz, 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-18 Thread Willi Egger
Hi Wolfgang,

I will try to provide you with something. The difficulty is, that I  
do not have LaTeX running. So please some patience.

Kind regards

Willi


On Apr 18, 2008, at 10:13 AM, Wolfgang Schuster wrote:

 Can you show me a few example letters with values for all fields,
 I saw a few in Hans letter documentation [1]

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Wolfgang Schuster
Hi all,


Preface


most of the discussions in the last weeks on the list
concerned LuaTeX and MkIV with the topic fonts, xml and bugs,
currently not implemented functions and bug and in the last
few days also mplib. I will try start with this mail a
hopefully interesting discuassions wuth many people about the
current state to use ConTeXt for correspondence in personal
and business live.



Introduction


Although ConTeXt has many features and can be used for nearly
every type of document with many features to adapt the layout
to ones personal requirements we have still a few places where
something is missing or force us to use another tool. I will
focus myself for the moment on the missing support for a real
module to write letter and other correspondence.



The Past and the present


A few modules had been written in the past to write letter but
wether they are not available like Hans own module or it is to
complicated to use.

Hans own module m-letter.tex was never included in the main
distribution and the documentation [1] was never finished but
it is now possible to find a older version in the list
archives. The strong point on the module are the possibility
to change the size and position of the address and reference
fields but it was nearly impossible to add extra information
like values for sender or to make big changes in the layout.

The second option to write a letter was and is Holger Schöners
letterstyle environment [2], he provided a layout for german
letters with a DIN style and macros to store address and
sender information. What looked like a good solution to me at
first glance had also many disadvatages, the names for the
fields in the refrence line used hard to memorize name like
\lettersenderkey... and no high level interface to set them.
Another point to me which prevented me from using the style
was the hard way to change the layout, the environment
provided commands to change the values but all was done with
simple definition and no setup command.

A few user write their own simple setups and environemnts to
write letter [2,3] but none of them was really confugrable or
provided a real interface.



The future


The lack of any good soution for this topic forced me to write
my own letter module for ConTeXt. I started myself with Hans
letter module and added a extra field to add my own address
but this was at a time where I was still new to ConTeXt and
most of the content in m-letter.tex where confusing to me and
I had problem to adapt the layout to my own requirements.
After I gained a little bit more knowledge in TeX and ConTeXt
is started to write a new module from scratch with the option
to load style files and set the information for the address
and all other information with a better interface.

After nearly one and a helf years and 2 major revisions I have
nearly finished my module and would will make it now available
also to other users. But before I make my last stable version
online I want to discuss a few points with interested users.



The discussion


Before I start to give you information about my module and
give you the chance to mention your own wishes or thoughts
about the inteface I'm interested what do you use currently to
write you own correspondence (letter, invoices etc.).

After this interesting question for me I will now make a few
information about my module available.

The module use by default the definition for german business
letters as layout where the position for the address block and
the reference line are defined. To change the layout for your
own letter I provide the option to change the default settings
with the one for all command \setupletterstyle, you could use
it to set the page layout, the position for the different
blocks for address and sender information and also for the
bodyfontsize and parskip and parindent. To use once defined
for many letter you could save them in so called letterstyle
files which can be loaded either with the module
\usemodule[letter][style=...] or within the letter with the
command \useletterstyle[...].

The lettertext is written between the \startletter ...
\stopletter environment and it is possible to write in
adcouemnt as many letters as you want, you could write serial
letters and use the correspodence modul to save the address
information in a XMl file.

The values for letter are set with the \setupletter command
but this is one of the still open points, the current
implemtation requires sometimes to many lines for just a few
information and I plan to replace it with a simpler system.

Take the following minimal example

\usemodule[letter]

\setupletter
  [sender]
  [name={Mike Meiers},
   address={Mustergasse 12\\25694 Musterstadt}]

\setupletter
  [address]
  [name={Hans Hansen},
   address={Zielweg 34\\78561 Tiny Town}]

\starttext

\startletter
  [opening={Dear Hans,}]

letter text

\stopletter

\stoptext

As you can see the opening for the letter is set as optional
argument for \startletter because it is 

Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Arthur Reutenauer
 This may be a surprise, but I use only oowriter/oocalc
 currently. Why?

 Traitor ;-)
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Wolfgang Schuster
On Thu, Apr 17, 2008 at 2:40 PM, Taco Hoekwater [EMAIL PROTECTED] wrote:


 Wolfgang Schuster wrote:
 
  The discussion
 
  Before I start to give you information about my module and
  give you the chance to mention your own wishes or thoughts
  about the inteface I'm interested what do you use currently to
  write you own correspondence (letter, invoices etc.).

 This may be a surprise, but I use only oowriter/oocalc
 currently. Why?

   * I have many different envelopes to cater for, with and
 without address windows.

This is why I seperate content and layout, the input for the data
and text is always the same but layout and fields/information
depend on the output.

   * I sometimes need DIN letters, but sometimes just an
 informal note to accompany an item

Nothing can be more formal than a german letter in DIN style,
lots of rules with fixed values from the typewriter and many
exceptions.

   * Quite a bit of correspondence is invoices and quotes,
 with automatic calculations in them (VAT etc).

I already played with a few basic styles but this should go into
a seperate module and should be a MkIV only thing to get
correct values in the output, although MkII is possible but
I won't trust the results.

 Most of this can be done in tex/luatex of course, but it
 is a lot of effort compared to hitting enter a few extra
 times in oowriter.  Now, if there was a great letter module
 for context  ;-)

Hans provides a Example interface for his own interface
but I never got it working for myself but a simple user interface
would be nice.

Ideas for the input are welcome, it is completely independant
from the backend and I could also offer the original interface
from Donal Knuth.

  Before I release I first public bety version of the modul I
  want to hear which interface to set the letter information do
  you prefer and do you have things do want in the module.

 I definately would like an easy way to switch envelope
 formats, and automatic page 1 of ... would be nice too.

As I told, saw what you want and I could write a letter style.

The total number of page can be set with subpagenumber and
I tried hard to get it working with MkII and MKIV and spend a few
hours to find the last remaining bugs.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Wolfgang Schuster
The discussion
   
Before I start to give you information about my module and
give you the chance to mention your own wishes or thoughts
about the inteface I'm interested what do you use currently to
write you own correspondence (letter, invoices etc.).
 
   This may be a surprise, but I use only oowriter/oocalc
   currently. Why?
 
 * I have many different envelopes to cater for, with and
   without address windows.
 
 * I sometimes need DIN letters, but sometimes just an
   informal note to accompany an item
 
 * Quite a bit of correspondence is invoices and quotes,
   with automatic calculations in them (VAT etc).
 
   Most of this can be done in tex/luatex of course, but it
   is a lot of effort compared to hitting enter a few extra
   times in oowriter.  Now, if there was a great letter module
   for context  ;-)

 Happy to read that I'm not the only one !
 But with a « great letter module » (with french positions, of course :))…

Show me a few example or give me values for the positions (address block,
opening, line distance etc.)

I can only provide solutions if you give me information.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Olivier Guéry
   Happy to read that I'm not the only one !
   But with a « great letter module » (with french positions, of course :))…

  Show me a few example or give me values for the positions (address block,
  opening, line distance etc.)

  I can only provide solutions if you give me information.

Of course. I must find them… maybe the french association of TeX user.

What do you think about a wiki page about this in order to put all the
specifications ?

Cheers,
Olivier.

-- 
[Message tapé sur un clavier Bépo : http://www.clavier-dvorak.org ]
Olivier [EMAIL PROTECTED] http://nemolivier.blogspot.com
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Olivier Guéry
On Thu, Apr 17, 2008 at 2:40 PM, Taco Hoekwater [EMAIL PROTECTED] wrote:


  Wolfgang Schuster wrote:
  
   The discussion
  
   Before I start to give you information about my module and
   give you the chance to mention your own wishes or thoughts
   about the inteface I'm interested what do you use currently to
   write you own correspondence (letter, invoices etc.).

  This may be a surprise, but I use only oowriter/oocalc
  currently. Why?

* I have many different envelopes to cater for, with and
  without address windows.

* I sometimes need DIN letters, but sometimes just an
  informal note to accompany an item

* Quite a bit of correspondence is invoices and quotes,
  with automatic calculations in them (VAT etc).

  Most of this can be done in tex/luatex of course, but it
  is a lot of effort compared to hitting enter a few extra
  times in oowriter.  Now, if there was a great letter module
  for context  ;-)

Happy to read that I'm not the only one !
But with a « great letter module » (with french positions, of course :))…

Olivier.

-- 
[Message tapé sur un clavier Bépo : http://www.clavier-dvorak.org ]
Olivier [EMAIL PROTECTED] http://nemolivier.blogspot.com
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Idris Samawi Hamid
Hi Wolfgang,

On Thu, 17 Apr 2008 02:13:54 -0600, Wolfgang Schuster  
[EMAIL PROTECTED] wrote:

 Take the following minimal example

 \usemodule[letter]

 \setupletter
   [sender]
   [name={Mike Meiers},
address={Mustergasse 12\\25694 Musterstadt}]

 \setupletter
   [address]
   [name={Hans Hansen},
address={Zielweg 34\\78561 Tiny Town}]

 \starttext

 \startletter
   [opening={Dear Hans,}]

 letter text

 \stopletter

 \stoptext

You need a closing (Sincerely,) and signature, and don't forget enough  
topspace to accommodate a company logo/letterhead :-)

FWIW: Here is the basic structure of my setup (based on someone else's  
work, I forget his name):
=
\protect

%\setuppapersize[A4][A4]
\setuppapersize[letter][letter]

\setuplayout[header=.5in,
  topspace=1.37in,
  backspace=1.5in,
  footer=0mm,
  %header=0in,
  %,width=middle,
  width=middle,
 lines=60,
  height=middle] % margins etc.

\setupbodyfontenvironment[default][em=italic]
\setuppagenumbering[state=stop]

\long\def\addresser#1{\leavevmode\blank[1*line]
   \lbox{#1}}

% Defines field for receiver's address and places it at right position.
\long\def\addressee#1{\rbox{#1}}

% Subject line, in bold face.
\long\def\lettersubject#1{\blank[2*line]{\BF %Re:
 #1}}

\long\def\letteropening#1{\blank[line]#1} % opening...

\definestartstop
   [letter]
   [before={\blank[line]\setupwhitespace[medium]},
 after={}]

\long\def\letterclosing#1#2{\vbox{\blank[line]#1\blank[3*line]#2}} % and  
the closing formula

\unprotect

=

Best wishes
Idris


-- 
Professor Idris Samawi Hamid, Editor-in-Chief
International Journal of Shi`i Studies
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Henning Hraban Ramm
Am 2008-04-17 um 10:13 schrieb Wolfgang Schuster:
 Before I start to give you information about my module and
 give you the chance to mention your own wishes or thoughts
 about the inteface I'm interested what do you use currently to
 write you own correspondence (letter, invoices etc.).

I normally use InDesign for my business letters and invoices.

But I coded my last job applications completely in ConTeXt and  
adapted Holger Schöner's environment for my needs.

I remember it was not that easy to get my address and logo exactly in  
the same places as in my InDesign template - I use sheets with some  
pre-printed elements.

Another problem were different letter heads for first, odd and even  
pages.

(It would have been *much* easier to use InDesign for that stuff,  
like for most other designs that I do...)


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Wolfgang Schuster
On Thu, Apr 17, 2008 at 4:07 PM, Olivier Guéry [EMAIL PROTECTED] wrote:
Happy to read that I'm not the only one !
But with a « great letter module » (with french positions, of course :))…
 
   Show me a few example or give me values for the positions (address block,
   opening, line distance etc.)
 
   I can only provide solutions if you give me information.

 Of course. I must find them… maybe the french association of TeX user.

 What do you think about a wiki page about this in order to put all the
 specifications ?

I don't care, you could also send me a picture with boxes and the values
but I created now a page on the wiki http://wiki.contextgarden.net/letter
where you can collcet your information.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Wolfgang Schuster
On Thu, Apr 17, 2008 at 4:17 PM, Henning Hraban Ramm [EMAIL PROTECTED] wrote:
 Am 2008-04-17 um 10:13 schrieb Wolfgang Schuster:
  Before I start to give you information about my module and
  give you the chance to mention your own wishes or thoughts
  about the inteface I'm interested what do you use currently to
  write you own correspondence (letter, invoices etc.).

 I normally use InDesign for my business letters and invoices.

Dou you use a template for your letters.

LaTeX has two packages to create invoices and we could also
have one for ConTeXt but it makes only sense to use it with LuaTeX,
TeX's arithmetic to limited for longer calculations.

 But I coded my last job applications completely in ConTeXt and
 adapted Holger Schöner's environment for my needs.

 I remember it was not that easy to get my address and logo exactly in
 the same places as in my InDesign template - I use sheets with some
 pre-printed elements.

 Another problem were different letter heads for first, odd and even
 pages.

Different header for the first and another one for the following headers
is simple and possible with my module. The option to change the layout
for odd and even pages is currently not supported but should be
possible but it has to be integrated in the normal interface.

 (It would have been *much* easier to use InDesign for that stuff,
 like for most other designs that I do...)

This is also possible with ConTeXt because you could setup layers
to place content dependent on left and right pages and the page layout
could also change for left and right pages as long as you don't change
the text width.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Wolfgang Schuster
On Thu, Apr 17, 2008 at 4:12 PM, Idris Samawi Hamid
[EMAIL PROTECTED] wrote:
 Hi Wolfgang,

 On Thu, 17 Apr 2008 02:13:54 -0600, Wolfgang Schuster
 [EMAIL PROTECTED] wrote:

  Take the following minimal example
 
  \usemodule[letter]
 
  \setupletter
[sender]
[name={Mike Meiers},
 address={Mustergasse 12\\25694 Musterstadt}]
 
  \setupletter
[address]
[name={Hans Hansen},
 address={Zielweg 34\\78561 Tiny Town}]
 
  \starttext
 
  \startletter
[opening={Dear Hans,}]
 
  letter text
 
  \stopletter
 
  \stoptext

 You need a closing (Sincerely,) and signature, and don't forget enough
 topspace to accommodate a company logo/letterhead :-)

You set closing and signature also with the optional argument for \startletter

\startletter
  [opening=Dear Idris\textcomma,
   closing=Sincerely\textcomma,
   signature=Wolfgang Schuster]

You could define your own letterhead but by default I use just
name and address from the sender.

 FWIW: Here is the basic structure of my setup (based on someone else's
 work, I forget his name):
 =
 \protect

 %\setuppapersize[A4][A4]
 \setuppapersize[letter][letter]

 \setuplayout[header=.5in,
  topspace=1.37in,
  backspace=1.5in,
  footer=0mm,
  %header=0in,
  %,width=middle,
  width=middle,
 lines=60,
  height=middle] % margins etc.

 \setupbodyfontenvironment[default][em=italic]
 \setuppagenumbering[state=stop]

 \long\def\addresser#1{\leavevmode\blank[1*line]
   \lbox{#1}}

 % Defines field for receiver's address and places it at right position.
 \long\def\addressee#1{\rbox{#1}}

 % Subject line, in bold face.
 \long\def\lettersubject#1{\blank[2*line]{\BF %Re:
 #1}}

 \long\def\letteropening#1{\blank[line]#1} % opening...

 \definestartstop
   [letter]
   [before={\blank[line]\setupwhitespace[medium]},
 after={}]

 \long\def\letterclosing#1#2{\vbox{\blank[line]#1\blank[3*line]#2}} % and
 the closing formula

 \unprotect

Simple but working solution but a formal german requires a little
bit more work because most of the field use fixed positions whereas
blocks styles are written from top to bottom and each field use only
as much space as the text needs.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Henning Hraban Ramm
Am 2008-04-17 um 16:32 schrieb Wolfgang Schuster:
 I normally use InDesign for my business letters and invoices.
 Dou you use a template for your letters.

Not an InDesign template file (.idt), but a single document (with  
master pages) for every purpose (German/Swiss/English, letter/ 
invoice, private/business) that I overwrite every time. (I save a  
copy if the matter is important.)

 LaTeX has two packages to create invoices and we could also
 have one for ConTeXt but it makes only sense to use it with LuaTeX,
 TeX's arithmetic to limited for longer calculations.

For other purposes I simply write my TeX code with a script, mostly  
only one file that contains the dynamical data and gets included.

E.g.
- cover for backup CD/DVDs (that script even has a GUI - it reads a  
disk; shows the directory tree, so you can select which parts you'd  
like to be visible; writes a TeX file; calls ConTeXt and opens the PDF)

- my address book (pulls and formats data from a MySQL database)

- business cards for one big company (I receive an Excel file with  
personnel data, save it as CSV and convert that to ConTeXt, PDF  
with one page per person gets imposed and printed on cardboard with  
pre-printed logo)

 Another problem were different letter heads for first, odd and even
 pages.

 Different header for the first and another one for the following  
 headers
 is simple and possible with my module. The option to change the layout
 for odd and even pages is currently not supported but should be
 possible but it has to be integrated in the normal interface.

My sheets have a pre-printed logo, I use the same for all pages of a  
letter.

On the first page I need address and bank data.

On even pages (back side) there's no logo, so I don't need the big  
top border.

Normally I leave out the first even page, e.g. my job application  
starts with an one-side letter, the following data (CV, references  
etc.) uses front and back page.

The application had the additional difficulty that there's the photo  
on the CV page, and I wanted the title in white *on* the photo...

At least in the online PDF - I used modes to produce both printed  
version (without logo, because that's pre-printed on my sheets) and  
email version (with logo)

 (It would have been *much* easier to use InDesign for that stuff,
 like for most other designs that I do...)

 This is also possible with ConTeXt because you could setup layers
 to place content dependent on left and right pages and the page layout
 could also change for left and right pages as long as you don't change
 the text width.

I used layers and setups, but I had difficulties switching them on  
and off. And what not - can't remember everything.




Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Gour
 Wolfgang == [EMAIL PROTECTED] writes:

Wolfgang LaTeX has two packages to create invoices and we could also
Wolfgang have one for ConTeXt but it makes only sense to use it with
Wolfgang LuaTeX, TeX's arithmetic to limited for longer calculations.

Let me just say that I'd found a use for invoices and letters in ConTeXt
with LuaTeX...


Sincerely,
Gour


-- 

Gour  | Zagreb, Croatia  | GPG key: C6E7162D



pgp3CzIGx6HiK.pgp
Description: PGP signature
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Peter Münster
On Thu, Apr 17 2008, Wolfgang Schuster wrote:

 After nearly one and a helf years and 2 major revisions I have
 nearly finished my module and would will make it now available
 also to other users. But before I make my last stable version
 online I want to discuss a few points with interested users.

Hello Wolfgang,

Already in advance: thank you very much!  With such a module, I can finally
forget really all about LaTeX. Sometimes I still use scrlttr2.cls and at
these moments I swear to write a letter module one day. Now I know, that I
won't need to do this difficult (for me) task.


 Before I start to give you information about my module and
 give you the chance to mention your own wishes or thoughts
 about the inteface I'm interested what do you use currently to
 write you own correspondence (letter, invoices etc.).

First, I used lettre.cls (LaTeX class). It has one really great feature:
the vertical spaces are recalculated at every pass, in order to get a last
page filled at least to 50%. Without this, you can easily get a second page
with only the closing and the signature.

Then, for some reason that I forgot, I switched to scrlttr2.cls. And I
patched it to get the same minimum-50%-feature. Unfortunately, this patch is
no more working with recent versions of scrlttr2...
(- http://pmrb.free.fr/work/OS/LaTeX/lettre.lco )

I would welcome such a feature in your module!

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Discussion: correspondence with ConTeXt

2008-04-17 Thread Peter Münster
On Thu, Apr 17 2008, Taco Hoekwater wrote:

* Quite a bit of correspondence is invoices and quotes,
  with automatic calculations in them (VAT etc).

Hello Taco,

Quite funny: Just 3 days ago, I wrote t-invoice.tex for my personal needs,
just 1 command and very very simple:
\startInvoice
\invoiceItem[description=Ballon eau chaude, price={5063,4 + 1115,87}]
\invoiceItem[description=Vase d'expansion, price={386,25}]
\invoiceItem[description=Plan d'implantation du bâtiment, price={257,14}]
\invoiceItem[description=Branchement d'eau, price={2891,62}]
\stopInvoice

\stopInvoice prints the total.



Here the definitions (can be enhanced and/or wikified):

\startluacode
-- namespace
thirddata = thirddata or { }
thirddata.invoices = {}
thirddata.invoices.total = 0
thirddata.invoices.pos = 1

-- get price with right format
-- p: the price
-- return price with right format
function thirddata.invoices.format(p)
local s = string.format(%.2f, p)
s = s:gsub(%., ,)
return s
end

-- print new item
-- d: the description
-- p: the price
function thirddata.invoices.new_item(d, p)
thirddata.invoices.total = thirddata.invoices.total + p
tex.print(\\bTR\\bTD .. string.format(%03d, thirddata.invoices.pos) 
..
  \\eTD\\bTD  .. d .. \\eTD\\bTD  ..
  thirddata.invoices.format(p) .. \\eTD\\eTR)
thirddata.invoices.pos = thirddata.invoices.pos + 1
end
\stopluacode

\def\invoiceItem{\dosingleargument\doinvoiceItem}
\def\doinvoiceItem[#1]{\getparameters[IV][#1]
  \ctxlua{thirddata.invoices.new_item(\IVdescription,
\ctxlua{local s = string.gsub(\IVprice, ,, .); tex.print(s)})}}

\def\invoiceTotal{%
  \ctxlua{tex.print(thirddata.invoices.format(thirddata.invoices.total))}}

\def\startInvoice{\start
  \setupTABLE[frame=off,textwidth=\textwidth,option=stretch]
  \setupTABLE[r][first][bottomframe=on]
  \setupTABLE[r][2,last][top=\blank]
  \setupTABLE[c][first,2][align=flushleft]
  \setupTABLE[c][last][align={flushright,lohi}]
  \bTABLE\bTR\bTH Position \eTH\bTH Description \eTH\bTH Prix \eTH\eTR}

\def\stopInvoice{\bTR\bTD[nc=2,align=flushright]Total:\eTD
  \bTD \invoiceTotal\eTD\eTR\eTABLE\stop}


Cheers, Peter

-- 
http://pmrb.free.fr/contact/

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___