lout-users
[Top][All Lists]
Advanced

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

Re: @ChapterHeadingFormat


From: Mark Summerfield
Subject: Re: @ChapterHeadingFormat
Date: Thu, 2 Dec 2010 08:04:34 +0000

On Thu, 2 Dec 2010 07:16:09 +1000 (EST)
"David Duffy" <address@hidden> wrote:
> On Tue, 30 Nov 2010, Mark Summerfield wrote:
> 
> > I want to set the @ChapterHeadingFormat to produce a 2 line high
> > chapter number (just the number, not the word 'Chapter') and then
> > the title.
> >
> > But the 'number' variable always contains the word 'Chapter'.
> >
> > I know I could get rid of the word by setting @ChapterWord{} but I
> > want to use the word 'Chapter' elsewhere (e.g., contents & page
> > headers).
> >
> > Is it possible? And if so, how?
> 
> Fiddle with @MajorNum in bookf (~ line 1167) ???

In the end this was my solution:

# book.lout (my copy of book)
@ChapterHeadingFormat   {
    title @Case {
    "Contents" @Yield{title}
    "Foreword" @Yield{title}
    "Introduction" @Yield{title}
    else @Yield{//2.5f} # Make room
    }
}

# defs.lout (my defs file)
import @BookSetup
def @ChapHead right tag {
    @Place address@hidden - 0.5i - ysize}
    {
        @GlobalPrintablePageWidth @Wide @Tbl
            marginvertical{0c}
            break{1fx nohyphen ragged}
            strut{no}
        {
        @Row format{
            @Cell font{Bold 108p}marginleft{0c}marginright{.25i}A|
            @Cell font{Bold 2.5f}marginright{0c}iv{ctr}B}
            address@hidden@TitleOf{tag}}
        }
    }
    # Or whatever one wants for the chapter heading
}

# per chapter
@Chapter
    @Title{The Title}
    @Tag{the.title}
@Begin
@ChapHead{the.title}
@LP
...


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Programming in Python 3" - ISBN 0321680561
            http://www.qtrac.eu/py3book.html



reply via email to

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