ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* even odd page condition
@ 2012-06-06 15:13 Pavel Dohnal
  2012-06-06 15:29 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Dohnal @ 2012-06-06 15:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,
is it possible to find if you’re on an odd or an even page in context?
I want to do something like this:

\def\makemytext#1{
    %if page is even
        \rightaligned{#1}
    %else
        \leftaligned{#1}
}

Thanks for the answer.
Pavel Dohnal
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: even odd page condition
  2012-06-06 15:13 even odd page condition Pavel Dohnal
@ 2012-06-06 15:29 ` Wolfgang Schuster
  2012-06-06 15:40   ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2012-06-06 15:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 06.06.2012 um 17:13 schrieb Pavel Dohnal:

> Hello,
> is it possible to find if you’re on an odd or an even page in context?
> I want to do something like this:
> 
> \def\makemytext#1{
>    %if page is even
>        \rightaligned{#1}
>    %else
>        \leftaligned{#1}
> }

\defineframed[noframed][frame=off,width=broad,align=outer]

\setuppagenumbering[alternative=doublesided]

\starttext
\noframed{Left or right?}
\page
\noframed{Left or right?}
\stoptext

or

\define[1]\AlignOuter
  {\doifoddpageelse\rightaligned\leftaligned{#1}}

\starttext
\AlignOuter{Left or right?}
\page
\AlignOuter{Left or right?}
\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: even odd page condition
  2012-06-06 15:29 ` Wolfgang Schuster
@ 2012-06-06 15:40   ` Aditya Mahajan
  2012-06-06 19:53     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2012-06-06 15:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 6 Jun 2012, Wolfgang Schuster wrote:

>
> \define[1]\AlignOuter
>  {\doifoddpageelse\rightaligned\leftaligned{#1}}

you can simplify this to:

\define\AlignOuter
   {\doifoddpageelse\rightaligned\leftaligned}

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: even odd page condition
  2012-06-06 15:40   ` Aditya Mahajan
@ 2012-06-06 19:53     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2012-06-06 19:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 6-6-2012 17:40, Aditya Mahajan wrote:
> On Wed, 6 Jun 2012, Wolfgang Schuster wrote:
>
>>
>> \define[1]\AlignOuter
>> {\doifoddpageelse\rightaligned\leftaligned{#1}}
>
> you can simplify this to:
>
> \define\AlignOuter
> {\doifoddpageelse\rightaligned\leftaligned}

there's also the pair:

\signalrightpage
\doifrightpageelse

where the signal generates a node

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-06 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-06 15:13 even odd page condition Pavel Dohnal
2012-06-06 15:29 ` Wolfgang Schuster
2012-06-06 15:40   ` Aditya Mahajan
2012-06-06 19:53     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).