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>
Subject: Re: \dorecurse and \recurselevel in Natural Tables
Date: Fri, 6 Mar 2009 15:49:00 +0100	[thread overview]
Message-ID: <AB25E1B2-56A1-459D-9888-293CD4933D36@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.0903052159170.29619@ybpnyubfg.ybpnyqbznva>


Am 06.03.2009 um 04:05 schrieb Aditya Mahajan:

> My summary of this thread:
> http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/

Nice article but I have a few corrections for you.


Table setup:

To achieve horizontal and vertical centered content in the table cell
you need 'align={middle,lohi}'.


Pure table code:

You forgot the \bTR and \eTR before and after each row.


Expandafter solution:

You don't need as many \expandafter as you did in your example,
one before \bTD in each loop is enough.

\bTABLE
  \bTR
   \bTD $(+)$ \eTD
   \dorecurse{6}
    {\expandafter \bTD \recurselevel \eTD}
   \eTR
\dorecurse{6}
  {\bTR
      \edef\firstrecurselevel{\recurselevel}
      \expandafter\bTD \recurselevel \eTD
   \dorecurse{6}
     {\expandafter
      \bTD
       \the\numexpr\firstrecurselevel+\recurselevel\relax
      \eTD}
   \eTR}
\eTABLE


\for loop:

If you really want to show this loop you also the correct
commands to access the counters. #1 did also work but only
because the command is wrapped around \dostepwiserecurse.

\bTABLE
   \bTR
     \bTD $(+)$ \eTD
     \for \y=1 \to 6 \step 1 \do
       {\bTD \y \eTD}
   \eTR
   \for \x=1 \to 6 \step 1 \do
   {\bTR
      \bTD \x \eTD
     \for \y=1 \to 6 \step 1 \do
     {\bTD \the\numexpr\x+\y \eTD}
   \eTR}
\eTABLE


Thank you for the article and I'm looking forward for the next.

Best regards,
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
___________________________________________________________________________________


  parent reply	other threads:[~2009-03-06 14:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 19:35 Curious Learn
2009-03-04 19:53 ` luigi scarso
2009-03-04 20:04   ` luigi scarso
2009-03-05  0:17   ` luigi scarso
2009-03-05 11:09     ` Wolfgang Schuster
2009-03-05 11:27       ` luigi scarso
2009-03-05 12:00         ` Wolfgang Schuster
2009-03-05 13:23           ` luigi scarso
2009-03-05 13:52             ` Wolfgang Schuster
2009-03-05 14:23               ` luigi scarso
2009-03-05 14:53                 ` Wolfgang Schuster
2009-03-05 15:08                   ` luigi scarso
2009-03-06  3:05         ` Aditya Mahajan
2009-03-06  6:41           ` luigi scarso
2009-03-06 10:47             ` Wolfgang Schuster
2009-03-06 11:20           ` Willi Egger
2009-03-06 13:01           ` Curious Learn
2009-03-06 13:32             ` Arthur Reutenauer
2009-03-06 16:15               ` Curious Learn
2009-03-06 13:35             ` luigi scarso
2009-03-06 14:49           ` Wolfgang Schuster [this message]
2009-03-06 16:33             ` Aditya Mahajan
2009-03-06 17:07               ` Wolfgang Schuster
2009-03-06 16:38           ` Aditya Mahajan
2009-03-04 20:35 ` Wolfgang Schuster
2009-03-04 20:57   ` Curious Learn
2009-03-04 21:11     ` Wolfgang Schuster
2009-03-04 21:43       ` Aditya Mahajan
2009-03-04 21:51         ` Wolfgang Schuster
2009-03-04 22:17       ` Curious Learn
2009-03-04 22:35         ` Wolfgang Schuster

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=AB25E1B2-56A1-459D-9888-293CD4933D36@gmail.com \
    --to=schuster.wolfgang@googlemail.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).