[Top][All Lists]

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

Getting a List of Sections at Start of Chapters

From: Mark Summerfield
Subject: Getting a List of Sections at Start of Chapters
Date: Sat, 28 Oct 2006 16:48:11 +0100
User-agent: KMail/1.9.4


I'm trying to write a lout definition that I can place at the beginning of
each chapter and that will show the list of the chapter's sections. So for
example, I want to get output of the form:

    Chapter                     * First Section's Title
    Number                      * Second Section's Title
    In Big                      * Third Section's Title
    Font                        * Fourth Section's Title
                                * Fifth Section's Title

So at the beginning of each chapter I have lout like this:

    @Title{ Using IDLE }
Start of text...

The definition I have is this:

import @BookSetup 
def @ChapTop
    one{} two{} three{} four{} five{} six{}
    right tag
    @Place x{1.5i}y{top - 0.5i - ysize}
        {{Schoolbook Base address@hidden @NumberOf{tag}}
    @Place x{3.5i} y{top - 0.5i - ysize}
    4i @Wide @Tbl
        break{ragged nohyphen 1vx}
        font{Schoolbook Slope 10p}
        address@hidden width{0.2i}A|@Cell width{2.36i}marginright{0c}B|}
        one @Case {
            {}   @Yield @Null
            else @Yield address@hidden address@hidden address@hidden
        two @Case {
            {}   @Yield @Null
            else @Yield address@hidden address@hidden address@hidden
        three @Case {
            {}   @Yield @Null
            else @Yield address@hidden address@hidden address@hidden
        four @Case {
            {}   @Yield @Null
            else @Yield address@hidden address@hidden address@hidden
        five @Case {
            {}   @Yield @Null
            else @Yield address@hidden address@hidden address@hidden
        six @Case {
            {}   @Yield @Null
            else @Yield address@hidden address@hidden address@hidden

The definition is placed _after_ @SysInclude{book}. But when I run lout I

    defs-extra.lout:40:26: fatal error: no current font at this point

Line 40 is the "else" line in the "two" case.

I tried getting rid of the @TitleOfs and using literal text. I tried putting
@Font's before every piece of text, i.e., 
    {Schoolbook Base address@hidden
etc., and just about everything else I can think of. I wouldn't be at all
surprised if the problem is nothing to do with fonts at all, although when I
tried raw lout instead of using a @Tbl, I hit the same problem.

(I also get an unresolved cross-reference for the first @Place, but that's
due to the fact that lout can't run more than once due to the fatal error,
so I'm not concerned about it.)

Can anyone give me some suggestions, or has anyone got a definition that
does the kind of thing I want that they'd be willing to share?


Mark Summerfield, Qtrac Ltd., www.qtrac.eu

reply via email to

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