Re: table rows in a galley

"Valeriy E. Ushakov" <[email protected]>
Newsgroups gmane.comp.type-setting.lout
Message-ID <[email protected]>
On Fri, Oct 03, 2008 at 19:15:44 +0400, Valeriy E. Ushakov wrote:

> There are several problems with this (though my Lout is getting quite
> rusty, so take this with a grain of salt).

Something along the following lines might work, but I didn't really
try to make it foolproof or flexible.  I have a vague feeling that you
are not splitting responsibilities between the generating program and
lout quite right and that makes you write lout code that is more
complex than necessary.


# "meta-galley", helps to get rid of hordes of
# trivial galley definitions
def @Send
  left  @Target
  named @
    right @Component
	{ @Component }
  right galley
{
  def @Enclose right component { @ component }
  galley
}

def @CPlace { @Galley }
def @PPlace { @Galley }
def @BounceRows { @Galley // @BounceRows }

def @MyTbl {
    import @Tbl
    def @RepeatRowa {
        @Rowa A { @CPlace } B { @PPlace }
	// @RepeatRowa
    }

    @BounceRows //
    @Tbl rh { yes } w { expand }
        aformat { @Cell { @Right A } | @Cell B  }
    {
        @Rowa A { country } B { population }
        // @RepeatRowa
    }
}

def @Country named name {} named population {} {
    { @BounceRows&&preceding } @Send {
      { @CPlace&&following } @Send { name }
      { @PPlace&&following } @Send { population }
    }
}


PS: http://www.stderr.spb.ru/~uwe/lout/essays/essays.html (*shamless
plug* :) has some examples that demonstrate how to work with scopes,
galleys and xrefs.

SY, Uwe
-- 
[email protected]                       |       Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/          |       Ist zu Grunde gehen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.