ConTeXt's page setup seems to be very powerful for single pages. But as I am used to the powers of KOMA there is something I could not achieve: twoside=semi.

From what I have read I need to set up the page numbering to alternative=doublesided for being able to differentiate between odd and even pages. However, this will force the layout to flip sides (margins are adapted). Basically, I want to have the following layout (not to scale).

-----------------------  -----------------------
|                     |  |                     |
| -- ---------------  |  | --  --------------  |
| || |             |  |  | ||  |            |  |
| || |             |  |  | ||  |            |  |
| || |             |  |  | ||  |            |  |
| || |             |  |  | ||  |            |  |
| -- ---------------  |  | --  --------------  |
|                     |  |                     |
| ------------------  |  | ------------------  |
| | #                 |  |                # |  |
| ------------------  |  | ------------------  |
|                     |  |                     |
-----------------------  -----------------------

Code for a single-sided version:

\setuppagenumbering [alternative=singlesided,location={footer}]

\setuplayout        [grid=yes,
                     rightedge=1.25cm,
                     rightmargin=0pt,
                     rightmargindistance=0pt,
                     backspace=6cm,
                     leftmargin=4cm,
                     width=fit]
\showframe


\starttext
    Quack\margintext{Test}
    \page
    Quack\margintext{Test}
    \page
    Quack\margintext{Test}
\stoptext

So my question is: How to get double-sided page numbers while having a single-sided margin setup (margin with margin text on the left)?

What I have tried:

  • messing around with footer setup and page number modulo 2 expressions
  • layers (unfortunately their odd and even page detection only works for alternative=doublesided)
  • using alternative=doublesided and \definelayout[even][…] to be the same as the \setuplayout
up vote 4 down vote accepted

To create a document which has left and right pages but use the same layout for both of them use location={singlesided,doublesided} for \setuppagenumbering.

The location of the page numbers can be set with the \setupfootertexts command but you have add location= (or location=none) to \setuppagenumbering to disable the automatic placement of the number.

\setuppagenumbering
  [location=,
   alternative={doublesided,singlesided}]

\setupfootertexts
  [] [pagenumber]
  [pagenumber] []

\starttext
\dorecurse{2}{\page[dummy]}
\stoptext
  • Thank you. This seems to work for centered page numbers, but how may I achieve the effect depicted in the ASCII "art" in my question (page numbers that work like double-sided). Simply adding margin or marginedge turns out to keep the page number on one side throughout the document. Btw: Where are those options documented? I did not find them on wiki.contextgarden.net/Command/setuppagenumbering. – TeXnician Sep 14 at 12:38

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.