groff
[Top][All Lists]
Advanced

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

Re: [Groff] PSPIC in Tables and Nested Tables


From: Werner LEMBERG
Subject: Re: [Groff] PSPIC in Tables and Nested Tables
Date: Sat, 17 Jun 2006 15:18:40 +0200 (CEST)

> When used in a diversion for placement within a table cell, PSPIC's
> positioning option [-L | -R | -I n ] works IMHO in a somewhat
> unusual manner. The options L, R and nothing (= center) place the
> image with reference to the overall line length (or maybe page
> width, I'm not sure) and _not_ with reference to the table cell
> boundaries.

This is correct.

> OTOH, the I option places the image with reference to the cell

This is not correct.  It is also aligned w.r.t the current line width.
Reason is that the table and the diversions are not processed at the
same time.

> -- but requires a negative space argument in order to align the
> image to the centre of the cell.

This is caused by the PSPIC macro.  See attached example for a
solution.

> However, when using PSPIC in nested tables, PSPIC's alignment
> options "left, right and centre" now function with respect to the
> outer placeholder table and not the inner diversion table -- I is
> well-behaved.

Again, this is not correct.  Please write again if the attached
`table-test' doesn't give a sufficient explanation.


    Werner
.ps 14
.vs 16
.br
.
.\" In PSPIC, move current point to the right edge of the image
.\" so that the macro used in a diversion produces a correct width
.\" for the image.
.am PSPIC
.  nop \h'(\\n[ps-offset]u + \\n[ps-deswid]u)'
.  sp -1
..
.
.
.de create-diversion
.  di \\$1
.    in 0
.    ps 4
.    vs 4
.    nop Before image.
.    PSPIC \\$2 cvs/groff.compiled/doc/gnu.eps 24p 16p
.    nop After image.
.    in
.    ps
.    vs
.  di
..
.
.create-diversion d0 ""
.create-diversion d0-L -L
.create-diversion d0-R -R
.create-diversion d0-I-10p "-I 10p"
.
.
.di d1
.  in 0
.TS
box;
cw(50p)p-4
c.
.  sp 4p
T{
.  nf
.  d0
.  fi
T}
.  sp 4p
Text Goes Here
.  sp 4p
.TE
.  in
.di
.
.di d1-L
.  in 0
.TS
box;
cw(50p)p-4
c.
.  sp 4p
T{
.  nf
.  d0-L
.  fi
T}
.  sp 4p
Text Goes Here
.  sp 4p
.TE
.  in
.di
.
.di d1-R
.  in 0
.TS
box;
cw(50p)p-4
c.
.  sp 4p
T{
.  nf
.  d0-R
.  fi
T}
.  sp 4p
Text Goes Here
.  sp 4p
.TE
.  in
.di
.
.di d1-I-10p
.  in 0
.TS
box;
cw(50p)p-4
c.
.  sp 4p
T{
.  nf
.  d0-I-10p
.  fi
T}
.  sp 4p
Text Goes Here
.  sp 4p
.TE
.  in
.di
.
.
Here's some text before the table.  We write some longer sentences to see
the document's line length.  Currently, we don't use any special macro
package.
.sp
Here's the image's diversion, centered (d0).
.sp
.nf
.d0
.fi
.sp
Here's the image's diversion, left-aligned (d0\-L).
.sp
.nf
.d0-L
.fi
.sp
Here's the image's diversion, right-aligned (d0\-R).
.sp
.nf
.d0-R
.fi
.sp
Here's the image's diversion, indented by 10p (d0\-I\-10p).
.sp
.nf
.d0-I-10p
.fi
.
.
.bp
Here's the inner table's diversion, using a centered image (d1).  Remember
that the table's column modifier `w' gives a \fIminimum\fR width!  To get a
correct width of the surrounding box it is necessary to modify the `PSPIC'
macro; by default, it doesn't move the current point to the right edge of
the image.
.sp
.nf
.d1
.fi
.sp
Here's the inner table's diversion, using a left-aligned image (d1\-L).
.sp
.nf
.d1-L
.fi
.sp
Here's the inner table's diversion, using a right-aligned image (d1\-R).
.sp
.nf
.d1-R
.fi
.sp
Here's the inner table's diversion, using an image indented by 10p
(d1\-I\-10p).
.sp
.nf
.d1-I-10p
.fi
.
.
.bp
Here's the main table, using d0 and d1.
.sp
.TS
tab(;);
ccccc.
1;2;T{
.nf
.d0
.fi
T};T{
.nf
Two lines
of text
.fi
T};5
1;2;T{
.nf
.d1
.fi
T};T{
.nf
Two more
text lines
.fi
T};5
.TE
.sp
Here's the main table, using d0\-L and d1\-L.
.sp
.TS
tab(;);
ccccc.
1;2;T{
.nf
.d0-L
.fi
T};T{
.nf
Two lines
of text
.fi
T};5
1;2;T{
.nf
.d1-L
.fi
T};T{
.nf
Two more
text lines
.fi
T};5
.TE
.sp
Here's the main table, using d0\-R and d1\-R.
.sp
.TS
tab(;);
ccccc.
1;2;T{
.nf
.d0-R
.fi
T};T{
.nf
Two lines
of text
.fi
T};5
1;2;T{
.nf
.d1-R
.fi
T};T{
.nf
Two more
text lines
.fi
T};5
.TE
.sp
Here's the main table, using d0\-I\-10p and d1\-I\-10p.
.sp
.TS
tab(;);
ccccc.
1;2;T{
.nf
.d0-I-10p
.fi
T};T{
.nf
Two lines
of text
.fi
T};5
1;2;T{
.nf
.d1-I-10p
.fi
T};T{
.nf
Two more
text lines
.fi
T};5
.TE
.sp
Here's some text after the table.  Again, we write some longer sentences to
see the document's line length.

Attachment: table-test.pdf
Description: Adobe PDF document


reply via email to

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