# ConTeXt doublesided starts with left-hand page

I'm trying to change an existing document to double-sided, but ConTeXt seems to have incorrect behaviour by default, which is messing up margins and page numbering.

As far as I know the general convention for two sided documents is to start with the first page (cover/title page) that is the on the right-hand side, but ConTeXt is placing the first page as the left. This means that when you view the document in a two-sided viewing mode (in Mac OS X's Preview app or Adobe Reader with the 'Show Cover Page in Two Page View' option selected), the page numbers are on the wrong sides and the larger margin is on the outside instead of the inside. This is also a problem when the document is printed with two-side printing.

I can't work out how to get the correct behaviour and hours of Googling and reading through documentation and manuals has come to no solutions. How can I force the cover page to be right-hand sided?

This minimal example exhibits the problematic behaviour:

``````\setuppagenumbering[alternative=doublesided,location={footer,marginedge}, style=bold]

\starttext
First page
\page
Second page
\page
Third page
\stoptext
``````

The first page is a right (recto) page. You merely confused `marginedge` with `inmargin` (I guess).

``````\setuppapersize[A6][A6] % tiny paper for demo

\setuppagenumbering
[
alternative=doublesided,
location={footer,inmargin},
style=bold,
]

\starttext
First page
\rightorleftpageaction{recto}{verso}
\page
Second page
\rightorleftpageaction{recto}{verso}
\page
Third page
\rightorleftpageaction{recto}{verso}
\stoptext
``````

• Thanks, that puts the page numbers on the correct side. The default margins still seem reversed to me though (the larger margin is on the outside of the page, but the inside margin should be bigger to account for the spine (like a gutter margin). Jun 8 '17 at 7:31
• @StephenG No, the inside margin is always smaller than the outside margin. What you are referring to is called binding correction and is tuned by either `cutspace` or `backspace` in `\setuplayout` (I don't remember which one, just try it out). Jun 8 '17 at 7:58

This is what I get if I compile your example using `ConTeXt version: 2017.01.27` (as displayed on Adobe Acrobat)

The first page is on the right. Do you get a different output?

To fix the location of the page numbers, you can use:

``````\setuppagenumbering[alternative=doublesided,location=, style=bold]
\setupfootertexts[][pagenumber]
``````
• The page number is on the left. A recto page should have the page number on the right.
– TH.
Jun 8 '17 at 6:17
• @TH. See edited answer Jun 8 '17 at 6:19
• I don't know context, but `location` should be how the page number location is controlled, according to the manual. It seems strange to me to need to specify the location like that.
– TH.
Jun 8 '17 at 6:21
• @TH. I agree that ideally one should use the `location` keyword (as you had shown in your answer, why did you delete it?). However, in most real documents, one needs to set headers and footers anyways and I find it simpler to think of what goes in the header and footer (including the pagenumer) and leave the `location` field of `\setuppagenumbering` empty. Jun 8 '17 at 6:28
• that makes sense. I deleted my answer because Henri's contained the same information (replacing `marginedge` with something else) but I thought it was a better answer than mine.
– TH.
Jun 8 '17 at 6:31