3

I currently have a file that I'd like to pass through a _roff to format with underline a few words in the file, and then view the file in less. Just a few, mind you, not whole sections or anything.

How do i underline specific words in a file with _roff?

NB: I know I have groff and nroff.
NNB: I don't know a whole lot about type formatting.

J. Polfer
  • 131
  • 2

1 Answers1

2

At least with groff (I'm not sure it's portable), .ul gives you underline.

groff -Tascii <'<EOF'
This is a single line
.ul
with four underlined words
and more non-underline words.
EOF

If the only formatting you want is underlining, there may be an easier way. For example less automatically converts the sequence character-backspace-underscore (or underscore-backspace-character) to the underlined character; it also converts character-backspace-character to boldface.

echo $'one u\b_n\b_d\b_e\b_r\b_l\b_i\b_n\b_e\b_d\b_ word' | less
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175