Recurring element for page number outside of header

Hello, our new letter template is supposed to have the page number on the right side of the text. I found the workaround to anchor a text box to the header and extend it downwards in order to add text outside of the header. With the anchor to the header the text appears on every new page at the desired position. But it seems I cannot add any fields like page number / page count in a text box. Frames on the other side cannot be extended outside of the header. Is there any way to achieve this?

Text boxes are “decorative” elements outside the usual Writer devices. They are “external” so that they don’t interfere with the mechanisms for flow control, cross-references, TOC collection, headings, …

What you need is a side annotation where you put the page number (a field variable). That’s exactly what frames are made for.

To get this frame automatically repeated on every page, it needs to be anchored to a header or footer paragraph. You already found that.

  1. After having enabled header in the page style, Insert>Frame in the header. Don’t worry for the attributes now.

  2. Insert>Field>Page Number

  3. Right-click on the frame and Properties

  4. In the Type tab:

    • Set Size to AutoSize or to your preferred fixed dimensions

    • Make sure Anchor is To paragraph

    • Use Position to move the frame where you want it

      • Horizontal: Center relative to Left page border
      • Vertical: Center relative to Entire page
      • Make sure Keep inside text boundaries is unchecked because you want to position the frame outside its “natural” area
    • In case the frame may overlap the paragraph area (which is doubtful if you only have the page number with a wide enough margin), change Wrap mode to Parallel with some Spacing around

The preview in Type can gives you an idea of where the frame will land in the page. Experiment with the various sub-areas offered by the menu.

The “recipe” above sends your page number systematically in the left margin. If you want the page number in the outer margin (for double-sided print, alternating between left and right margins), you must disable Same content in left/right pages in the page style Header tab and repeat the procedure in the left and right header, changing Left page border to Right page border in the right header.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

EDIT 1 Added a clarification about Keep inside text boundaries after the feedback in a comment below.

Thanks so much for the detailed response! I had tried this workflow more or less but I could not position the frame outside of my header which I need for this template.

But unchecking “Keep inside text boundaries” fixed that.

I omitted this setting because it is not checked by default. Apologies for having forgotten it: the frame is effectively positioned outside it text boundary (the header).