groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [groff] Creating a numbered list without macros


From: Ralph Corderoy
Subject: Re: [groff] Creating a numbered list without macros
Date: Sat, 11 Aug 2018 08:46:42 +0100

Hi Yves,

> What approach would I take? Is this something that can be done with
> tabs?

The tutorial in CSTR 54, logical page `- 32 -', defines the `lp'
labelled paragraph macro that uses tabs.  https://troff.org/54.pdf
If you're starting troff, that slim document is well worthy of repeated
careful study.

> a combination of indents?

Ted's pointed out the combination of indents.  Another way that's
sometimes seen is to move left with `\h' to out-dent the item's
`bullet'.

    $ cat list.tr 
    .na
    .nh
    .pl 10
    .ll 32
    .nr i 0 1
    .af i i
    Before.
    .sp
    .in 8
    .ds l "\n+i. \"
    \h'-\w'\*l'u'\*lFirst.
    .br
    .ds l "\n+i. \"
    \h'-\w'\*l'u'\*lSecond.
    A lot longer list item this time.
    .br
    .ds l "\n+i. \"
    \h'-\w'\*l'u'\*lThird.
    .in
    .sp
    After.
    $ 
    $ nroff list.tr
    Before.

         i. First.
        ii. Second.  A lot longer
            list item this time.
       iii. Third.

    After.


    $

The tedious repetition is well suited to being your own macro definition
you have in your prologue.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]