lout-users
[Top][All Lists]
Advanced

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

Re: Section page numbering?


From: Valeriy E. Ushakov
Subject: Re: Section page numbering?
Date: Thu, 13 Jul 2000 20:51:24 +0400
User-agent: Mutt/1.3.3i

On Tue, Jul 11, 2000 at 08:33:45 -0500, Neumann, Matthew C wrote:

> is in its own section.  I'd like to be able to put a header at the top of
> each page that has the name of the table (the section @Title) and a "Page x
> of n" counter-- where x is the number of pages since the beginning of the
> section and n is the number of pages in the section.  I'd also like a small
> footer that has the number of the section, a @DashJoin, and the number "x",
> the number of pages since the beginning of the section.

Standard documemt types don't provide an easy "public" way to do this.
However you can tweak just a few lines in `dsf' to hack you way
through it.

In the body of @LargeScaleStructure (at the very end of `dsf') add a
marker right after the body, e.g.:

       //  @Body                        # <-- after this line
       //  @PageMark tag."last.page"    # <-- add this line

This will tag the last page of the section.


Then you need to change @MakePageNum to compute section length and
return the "x of n" for the page number.  E.g.

    def @MakePageNum
        named numbers {}
        named rawnum {}
        named prefix {}
        named owner {}
    {
        def @OwnerNum { @PageMarker&&owner @Open { rawnum } }
        def @OwnerLastNum { @PageMarker&&owner."last.page" @Open { rawnum } }

        def @RelativeNum { @FirstPageNumber @Plus rawnum @Minus @OwnerNum }
        def @TotalNum { @OwnerLastNum @Minus @OwnerNum @Plus 1 }

        @address@hidden @Case {
            { Titles.Yes NoTitles.Yes } @Yield {
                { numbers @Num @RelativeNum } "of" @TotalNum
            }
            else @Yield { numbers @Num rawnum }
        }
    }

Then running headers will be handed this "x of n" for their @PageNum.

Of course this is a hack.  The real solution is to change running page
headers to receive all this information in separate pieces, so that
you can construct "x of n" in the header and "N-x" in the footer
(where N is the section number).  Whith this hack "x of n" is passed
as one entity, so you can not extract the "x" part for the "N-x"
footer.

Generalizing this is not a probelm *technically*, but needs a well
understood protocol (i.e. what information to pass, what formatting
control to provide, how this interacts with other features &c).

"last.page" is simple as there's only one last page in the document
that you can refer to unambiguously.   But running headers are
context-sensitive and they need information like current section info
supplied by the context.

Well, I guess what I want to say is that there's a difference between
"Lout, the Language" and "Lout, the Application" (standard packages).
Lout (the language) can do this, but you need to tweak Lout (the app)
to do it.

Sorry if this sounds too confusing...  Just mail me directly if you
need further assistance.

SY, Uwe
-- 
address@hidden                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen


reply via email to

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