# Reverse page layout in ConTeXt for two-sided RTL document

I'm trying to create a two-sided document in an RTL language. I'd like to reverse the margins, so that the first page has the binding on the right side, rather than on the left.

Obviously I could supply a layout where the inner margin is wider than the outer margin, or insert an empty first page. I'd like to know if there's a right way to do this, however.

\setuppagenumbering[alternative=doublesided]
\setupdirections[bidi=global,method=one]
\setupalign[r2l]

\starttext
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\stoptext


Thank you.

What you try to achieve isn't possible yet and ConTeXt can only create documents which start with a right side. This means in a single sided document each page is right sided and in a double sided document the first odd page is also a right page.

\setuppapersize[A6]

\setuppagenumbering[alternative=doublesided]

\showframe

\starttext

\dorecurse{3}
{\doifrightpageelse{Right page}{Left page}\par
\doifoddpageelse  {Odd page}  {Even page}\page}
\stoptext


A simple hack to to simulate a document which goes from right to left and start with a left page is to increase the realpage counter because this skips the first right page and goes to the next left page.

\setuppapersize[A6]

\setuppagenumbering[alternative=doublesided]

\showframe

\setcounter[realpage][2]

\starttext

\dorecurse{3}
{\doifrightpageelse{Right page}{Left page}\par
\doifoddpageelse  {Odd page}  {Even page}\page}
\stoptext

\stoptext


While this produces the expected output it can have unwanted side effects because left pages have now even numbers with the internal counter.

The better solution is to ask for a proper implementation of this because it can be done but needs proper testing because many commands have different output for left and right pages.