ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Code lua in a table
Date: Sat, 18 Jul 2020 22:22:13 +0200	[thread overview]
Message-ID: <f7ea5250-649f-17a3-6594-3ceaab3e4988@gmail.com> (raw)
In-Reply-To: <CACyK-eq=ZYVsUnTuoWb1o+QnUnp8iO=SXMyvH=6L=k_pmjaXpw@mail.gmail.com>

Fabrice Couvreur schrieb am 18.07.2020 um 22:09:
> Hi,
> I improved the code to be able to display the grid but I cannot display 
> the coefficients.
> Thank you
> Fabrice
> 
> \starttext
> 
> \startluacode
>       function Binom(n,k)
>         if k > n then
>               return 0
>         elseif (n == 0 or k == 0) then
>               return 1
>         else
>               return (n*Binom(n-1,k-1))/k
>         end
> 
>      end
> 
>      context.startxtable({"align={middle,lohi}, 
> width=1.2cm,offset=0.8ex,bodyfont=9pt"})
>      for i = 1, 10 do
>            context.startxrow({"background=color,backgroundcolor=cyan"})
>              for j = 1, i do
>                    context.startxcell()
>                       \ctxlua{context(Binom(i,j))}

Remove \ctxlua:

context(Binom(i,j))

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-07-18 20:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-18 18:05 Fabrice Couvreur
2020-07-18 18:32 ` Wolfgang Schuster
2020-07-18 20:09   ` Fabrice Couvreur
2020-07-18 20:22     ` Wolfgang Schuster [this message]
2020-07-18 20:25       ` Fabrice Couvreur
2020-07-18 20:34         ` Fabrice Couvreur
2020-07-18 20:36         ` Wolfgang Schuster
2020-07-18 21:35         ` Otared Kavian
2020-07-18 22:05           ` Otared Kavian
     [not found] <mailman.1.1595152801.23549.ntg-context@ntg.nl>
2020-07-20  5:56 ` Jeong Dal
2020-07-20  8:36   ` Hans Hagen
2020-07-20 10:13     ` Fabrice Couvreur
2020-07-20 12:40     ` Jeong Dal
2020-07-20 12:54       ` Hans Hagen
2020-07-21 13:08         ` Fabrice Couvreur

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=f7ea5250-649f-17a3-6594-3ceaab3e4988@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --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).