[net.text] Fix for .hl within .

isaac@mulga.OZ (Isaac Balbin) (02/11/86)

For those who can't remember, essentially all I wanted to do was 
.(b
.hl
.PS
.\" pic stuff
.PE
.ce
Figure 1
.hl
.)b
It is a fairly common thing to do because one would like to group
the picture, the horizontals and the Figure number on one page if possible.
Alas, the horizontal line came out dashed and far too long.
Someone, suggested using .(b L, which *may* help some time but not always.
Certainly, not for me. That heuristic was tried before!
Clearly there is something very wrong, and believe it or not, 
it wasn't -me at fault either. Many thanks to Jim Barby for setting me straight
on that one. I enclose his fix for all you other tormented dtroff users.
> It sounds like you have a .PS/.PE inside a .(b/.)b which can
> result in a problem
> 	.\" environment is fine here
> 	.(b	\" this does a '.ev 1'
> 	.\" environment is fine here
> 	.PS	\" this does a '.ev 1'
> 	.\" pic changes the line length, font, indent, etc.
> 	.\" environment is fine here
> 	.PE	\" this does a '.ev'
> 	.\" environment is WRONG here
> 	.)b	\" this does a '.ev'
> 	.\" environment is fine here
> The problem is that troff stacks the environments correctly
> but not the environment numbers.  To over come this problem I
> wrote a short macro to reset my environment to my 'paragraph'
> environment.  And then I append to the .PE a call to my reset
> macro.  (This is works so long as between the .PE and .)b
> you want your paragraph environment.)  The following is what
> I mean.
> 	.de RS		\" paragraph type reset macro  .RS
> 	.ce 0
> 	.ul 0
> 	.in \\n($iu+\\n(pou
> 	.@F \\n(pf
> 	.sz \\n(ppu
> 	.fi
> 	..	\" RS end
> 	.\"
> 	.am PE
> 	.RS
> 	..
> The .RS is just a hack of -me's .@p macro.  The problem
> mentioned above about .PS/.PE inside any keep also holds for
> a .TS/.TE inside any keep.  So long as you realize what is
> going on ways around the problem exist.
> Good luck,
> Jim Barby
			Isaac Balbin

"If I knew him; I'd be him" 

UUCP:	{seismo,mcvax,ukc,ubc-vision}!munnari!isaac
ARPA:	isaac%munnari.oz@seismo.css.gov
CSNET:	isaac%munnari.oz@australia