ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <hraban@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Learning LuaTeX : Invoice
Date: Tue, 22 Feb 2011 11:55:54 +0100	[thread overview]
Message-ID: <00E4BA7C-0E9A-485D-85B7-FE673212BDEC@fiee.net> (raw)
In-Reply-To: <AANLkTim=aYj9AZz5t_=09MRPCkhGb4k34f2KpYFcx5eM@mail.gmail.com>

Am 2011-02-22 um 11:14 schrieb luigi scarso:

>>> Can you add a small example ?
>>
>> The spreadsheet module has a example at the end of the file and  
>> Hennings code
>> has also a example at the end.
> Yes I've seen
...
> But it' s better
> \startluacode
> -- functions
> \stopluacode
> %%
> \starttext
> \startluacode
> -- register invoice items
> userdata.RegisterAmountItem("Some introductional text", 0) -- just  
> text
> userdata.RegisterTimeItem("Learn \\LUATEX", 2.5)
> userdata.RegisterTimeItem("Do some calculations in \\CONTEXT", 3.5 +  
> 7)
> userdata.RegisterAmountItem("Donations to Open Source projects", 99)  
> -- lump sum
> -- output
> userdata.Invoice()
> \stopluacode
> \stoptext
>
> (or maybe a  better example)

Feel free to change it, it’s a wiki.

In my own document the functions live in an environment, together with  
all the definitions for the letter, and the invoice items in the  
actual invoice document. I wanted to make a rather minimal example, so  
I left out all the letter stuff.

The page is of use only for those who speak little Lua (I was looking  
for a similar example); if you know better, you won’t need it, and if  
you don’t speak Lua at all, it’s useless for you.


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


      reply	other threads:[~2011-02-22 10:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-20 11:55 Henning Hraban Ramm
2011-02-20 12:07 ` Henning Hraban Ramm
2011-02-20 12:08 ` Wolfgang Schuster
2011-02-20 12:58   ` Henning Hraban Ramm
2011-02-20 13:29     ` Wolfgang Schuster
2011-02-20 13:29     ` Henning Hraban Ramm
2011-02-20 13:41       ` Wolfgang Schuster
2011-02-20 14:49         ` Henning Hraban Ramm
2011-02-20 15:12           ` Hans Hagen
2011-02-20 15:09         ` Hans Hagen
2011-02-20 19:16           ` Henning Hraban Ramm
2011-02-20 20:20             ` Philipp Gesang
2011-02-20 20:28               ` Wolfgang Schuster
2011-02-20 23:28                 ` Hans Hagen
2011-02-22  9:47               ` Henning Hraban Ramm
2011-02-22  9:51                 ` luigi scarso
2011-02-22 10:01                   ` Wolfgang Schuster
2011-02-22 10:14                     ` luigi scarso
2011-02-22 10:55                       ` Henning Hraban Ramm [this message]

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=00E4BA7C-0E9A-485D-85B7-FE673212BDEC@fiee.net \
    --to=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).