Page Numbers on Outer Edge of Outer Margin
Hi, I have a rather wide, 41mm, outer margin in a manual and I am trying to put the page number into the margin like so: \setuppagenumbering[ alternative=doublesided, location={header, margin}, style=bold, ] The trouble is that the page number is only a few millimetres wide and gets positioned on the inside edge of my outside margin. Hence, it does not end up close enough to the edge of the page. I guess, I would like to right-align it 4mm from the edge of a right-hand page and left-align it by the same amount from the edge of a left-hand page. Is that doable? Thank you, Malte.
Am 12.01.2013 um 14:49 schrieb Malte Stien
Hi,
I have a rather wide, 41mm, outer margin in a manual and I am trying to put the page number into the margin like so:
\setuppagenumbering[ alternative=doublesided, location={header, margin}, style=bold, ]
The trouble is that the page number is only a few millimetres wide and gets positioned on the inside edge of my outside margin. Hence, it does not end up close enough to the edge of the page. I guess, I would like to right-align it 4mm from the edge of a right-hand page and left-align it by the same amount from the edge of a left-hand page. Is that doable?
Method 1: \setuppagenumbering[alternative=doublesided,location=] \definelayer[pagenumber][doublesided=yes,width=\paperwidth,height=\paperheight] \startsetups[pagenumber] \setlayer[pagenumber][even][preset=lefttop, x=4mm,y=\topspace]{\strut\bf\userpagenumber} \setlayer[pagenumber][odd] [preset=righttop,x=4mm,y=\topspace]{\strut\bf\userpagenumber} \stopsetups \setupbackgrounds[page][background=pagenumber,setups=pagenumber] \starttext \showframe \dorecurse{10}{\dontleavehmode\page} \stoptext Method 2: \setuppagenumbering[alternative=doublesided,location=] \setupheadertexts [margin] [][\rightaligned{\bf\userpagenumber}] [\leftaligned{\bf\userpagenumber}][] \setupheader[margin][align=outer] \starttext \showframe \dorecurse{10}{\dontleavehmode\page} \stoptext Wolfgang
On 2013–01–13 Malte Stien wrote:
The trouble is that the page number is only a few millimetres wide and gets positioned on the inside edge of my outside margin. Hence, it does not end up close enough to the edge of the page. I guess, I would like to right-align it 4mm from the edge of a right-hand page and left-align it by the same amount from the edge of a left-hand page. Is that doable?
You can use the `command` key to hook in a custom macro which does the placement. \setuppagenumbering [alternative=doublesided, location={header, margin}, style=bold, command=\PageNumberCommand] \starttexdefinition PageNumberCommand #pageno \signalrightpage \doifrightpageelse {\rightaligned{#pageno}} {\leftaligned{#pageno}} \stoptexdefinition Marco
Am 12.01.2013 um 15:23 schrieb Marco Patzer
On 2013–01–13 Malte Stien wrote:
The trouble is that the page number is only a few millimetres wide and gets positioned on the inside edge of my outside margin. Hence, it does not end up close enough to the edge of the page. I guess, I would like to right-align it 4mm from the edge of a right-hand page and left-align it by the same amount from the edge of a left-hand page. Is that doable?
You can use the `command` key to hook in a custom macro which does the placement.
\setuppagenumbering [alternative=doublesided, location={header, margin}, style=bold, command=\PageNumberCommand]
\starttexdefinition PageNumberCommand #pageno \signalrightpage \doifrightpageelse {\rightaligned{#pageno}} {\leftaligned{#pageno}} \stoptexdefinition
Marco
When you’re in the header you can just use \doifoddpageelse to set different values for left/right pages, \signalrightpage is only necessary for text *in* the document. Wolfgang
participants (3)
-
Malte Stien
-
Marco Patzer
-
Wolfgang Schuster