groff
[Top][All Lists]
Advanced

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

Re: [Groff] Controlling individual line thickness in TBL


From: ralph
Subject: Re: [Groff] Controlling individual line thickness in TBL
Date: Sat, 26 Jan 2002 11:28:27 +0000

Hi George,

> In an attempt to control individual line thickness, I am invoking the
> \D't n' escape. Unfortunately, this is not working and I am getting
> the following error.
> 
> <standard input>:1492: warning: missing closing delimiter
> <standard input>:1496: warning: numeric expression expected (got a
>     special character)

OK, I've found the cause.  Here's my working out so you can see one way
of investigating these problems.

    % groff -t < in > ps
    <standard input>:16: warning: numeric expression expected (got a
    special character)

Use `groff -V' to see the pipeline groff is executing on your behalf.

    % groff -V -t <in
    tbl | troff -msafer -Tps | grops

Execute them individually, so you can see what command in the pipeline
produces the error, and more importantly capture the input to that
command.

    % tbl <in >tbl.out
    % troff -Tps <tbl.out >troff.out
    <standard input>:16: warning: numeric expression expected (got a
    special character)
    % grops <troff.out >ps

Examine line 16 of troff's input tbl.out.

    % sed -n 16p tbl.out 
    .ll \n[.l]u

Hmm, that's not right.  Ah, tbl outputs lots of `.lf' commands which
set the current line number and filename for diagnostics.  It does this
so troff refers to the original file, not the output from tbl.  Strip
those out and try again.

    % grep -v '^\.lf' <tbl.out >tbl.out2
    % troff -Tps <tbl.out2 >troff.out
    <standard input>:218: warning: numeric expression expected (got a
    special character)

OK, examine lines around 218.

    % cat -n tbl.out2 | sed -n 210,220p
       210  .nr 3lnw11 \n[3lnw11]>?\n[3tbw5,11]
       211  .nr 3rnw11 \n[3rnw11]>?\w\[tbl].0\[tbl]
       212  .nr 3tbw5,12 0\w\[tbl]0\[tbl]
       213  .nr 3lnw12 \n[3lnw12]>?\n[3tbw5,12]
       214  .nr 3rnw12 \n[3rnw12]>?\w\[tbl].0\[tbl]
       215  .nr 3tbw5,13 0\w\[tbl]0\[tbl]
       216  .nr 3lnw13 \n[3lnw13]>?\n[3tbw5,13]
       217  .nr 3rnw13 \n[3rnw13]>?\w\[tbl].0\[tbl]
       218  .nr 3tbw5,14 0\w\[tbl]-\D't 300\[tbl]
       219  .nr 3lnw14 \n[3lnw14]>?\n[3tbw5,14]
       220  .nr 3rnw14 \n[3rnw14]>?\w\[tbl]'\[tbl]

(I changed your three \D't 500' to 100, 200, and 300, so they are
distinct.)

Well, 218 has \D't 300 with no terminating ' so the error from troff is
correct.  Why's tbl producing that?  Examining the pattern between
lines 218-220 and the previous triples, e.g. 215-217, shows that the
input `0.0' has been split into `0' and `.0'.  Similarly, \D't 300' has
been split into \D't 300 and ', the single ' is on line 220.

Check the tbl input to see why it's splitting stuff like this.

    % tail -5 in
    .TH
    .T&
    | l n n n n n n n n n | r | n n n | n |.
    FNCL;5.50;2002;6.02;360;0;2;0.021;0.021;0.9996425;1m;0.0;0.0;0.0;-\D't 300';
    .TE

OK, they're numeric fields and it is splitting where there's a decimal
point, or if no decimal point after the `300'.

Try changing from numeric for that last column.

    % sed 's/| n |/| l |/' <in >in2
    % groff -t <in2 >ps2
    %

No errors.  So we're on the right track.

tbl allows \& to specify where the `decimal point' is in a numeric
field.  Revert back to the original numeric column and add a \&.

    % sed 's/\\D'\''t 300/\\\&&/' <in >in3
    % tail -3 in3
    | l n n n n n n n n n | r | n n n | n |.
    FNCL;5.50;2002;6.02;360;0;2;0.021;0.021;0.9996425;1m;0.0;0.0;0.0;-\&\D't 
300';
    .TE

See what tbl outputs now for that cell.

    % tbl <in3 | grep -v '^\.lf ' | cat -n | sed -n 215,220p
       215  .nr 3tbw5,13 0\w\[tbl]0\[tbl]
       216  .nr 3lnw13 \n[3lnw13]>?\n[3tbw5,13]
       217  .nr 3rnw13 \n[3rnw13]>?\w\[tbl].0\[tbl]
       218  .nr 3tbw5,14 0\w\[tbl]-\[tbl]
       219  .nr 3lnw14 \n[3lnw14]>?\n[3tbw5,14]
       220  .nr 3rnw14 \n[3rnw14]>?\w\[tbl]\&\D't 300'\[tbl]

That looks better, the \& has worked.  Try the whole thing again.

    % groff -t <in3 >ps
    % 

Cheers,


Ralph.


reply via email to

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