groff
[Top][All Lists]
Advanced

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

Re: [Groff] Line fragments with .TS and .PSPIC


From: Werner LEMBERG
Subject: Re: [Groff] Line fragments with .TS and .PSPIC
Date: Sun, 21 Aug 2005 12:28:16 +0200 (CEST)

> Whenever I insert a table or an image, there seems to be a hard
> carriage return that prints out a line fragment instead of carrying
> that text to be filled with the next line of input after the table.

Here is a quick and dirty solution for -ms.  Note the `.LP' at the
very beginning -- without it, the ms initialization overwrites the
macro definitions of .TS and .TE


    Werner


======================================================================


.\" This call to .LP initializes .TS and .TE so that we can overwrite
.\" them safely.
.LP
.
.
.de print-here-table
.  \" Remove just planted trap.
.  wh \\n[here-trap]u
.
.  \" Switch to another environment to preserve current partial line.
.  ev here-table
.  \" Copy main environment.
.  evc 0
.
.  \" Insert pre-table vertical space.
.  sp \\n[DD]u
.
.  \" Emit table.
.  nf
.  here-table
.  fi
.
.  \" Insert post-table vertical space.
.  sp \\n[DD]u
.
.  \" Switch back to main environment.
.  ev
..
.
.
.de TS
.  \" Switch to another environment to preserve current partial line.
.  ev here-table
.  \" Copy main environment.
.  evc 0
.
.  \" Start diversion.
.  di here-table
..
.
.
.de TE
.  \" End here-table diversion.
.  di
.
.  \" Switch back to main environment.
.  ev
.
.  \" Set trap and store current vertical position.
.  nr here-trap (\\n[nl] + 1)
.  wh \\n[here-trap]u print-here-table
..
.
.
This is the text that goes before the table.
This is some more text that goes before the table.
I suppose I could have used a larger point size to
make it easier but I didn't think of that until now.
.TS
nokeep;
l l
l l.
entry1  entry2
entry3  entry4
entry5  entry6
entry7  entry8
.TE
.
This text follows the table.
Here is some more text to follow the table.




reply via email to

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