groff
[Top][All Lists]
Advanced

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

Re: [groff] Groff tbl and header


From: Tadziu Hoffmann
Subject: Re: [groff] Groff tbl and header
Date: Wed, 23 Oct 2019 15:59:57 +0200
User-agent: Mutt/1.11.4 (2019-03-13)

I'm not sure you can do this simply by sourcing the entire file,
because the table header has to go before the ".TH" and the rest
of the table after it.

You might try placing a single ".TH" line after line 1 in
a copy of the CSV using a system command.  However, this
has to be done *before* processing, because you also have
to run your manuscript through soelim (otherwise tbl would
never see the data), but, like tbl, soelim is run *before*
troff starts its work, so if you call the system command via
troff from your manuscript it will be too late.  (It might
be okay if you use a two-pass scheme for processing, since
then the modified CSV copy will exist on the second run.)

An alternative is to run tbl not in the pipeline, but
explicitly via system command from troff:

  .\" mm unsafe
  .\" ----------------------------------------------------------------
  Text before.
  .sy echo -e '.TS H\\ncenter allbox box tab(,);\\nc c\\na n.' >tempfile.tbl; \
    head -n 1 multipagetable.csv >>tempfile.tbl; \
    echo '.TH' >>tempfile.tbl; \
    tail -n +2 multipagetable.csv >>tempfile.tbl; \
    echo '.TE' >>tempfile.tbl; \
    tbl <tempfile.tbl >tempfile.tro
  .so tempfile.tro
  Text after.

(In this example I have used a simple two-column table for
testing.)





reply via email to

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