[comp.text] Negative Spacing in TROFF Diversions

henry%angel@Sun.COM (Henry McGilton -- Software Products) (12/22/89)

OK, all you REAL TROFF Wizards out there.  I keep running
into this problem with diversions.  Briefly, if I do something
like this:

	.br		\"  break last output line
	.di qq		\"  start diverting into qq
	.sp -1v		\"  space back one vertical
	lots of glop	\"  stuff to be diverted
	.br		\"  break last output line
	.di		\"  end diversion

When I subsequently bring back the contents of the diversion,
the whole thing just disappears.  Baffles me.  Any ideas?

To expand on this a bit, I'm trying to work around an annoying
problem placing PIC diagrams inside tables.  I create a table, like so:

	.TS
	tab (@) ;
	l  l  l  .
	some stuff@T{
	.PS
	box
	.PE
	T}@more stuff
	.TE

Where I place the PIC diagram inside a text block.  When I format
this through PIC | TBL | TROFF and so on, the top of the picture
always comes out at the baseline of the text `some stuff'.  So
I tried moving the diagram up by placing a  .sp -1v  right at the
start of the text block (which gets thrown into a diversion), and
the whole contents of the text block just disappear.

I'm using vanilla DWB 2.0 as provided by A. T. & T.

	Thanks for any answers,
	    ............... Henry
+-------------------+--------------------------+---------------------------+
| Henry McGilton    | Think of using TROFF as  |                           |
| Sun Microsystems  | writing microcode for a  | arpa: hmcgilton@sun.com   |
| 2550 Garcia       | typesetter, and you have | uucp: ...!sun!angel!henry |
| Mountain View, CA | the idea.                |                           |
+-------------------+--------------------------+---------------------------+

jaap+@andrew.cmu.edu (Jaap Akkerhuis) (12/23/89)

Excerpts from netnews.comp.text: 22-Dec-89 Negative Spacing in TROFF D..
Henry -- S. Products@Sun (1622)


Stuff deleted...

> I'm trying to work around an annoying
> problem placing PIC diagrams inside tables.

> When I format this through PIC | TBL | TROFF and so on, the top of the picture
> always comes out at the baseline of the text `some stuff'.  So
> I tried moving the diagram up by placing a  .sp -1v  right at the
> start of the text block (which gets thrown into a diversion), and
> the whole contents of the text block just disappear.

Well, you are tackling the problem from the wrong end. Let tbl or pic do
the work for you. See attached files for details.

	jaap
:               ---- CUT HERE ----
: This is a shar archive. Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: The rest of this file will extract:
: example
echo x - example
sed -e 's/^X//' > example <<'!End-Of-example!'
X.TL
XA test of pic in tables
X.AU
XJaap Akkerhuis
X.FS
X\(co Copyright 1989 Jaap Akkerhuis, All Rights Reserved
X.FE
X.SH
XWork done by tbl with spanned vertical column
X.LP
X.TS
Xtab(@);
Xl l l.
Xsome stuff@ @more stuff
X\^@T{
X.PS
Xbox
X.PE
XT}@\^
X\^@ @\^
X.TE
X.SH 
XWork done by pic with invisble boxes
X.LP
X.TS
Xtab(@);
Xl l l.
XT{
X.PS
Xbox invis "some" "stuff"
X.PE
XT}@T{
X.PS
Xbox
X.PE
XT}@T{
X.PS
Xbox invis "more stuff"
X.PE
XT}
X.PE
X.TE
X
!End-Of-example!
exit