4

Can I put page number on the bottom of the outer margin?

enter image description here

Please, take a look at awesome answers in this question. It works fine with Latex. Can I get ConTeX solution?

Page number at the bottom outer page margin

1
  • \setuppagenumbering[location=inmargin] but that will still be in the footer. Commented Feb 24, 2018 at 21:08

2 Answers 2

5

The place the page number in the margins of the text area you can use the \setuptexttexts commands which takes the same arguments as the commands to place header and footer texts. The exact position of the number can be controlled with a frame where you set the vertical and horizontal position with the align key.

\setuppagenumbering[location=none]

\setuptexttexts[margin][][{\framed[frame=off,width=max,height=max,align={middle,low}]{\prefixedpagenumber}}]

\showframe

\starttext
\dorecurse{10}{\input lorem\par}
\stoptext

Page number in the margins of the text area

4
  • 1
    \setuptexttexts. I didn't know that one. (+1) Commented Feb 24, 2018 at 22:45
  • It' almost perfect..but...How to change vertical position of page number to match baseline? I can change it even manually, but how?
    – ReRunner
    Commented Feb 25, 2018 at 17:49
  • @ReRunner When you enable blank lines between paragraphs (\setupwhitespace[big]) the last line of the page will be at the same height as the page number. Commented Feb 28, 2018 at 9:43
  • 1
    @ReRunner \framed[frame=off,width=max,height=max,align={middle,low},offset=\dimexpr\topskip-\strutht+.5\linewidth\relax]{\prefixedpagenumber} Commented Feb 28, 2018 at 20:19
3

There is no predefined location in the outer margin of the text block. You have to use layers for that. I adapted a really old solution of Wolfgang on the mailing list. You can consult his post if you need doublesided page numbers.

\setuppagenumbering[location=]

\definelayer
  [pagenumber]
  [width=\rightmarginwidth,
   height=\textheight]

\startsetups[pagenumber]
  \setlayer
    [pagenumber]
    [preset=middlebottom]
    {\strut\pagenumber}
\stopsetups

\setupbackgrounds[state=repeat]

\setupbackgrounds
  [text][rightmargin]
  [background=pagenumber,
   setups=pagenumber]

\starttext

\dorecurse{10}{\input lorem}

\stoptext

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .