[comp.sys.sun] man pages and highlighting etc

pearmana@prl.philips.co.uk (03/26/91)

As a system administrator, I am often writing and installing new
commands/features for the users. This also involves writing online manual
pages  i.e.  nroff files - no problem.

I generally do my development on an HP9000-350 running HP-UX6.21 and then
copy the finished script/program plus man page to several target systems,
which include other HPs, Suns and Apollos.

The problem is that when I type:

      man command    

on the HPs, bold and underline work fine, whereas on the Suns it doesn't.

In fact, when using something like   man ls    on a Sun, whether in
Sunview, NeWS, or OpenWindows has no effect either.

The closest you get to correct display is when not in any windowing system
and then using ls.  This I think does something odd like making words that
should be underlined bold.

Anyway the point being that it doesn't seem to do what nroff says.

  Any ideas ?????
Andy Pearman, Computer Dept, Philips Research Labs, Redhill, Surrey, England. 
              pearmana@prl.philips.co.uk

eggert@twinsun.com (Paul Eggert) (04/02/91)

pearmana@prl.philips.co.uk writes:

  The problem is that when I type `man command' on the HPs,
  bold and underline work fine, whereas on the Suns it doesn't.

Sun is _still_ using old nroff, which doesn't distinguish boldface.
However, italics should work.  E.g. on my screen (Open Windows 2.0, SunOS
4.1.1, xterm), `man ls' underlines the italicized words.

  In fact, when using something like `man ls' on a Sun, whether in
  Sunview, NeWS, or OpenWindows has no effect either.

Try using xterm.  If you must use Sun's console emulation, try using a
copy of the `sun' termcap entry with the underlining capability
`us=\E[4m:ue=\E[m:' removed.  You may also have to fix the corresponding
terminfo entry.  Removing the underlining capability (which is often
broken) will make your pager fall back on highlighting, which should work.

But why settle for nroff-quality output if you're using OpenWindows?  You
can display PostScript output with

	setenv TCAT '(thack | pageview -mono -) <'
	man -t command

where you can substitute your favorite cat-to-PostScript filter for
`thack'.  The thack filter is available via anonymous FTP from
uunet.uu.net in comp.sources.misc/volume{7,8,10}/thack.*; several such
filters are available, but thack is the simplest.

glenn@uunet.uu.net (Glenn Herteg) (04/18/91)

In Sun-Spots v10n69, pearmana@prl.philips.co.uk writes:
[... bold and underlining from nroff don't show up ...]

I have modified my local copies of "man" and "catman" in the following
ways, by appropriate use of a binary editor:

The version of "man" differs from the standard SunOS 4.x version in that
it invokes "nroff -Tsun" instead of "nroff -Tlpr" when it formats manual
pages for a terminal device.  This terminal specification is used in
conjunction with a user-written "nroff" terminal-driving table called
"/usr/lib/term/tabsun", written for the SunView environment.  Use of this
table forces "nroff" to insert the correct escape sequences so boldface
characters appear as such in a SunView tty window, such as the one used by
"shelltool".  This version of "man" also changes the "-t" flag given to
troff (or the command specified with the TROFF environment variable) to
"-p", the equivalent flag accepted by eroff.

The version of "catman" differs from the standard SunOS 4.x version in
that, like the local "man", it invokes "nroff -Tsun" instead of "nroff
-Tlpr".

These fixes are used in conjunction with

setenv PAGER "more -c -f -s"

in my .login or .cshrc file, and modifications to the -man macros to
change the page width to 7.5i for nroff-formatted documents, and to change
the page length for nroff-formatted documents to 100i.  These changes to
the standard -man macros allow more of the manual page to fit across a
standard window, and they get rid of almost all those annoying header and
footer lines appearing in the middle of your screen.  Why Sun never
thought of this I'll never know; certainly the only reason to use nroff is
for terminal display, not for actual printing.

Finally, I have

/Tty/Bold_style "Offset_X"

in my .defaults file.  This allows boldface to actually show up as such.
Italics show up as underlined text automatically, as long as you have
/Tty/Underline_mode Enabled (this seems to be the default if you have
no similar line in your .defaults file).

This solution is not perfect, but it comes close.  It lets me preview my
manual pages on the screen as I write them, so I don't waste lots of paper
to get most formatting and fonts right.  There are a number of minor
glitches I wish Sun would fix, but there's not a snowball's ...  well,
they've moved on to OpenWindows and other pursuits.  I haven't yet tried
to set up the equivalent structure there.

Once this was all set up, I ran catman on all the standard Sun manual
pages, so everybody gets to take advantage of these improvements.  Also,
any new manual pages I write automatically get formatted cleanly, and
stored away in the cat? directories for future reference.

I wish I could coax Sun into supporting ditroff, -mm, man, and kin in a
completely clean way, to avoid all this trouble.  They are way behind the
current versions of these programs.  Does no one within Sun ever look at
on-line manual pages?