[net.unix-wizards] troff underlining problem

harv%ksuvax1.BITNET@WISCVM.arpa (Harvard Townsend) (07/07/86)

We are running the `troff' which comes with 4.2BSD on a VAX 11/780 (not
`ditroff').  Has anyone fixed the way it does underlining?  The problem
shows up in 2 places.  The first is when an underlined word is hyphenated
and thus spread across 2 lines.  The underline is drawn on the second line,
extending on into the left margin since it is expecting to underline the
first part of the word which is on the line above.  This also happens when
you are underlining a phrase which gets split across 2 lines.  The other
problem shows up when underlining a phrase, even if it is not split across
2 lines.  If some white space is added between words in the phrase (in
fill mode) to get justification of the right margin, the phrase then
extends past the end of the underline.  The length of the underline is not
adjusted to account for the extra space added between the words in the phrase.
The horizontal motion apparently is calculated before the hyphenation and
justification is done.
I'm assuming it is a troff problem, rather than the device driver (we
are printing the documents on a QMS Lasergraphix 800.  "qcat" does
the CAT-to-QUIC code translation).  Shutting off hyphenation and
underlining individual words instead of phrases has gotten us by when
needed, but I would like to fix the problem.  Does `ditroff' handle
this properly?  If so, can anyone point me to a `ditroff' implementation
for 4.2BSD on a VAX?  I appreciate any help.
______________________________________
Harvard Townsend, Systems Administrator
Kansas State University
Dept. of Computer Science
Manhattan, KS 66506   (913)532-6350
CSNET:  harv@kansas-state -or- harv%kansas-state@csnet-relay.arpa
BITNET: harv@ksuvax1.bitnet -or- harv%ksuvax1.bitnet@WISCVM.WISC.EDU
UUCP: ihnp4!ltuxa!ksuvax1!harv

wa263@sdcc12.UUCP (bookmark) (07/10/86)

In article <1997@brl-smoke.ARPA>, 
harv%ksuvax1.BITNET@WISCVM.arpa (Harvard Townsend) writes:
> We are running the `troff' which comes with 4.2BSD on a VAX 11/780 (not
> `ditroff').  Has anyone fixed the way it does underlining?  The problem
> shows up in 2 places.  The first is when an underlined word is hyphenated
> and thus spread across 2 lines.  The underline is drawn on the second line,
> extending on into the left margin since it is expecting to underline the
> first part of the word which is on the line above.  This also happens when
> you are underlining a phrase which gets split across 2 lines.  The other
> problem shows up when underlining a phrase, even if it is not split across
> 2 lines.  If some white space is added between words in the phrase (in
> fill mode) to get justification of the right margin, the phrase then
> extends past the end of the underline.  The length of the underline is not
> adjusted to account for the extra space
> added between the words in the phrase.
> The horizontal motion apparently is calculated before the hyphenation and
> justification is done.
> I'm assuming it is a troff problem [...]
> 
> Harvard Townsend, Systems Administrator

	This is not a troff problem, really.  It's not clear what macro
package is being used, but any underlining command (like -ms's .UL) has
to use troff's movement and line drawing commands (\l) to put a line
under a word, because troff doesn't handle underlining itself (you're
supposed to use alternate fonts, like italic and boldface fonts).  The
-ms macros, for instance, work by asking troff for the width of the material
to be hyphenated (\w function) and then using movement and line-drawing
functions to underline the stuff (\h,\l commands).  Since troff calculates
the width without reference to any possible future hyphenation or
justification, the macro which draws the line can go wrong when these occur.

	Switching to ditroff will not help; it doesn't know any more about
underlining than troff.  (Though, perhaps, you could get an "underline"
font for ditroff use...)  The correct thing to do is:  underline single
words only, either with hyphenation off or with the macro modified to prepend
\% to the each word; or, stop trying to underline things, and use italics.
The second choice is better.


					bookmark@sdcsvax.ARPA
					bookmark@sdcsvax.UCSD.EDU

hartley@uvm-gen.UUCP (07/11/86)

> In article <1997@brl-smoke.ARPA>, 
> harv%ksuvax1.BITNET@WISCVM.arpa (Harvard Townsend) writes:
>> We are running the `troff' which comes with 4.2BSD on a VAX 11/780 (not
>> `ditroff').  Has anyone fixed the way it does underlining?
> 
> The correct thing to do is:  underline single
> words only, either with hyphenation off or with the macro modified to prepend
> \% to the each word; or, stop trying to underline things, and use italics.
> The second choice is better.
> 
Another possibility is to put "\ " or "\0" instead of just a blank between
the words in a phrase to be underlined.  This way the correct length will be
computed by troff.  Still hyphenation problems, though ...