WRITER: Relationship between page margins and other typographic elements

I am preparing a complex template for writer, whose layout must correspond to a predefined graphic project, which gives me the height of the body of text, the height of the header, the distance between header and body of text, the height of the footer and the distance between footer and body of text.

I need to know: does the page size as set in [format -> page -> page -> margins -> top / bottom] also include the space assigned to header and footer? If I increase the height of the header [format -> page -> header -> spacing / height] is this increase added or subtracted to the values ​​set in the “margins” tab? And if I increase the height of the header spacing [format -> page -> header -> spacing / height] is this increase subtracted from the height of the header or from the height of the body of text?

In other (and simpler) words: given ct = height of the body of text, h = height of the header, dh = distance between header and body of text, f = height of the footer, df = distance between body of text and footer, which values ​​must I insert in the window [format → page]?


  1. Left margin
  2. Right margin
  3. Top margin
  4. Page border line width
  5. Page border shadow distance
  6. Page border padding left
  7. Page border padding right
  8. Page border padding top
  9. Header left margin
  10. Header right margin
  11. Header spacing
  12. Header height
  13. Header text area*
  14. Header border line width
  15. Header border shadow distance
  16. Header border padding left
  17. Header border padding right
  18. Header border padding top
  19. Header border padding bottom

Items 1-3 are set at Page Style dialog’s Page tab.
Items 4-8 are defined on tab Borders.
Items 9-12 are from Header tab.
Items 14-19 are on Border tab of the dialog available by clicking on More... button on Header tab of Page Style dialog.
Item 13* is not defined explicitly; see its discussion below.

Items 4 and 14 are measured in points (pt = 1/72 in); units of other items follow user preferences (OptionsLibreOffice WriterGeneral).

Most of the elements are quite straightforward and obvious from the schema and their naming; possibly the not-so-obvious fact needs mentioning that border widths are added to the spacings; and that 12 = 14 + 18 + 13* + 19 + 14 + 15. However, there are two options on the Header tab, that affect items 11, 12, 13*, and need additional explanation, namely:

  • [ ] Use dynamic spacing
  • [ ] AutoFit height

When both of these checkboxes are unchecked, the values of items 11 (Header spacing) and 12 (Header height) are used strictly as set. Any content of header’s text area (13*) that doesn’t fit will be cut off.

When AutoFit height is checked, 12 is considered minimal height of the header: if text contents doesn’t fit into 13* that results from the set elements’ sizes, it will expand the height downwards as needed, shifting 11 downwards (height of 11 is unchanged) and decreasing main page text body height.

When both AutoFit height and Use dynamic spacing are checked, then the height of 12 is also minimum, and grows when 13* needs; but when growing, initially it borrows space from 11 (header spacing), thus the total height of 11 + 12 doesn’t change, and main page text body’s top doesn’t move. Only when header spacing is depleted, further growth of 13* (and 12) will start borrow space from main page text body height.

Checking Use dynamic spacing alone doesn’t make sense, and behaves as if 12 is set to 11+12, and 11 is set to 0.

Only one word: waouh! I’d give +5 if I could, but I’m limited to +1

I thought it’s worth to share what I learned from trying to improve our interoperability with Word in this area, where our layout is very different from Word’s (to the extent that some layouts possible in LO are totally impossible in Word, and vice versa) … Glad you find it useful!

In Writer, contrary to Word, page margins define an absolutely-no-print area. No element (apart from manually positioned frames) will ever be laid out in the margins.

The remaining area in the page is shared by the header, the text body, the footer and spacings between there elements.

h + dh + ct + df +f = page_height - top_margin - bottom_margin

Use this formula to compute the value for the top and bottom margins. Also, in your page styles, make sure boxes AutoFit height and Use dynamic spacing are unchecked (Header and Footer tabs) so that your paragraph styles and spacing height settings will dictate the dimensions without adjustment by Writer.

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) or comment the relevant answer.

Wonderful answer, but I does not have enough points to upvote. Thanks.