[NTG-context] page number with brief centered line above

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Thu May 14 17:28:04 CEST 2020


jbf schrieb am 14.05.2020 um 07:30:
> Hi list,
>
> I am trying to achieve a layout where there is a brief line above the 
> bottom-centered page number (of a double-sided document). I am able to 
> achieve the centered bottom-located page number easily and obviously 
> enough with:
>
> \setuppagenumbering
>   [alternative=doublesided,location={footer,middle}]
> \setupfooter
>   [style=bold]
>
> And I was able to achieve a result with a short line above where the 
> page number should be - but by adopting the solution below I have now 
> lost the page number.
>
> \setuppagenumbering
>   [alternative=doublesided,location={footer,middle}]
> \setupfootertexts[{\framed[frame=off,topframe=on,width=.5\textwidth]}]
You forgot the braces for the argument of \framed.
> So then I thought that having left out any reference to page numbers I 
> had better put it in, so I added [pagenumber] to the above, but I 
> ended up with two page numbers, one centered, the other to the inner 
> or outer margins (depending on recto/verso), and the line was likewise 
> to the right or left of the centred number. So clearly not what I want.
>
> Maybe the solution lies with some combination of the above I haven't 
> thought of, or maybe there is another solution altogether. Any thoughts?

1. Add a rule at the top of the footer.

\setuppagenumbering
   [location=footer]

\setupfooter
   [text]
   [before=\hrule]

\starttext
\page[dummy]
\stoptext


2. Put the page number in a frame (preferred method).

\setuppagenumbering
   [location=]

\setupfootertexts
   [{\framed[width=max,frame=off,topframe=on]{\pagenumber}}]

\starttext
\page[dummy]
\stoptext

Wolfgang



More information about the ntg-context mailing list