1. troff question
I'm assisting a user who wants to continuously underline text
in fill mode with default adjustment (left and right margins)
I've looked in the recently posted UNIX FAQ, but found nothing
on troff, except a sentence or two stating what troff is.
Although I'm a (very?) knowledgeable user, I don't often (ever?)
do this. My usage of line drawing in generally to create or
duplicate forms via my own macro packages (which also contain
unskilled-user-friendly macros to format the text), together
with scripts for convenient invocation. In this sort of use,
I invoke .nf and .na before drawing the lines. Finally, I
abhor right adjusted margins, so, whenever I have a need to
underline text, I'm in no-adjust mode, and everything works
just the way one would like it to.
There is no problem as long as only 1 word is to be underlined,
but if several words are to be underlined, the effect is as if
adjustment were the last thing done before dumping the output
line buffer, so that the length of any horizontal line is
determined before adjustment. The result when underlining is
that the underline is shorter than the text, by exactly the
amount of the adjustment within the text of interest.
word1 word2 word3\l'|0\(ul'
word1 word2 word3\l'-\w'word1 word2 word3'u\(ul'
\kqword1 word2 word3\l'|\nqu\(ul'
all produce something like
word1 word2 word3
I've thought about using (and done some fooling around with)
various combinations of argument passing (to be able to
manipulate the same text repeatedly) with strings, diversions,
and a diversion trap (to determine when the output is filled),
but all my approaches are at best ugly, and I don't have a
way to measure the **adjusted** length of a **portion**
of the output line (ie, word1 word2 word3).
With a lot of a priori knowledge (ie, one or more
preliminary troff runs), I could hardwire stuff that might
work, but it's horrible. It would involve knowing, on the
output line, the text appearing before words 1,2,3 (text1)
and after them (text2), and passing arguments
into 2 diversions, one .na and the other .ad (a \p suffixed
to this one), getting the difference in lengths of the two,
dividing that by n-1 to obtain d (where n is the number of
words on the output line), augmenting d by the width of a
single blank, and then constructing yet another (adjusted)
text1 word1\h'\ndu'word2\h'\ndu'word3 text2\p
So, my question:
Does anybody have a better way?
2. HTTP & NIC cards: Performance issues
3. Segmentation Fault
4. Please HELP!! TROFF question!
5. can't build KPPP 3.0.1 on Solaris
6. Troff question
7. Sharing Linux box as a specific Workgroup using SAMBA
8. troff question
9. Basic basic troff question??!
10. troff question
11. nroff/troff question...