Distinguishing odd/even pages

Mark Summerfield <[email protected]>
Newsgroups gmane.comp.type-setting.lout
Organization Qtrac Ltd.
Message-ID <20120116083926.34986c29@dino>
Hi,

I need to output different things depending on whether a page is odd or
even.

I've tried this but it doesn't work:

def @PlaceAdvert left mark right advert
{
    @PageParityOf{mark} @Case {
    Odd @Yield @PlaceOddAdvert{advert}
    Even @Yield @PlaceEvenAdvert{advert}
    }
}

@NP
@PageMark{advert.a}
advert.a @PlaceAdvert{"publisher/Informit_7_00x9_00_bw_ad.eps"}
@NP

The error is:
page.lout:102:1: replacing unknown @Case option advert.a by Odd
page.lout:102:10: value of right parameter of && is not a simple word

What am I doing wrong?

And is there a nicer way to do it anyway where I don't have to create my
own @PageMarks?

Thanks!

-- 
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.