lout-users
[Top][All Lists]
Advanced

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

Re: Nested numbered lists


From: Mark Summerfield
Subject: Re: Nested numbered lists
Date: Sun, 2 Jan 2011 08:43:09 +0000

Hi Paul,

On Sat, 1 Jan 2011 13:01:09 +0000
Paul Zarucki <address@hidden> wrote:
> Hi,
> 
> Thanks for your reply. I must also apologise for my multiple posts - I
> had some problems in signing up to the mailing list (obviously a real
> newbie)!
> 
> I was actually trying to produce a list with the following numbering
> format:
> 
> 1. Item one
>    1.1  sub-item one
>    1.2  sub-item two
>         1.2.1  sub-sub-item one
>         1.2.2  sub-sub-item two
>         ...
> 
> whereas Lout's default numbered list format produces this
> 
> 1 Item one
>    1  sub-item one
>    2  sub-item two
>         1  sub-sub-item one
>         2  sub-sub-item two
>         ...
> 
> It is not a show stopper for me if Lout can't produce this format.
> Since the Lout input files will be produced by software that I am
> writing, my software could add the appropriate text to each list's
> style option to achieve the required format (see my previous post).
> 
> Thanks for your help.

I find that lout can be persuaded to do most things. Here's how to do
the nested lists you want:


@SysInclude{doc}
@Doc
@Text @Begin
@List style{num.} labelwidth{1.5f}
@LI{Item 1
    @List style{1.num} labelwidth{2f}
    @LI{Sub item 1}
    @LI{Sub item 2
        @List style{1.2.num} labelwidth{2.75f}
        @LI{Subsub item 1}
        @LI{Subsub item 2}
        @RawEndList
    }
    @RawEndList
}
@LI{Item 2}
@EndList
@End @Text

If you wanted every item number to end with a dot just change the
styles, e.g., style{1.num} -> style{1.num.} etc.

It is of course a pity that a nested list can't know the number of the
item it occupies in its containing list (unless someone on the list
knows better?), but it is perfectly doable.

-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Advanced Qt Programming" - ISBN 0321635906
            http://www.qtrac.eu/aqpbook.html



reply via email to

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