[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] tables in a macro

From: Werner LEMBERG
Subject: Re: [Groff] tables in a macro
Date: Fri, 16 Jun 2006 07:42:42 +0200 (CEST)

> > However I want to have a variable parameter list.  At maximum I
> > can have up to 10 parameters.  Each parameter opens a new row.  If
> > the Parameter is empty the do not open a new row.
> [snip]
> I can't think of a simple way to make this work.  The problem lies
> in the nature of tbl as a *pre*processor, which expects to have all
> the data it has to operate on available at *tbl*-runtime, not
> *troff*-runtime.  Of course, since tbl knows nothing about font
> sizes and font metrics and whatnot, it can't position the individual
> table items itself, so instead it generates troff-*code* which troff
> can execute to decide how to format the table.

You could use a brute-force approach:

  .ie (\\n[.$] == 1) \
  .  ATABLE1 \\$1
  .el \n[.$] == 2) \
  .  ATABLE2 \\$1 \\$2

with 10 macros `ATABLE1' ... `ATABLE10'.

> (see hdtbl, which operates at troff-runtime)

Unfortunately it's tricky currently to emulate tbl with hdtbl.  I'm
working on this.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]