|
Home > Archive > Unix Programming > June 2005 > Page break in man page messes up a table
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Page break in man page messes up a table
|
|
| impslayer@hotmail.com 2005-06-29, 7:53 am |
| Hi,
Subject says it all, hopefully... On HP-UX I have a man page
containing a boxed table set up with .TS and .TE and the usual
stuff in between. Looks good until a page break splits the
table up. Then the box around the table gets totally misplaced
spilling out on the new page.
Anyone has a solution for this? Some hard page break maybe?
Adding a few empty lines will make the table look good again,
but that might obviously break when text is added/removed in
the man page.
Regards,
/impslayer
| |
| Rich Teer 2005-06-29, 5:53 pm |
| On Wed, 29 Jun 2005 impslayer@hotmail.com wrote:
> Subject says it all, hopefully... On HP-UX I have a man page
> containing a boxed table set up with .TS and .TE and the usual
> stuff in between. Looks good until a page break splits the
> table up. Then the box around the table gets totally misplaced
> spilling out on the new page.
>
> Anyone has a solution for this? Some hard page break maybe?
Does using .KS and .KE before and after the table help? (I forget
if those macros are in the man package or not; they're definately
part of the ms macros).
HTH,
--
Rich Teer, SCNA, SCSA, OpenSolaris CAB member
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
| |
| Floyd L. Davidson 2005-06-29, 5:53 pm |
| impslayer@hotmail.com wrote:
>Hi,
>
>Subject says it all, hopefully... On HP-UX I have a man page
I assume you are looking at PostScript output? Or at least
something from troff, not nroff, right?
Part of the problem is to make these things conditional to
troff and be ignored by nroff, so that printed pages look
right but so do the man pages displayed on an ascii terminal.
>containing a boxed table set up with .TS and .TE and the usual
>stuff in between. Looks good until a page break splits the
>table up. Then the box around the table gets totally misplaced
>spilling out on the new page.
>
>Anyone has a solution for this? Some hard page break maybe?
Put .bp just before the .TS; and if it helps put .bp after
the .TE too. That will force page breaks, putting the table
all alone on a page by itself.
Another trick that can sometimes be used to make things look
nicer is to adjust the line spacing to make things "fit" a
little better. Font size could also be adjusted the same
way, though that may or may not be of any value, and is
commented out in this example:
..if t \{
.. bp
.. /" save the current vertical size of the font
.. nr VS \n(.s
.. /" set vertical spacing to something appropriate
.. vs 14.2
.. /" Change font size too
.. /" .ps 13.5
\}
..TS
....
..TE
..if t \{
.. /" re-set vertical spacing and font size
.. vs \n(VS
.. /" .ps \n(VS
.. bp
\}
>Adding a few empty lines will make the table look good again,
>but that might obviously break when text is added/removed in
>the man page.
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
| |
| impslayer 2005-06-30, 6:02 pm |
| Thanks for the input, putting a '.bp' actually did it!
I did try just that before I posted my question, but I put it just
before the .TS which
didn't work as there was a .PP too! Putting the .bp before the .PP did
the trick!
(Not that I actually know what a .PP is...)
Excellent! Thumbs up, guys!
/impslayer
| |
| Floyd L. Davidson 2005-06-30, 6:02 pm |
| "impslayer" <impslayer@hotmail.com> wrote:
>Thanks for the input, putting a '.bp' actually did it!
>I did try just that before I posted my question, but I put it just
>before the .TS which
>didn't work as there was a .PP too! Putting the .bp before the .PP did
>the trick!
>(Not that I actually know what a .PP is...)
..PP starts a paragraph.
.LP
.PP
.P These macros are mutual aliases. Any of them
causes a line break at the current position,
followed by a vertical space downwards by the
amount specified by the PD macro. The font
size and shape are reset to the default value
(10pt resp. Roman). Finally, the current left
margin is restored.
I'm not sure I'd recommend anyone waste the time really learning
[gnt]roff these days (given that TeX is so much better for
everything except man pages), but if you *really* want to know
what all of this stuff does... go to a used book store and have
them find a copy of "UNIX Text Processing" by Dougherty and
O'Reilly, published by Hayden Books in 1987, and long since out
of print. And of course if you write many man pages, it really
is nice to know [gnt]roff rather than just the man page macros.
However, "man groff_man" on systems with groff (or use google to
find an online copy), will tell you specifically about macros
for man pages. Also it is *really* useful to look at what others
have done with man pages. For example, (z)grepping for 'tbl' or for
'^\.TS' in /usr/man/man1 provides a lot of information about how
others have coded man pages.
There must be some half decent online tutorials for groff, but
I don't know about them.
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
|
|
|
|
|