0

I'm trying to construct a nested bulleted list in roff. I'm on macOS, using GNU groff version 1.19.2.

From the roff documentation, it seems like the .IP macro is an appropriate way to do this. So I'm .IP for the bulleted items, in combination with .RS/.RE to indent the margin for the nested lists.

.SH "Nested three deep"
.IP \(bu 1
foo
.IP \(bu 1
bar
.RS
.IP \(bu 2
foo\-2
.IP \(bu 2
bar\-2
.RS
.IP \(bu 3
foo\-3
.IP \(bu 3
bar\-3
.RE
.IP \(bu 2
baz\-2
.RS
.IP \(bu 3
foo\-3
.RE
.IP \(bu 2
qux\-2
.RE
.IP \(bu 1
baz

But the bullet/text alignment on the first level of the list is incorrect: the text appears on the line below the bullet, not immediately after the bullet.

mis-formatted roff nested list

Anybody know what I'm doing wrong here?

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
  • 3
    Increase 1 to 2. `.IP \[bu] 2`. Use this same value thruout. Do not use 1 or 3. That does not do what you seem to think it does. – matt Dec 26 '18 at 19:19

1 Answers1

1

As pointed out by the first comment, you have a misconception regarding the 2nd argument (the number) to the .IP macro: it only adjusts the indent of the body text with respect to the bullet point.

The nested indentation is done with the .RS/.RE macros (RS=right shift).

Paul
  • 165
  • 6