From: Vnpenguin <vnpenguin@vnoss.org>
To: ConTeXt list <ntg-context@ntg.nl>
Subject: Re: LuaTeX & printf() function ?
Date: Fri, 23 Jul 2010 23:29:09 +0200 [thread overview]
Message-ID: <AANLkTimGDv8Q2fkOF3QPu7f97wVWptLrXgzxtVwdDETp@mail.gmail.com> (raw)
In-Reply-To: <4C4A0835.9090407@wxs.nl>
On Fri, Jul 23, 2010 at 23:23, Hans Hagen <pragma@wxs.nl> wrote:
> On 23-7-2010 10:53, Vnpenguin wrote:
>>
>> \startformula
>>>>>
>>>>> K = \frac{\sigma_1}{\sigma_2} = \frac{355}{14}=
>>>>> \ctxlua{tex.print(string.format("%0.2f",355/14))}
>>>>> \stopformula
>>>>>
>
> or
>
> \ctxlua{context("\letterpercent0.2f",355/14)}
>
> we can consider adding
>
> \let\pct\letterpercent
>
> but nice is:
>
> \ctxluacode{context("%0.2f",355/14)}
>
> i'll add this but keep in mind that this will only work in the text stream,
> not in macro definitions or as arguments
>
With the format "%..." it's better to call something like
\clxluacode{contextf()} ? (like print() & printf())
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2010-07-23 21:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 20:25 Vnpenguin
2010-07-23 20:38 ` luigi scarso
2010-07-23 20:39 ` luigi scarso
2010-07-23 20:53 ` Vnpenguin
2010-07-23 21:23 ` Hans Hagen
2010-07-23 21:29 ` Vnpenguin [this message]
2010-07-23 21:36 ` Hans Hagen
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=AANLkTimGDv8Q2fkOF3QPu7f97wVWptLrXgzxtVwdDETp@mail.gmail.com \
--to=vnpenguin@vnoss.org \
--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).