RTF Bullet List Example

rtf
ckck picture ckck · Mar 12, 2013 · Viewed 17.6k times · Source

It seems impossible to find a very simple working example for an RTF bullet list that looks like this:

  • Hello
  • World
    • Nested (but with square as bullet please)
    • Also nested (also square bullet)
  • and regular again

I tried to make a small sample by using Word or TextEdit.app but they produce a lot of garbage. Can anyone help out?

Answer

ToastyMallows picture ToastyMallows · Jun 28, 2013

If you looked in the Word or Wordpad formatted RTF long enough, you would find some lines that look like this:

{\f2 {\pntext \'B7\tab}{*\pn\pnlvlblt\pnstart1{\pntxtb\'B7}}{\ltrch This is a test.}\li720\ri0\sa0\sb0\jclisttab\tx720\fi-360\ql\par}

{\f2 {\pntext \'B7\tab}{*\pn\pnlvlblt\pnstart1{\pntxtb\'B7}}{\ltrch So is this.}\li720\ri0\sa0\sb0\jclisttab\tx720\fi-360\ql\par}

This will format like this

  • This is a test.
  • So is this.

Nested lists are probably a little bit harder, but this is what you'll want if you don't have any nested lists.

Now it depends on what you want to do with this. If you're just displaying it, every tag means something useful. When I worked with lists, I was converting them to HTML, so a lot of the formatting tags (\li,\ri,\tx, etc.), I didn't need for my application because I was just using <ol>,<ul> and <li> tags. The main thing to see it the tag \pnlvlblt, which makes this list a bulleted list. Also, \'B7 is the actual unicode tag for the bullet, ·

The most updated specification of RTF is here:

https://www.microsoft.com/en-us/download/details.aspx?id=10725