Underlining for everyone

Last-Updated: 2023-05-16

Sources

Underlining in groff

As explained in groff(7), to underline in nroff we use .ul, however in troff this only produces italic text. Thus some macro package have their own underlining macro − .UL for ms and .UNDERLINE for mom. If you do not want to use a macro package, Werner Lemberg shared a standalone macro for underlining (2010-08/msg00017).

Underlining with Werner's macro

The file ul.tmac contained in the tar archive (archive/ul.tmac) explains exactly how the two macros for underlining should be used:

This file defines two macros `.Underline' and `.Underline1', which underline its arguments continuously. They are completely transparent to justifying, this is, the text to be underlined (and the text surrounding it) is typeset identically to normal text, without any distortion in filling.
Contrary to `.Underline' where all arguments are underlined, `.Underline1' only takes two arguments, where the second is appended to the first without being underlined. This is useful for trailing punctuation, for example.
← Go back