groff
[Top][All Lists]
Advanced

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

Re: [Groff] background shading using tbl


From: Werner LEMBERG
Subject: Re: [Groff] background shading using tbl
Date: Sat, 03 Jul 2010 08:06:42 +0200 (CEST)

> I hope to create a school directory of about 1,000 students using
> groff.  I have close to what I want using the tbl processor, but
> hope to alternate shading between rows: white/grey/white/...
> 
> Is there a way to do this?

There are two possibilities for shaded table cells:

  . The hdtbl macro package; the examples show a lot of shaded boxes.
    However, this works for PS output only.

  . Regarding direct tbl support, you might have a look at this
    thread:

      http://lists.gnu.org/archive/html/groff/2006-06/msg00025.html

    Unfortunately, Gaius stopped working on improving his patch so I
    wasn't able to add his changes to the groff source tree.

I believe that those approaches don't work for you since both methods
specify the table cell colour in advance, while you need it specified
dynamically.

I think you have to use manual macro trickery:

  . flip the colour
  . write the next line (or whatever) to a diversion to get its
    dimensions
  . write a background rectangle with \D'P ...', using the colour set
    with \M and the dimension of the stored diversion.  Some sample
    code can be found in the info manual under the description for
    \D'P ...'.
  . output the diversion


    Werner



reply via email to

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