groff
[Top][All Lists]
Advanced

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

RE: [Groff] scaling in pic


From: Ted Harding
Subject: RE: [Groff] scaling in pic
Date: Tue, 04 Sep 2001 12:40:29 +0100 (BST)

On 04-Sep-01 Peter Gerbrandt wrote:
> Hi Ted
> 
> thanks for your answer.
> I want to build tables with pic. I have an "original" (Excel) and I
> want to reproduce that in pic. With one table per page it worked, but I
> want to have more than one table per page like it is on the original.
> When I put the tables together the words are bigger than the cells and
> that doesn't look very nice. 

Hi Peter,

I see. Two comments (in different directions).

1. Unless the table is an unusual one, or you want to produce
   special effects, I would not use 'pic' for this, but 'tbl'
   instead. You can export the table from Excel in, say, CSV
   format. Then you convert (using say 'sed' or 'awk') so that
   the delimiter is what you want to use in 'tbl' (I like to
   to use "#" or "@" rather than "TAB", the default). Then you
   wrap the whole thing between ".TS" and ".TE" and it should
   come out as you want. You can put boxes round table cells
   or blocks of cells in 'pic', though non-systematic boxing
   can be intricate to set up.

2. However, if you insist on using 'pic' to present tabular
   information in boxes, then indeed there is a problem with
   the fact that text can run outside the boxes.

   The reason for this is that, normally, 'pic' is run as
   a pre-processor (i.e. it converts the pic-language description
   into troff code before troff sees it). At this stage, 'pic'
   itself does not know what the size of a text block is: only
   troff can do that!

   Nevertheless, there is a way of running 'pic' "in-line",
   i.e. breaking out of troff and running 'pic'. This gets round
   the problem, because you can make troff calculate the size of
   the text block that it has to draw a box round, save this info
   in nunber registers, and then use these number registers to
   create 'pic' commands which request boxes of the right size.
   These are then processed by the "inline" run of 'pic', and
   the resulting 'pic output can then be pulled back into 'troff'
   to be formatted.

   It is a bit complicated to explain exactly how to do this
   in a general reply, but I could demonstrate it if you would
   send a small example of what you want to do.

(It might also help, if you are considering method (1), to send
an example anyway, in case there are special things that need
to be done with 'tbl').

Best wishes,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 04-Sep-01                                       Time: 12:40:29
------------------------------ XFMail ------------------------------

reply via email to

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