# Header and Footer needed outside the page margin

Hello, I have a page format/margin (For odd-numbered pages left 1.5", top 1.5", right 1" and bottom 1" and for even numbered pages left 1’, right 1.5’, top 1.5’, bottom 1’' where " means inches. So i have given mirror image and the page margins as stated. But now if i give header and footer, the header and footers come inside/within the page margins and hence further decrease the space. But headers and footers should come outside the page margins right..?? (i think in this way, so..) or is this wrong what i have said.. So, how to put the headers and footers outside the prescribed page margins..??

Thank you.

edit retag close merge delete

Margin is whitespace, non-printable area. So nothing is in it. Next header and footer come, and next is page body.

( 2017-11-14 14:09:35 +0200 )edit

Sort by » oldest newest most voted

By design (I'm not saying it's a good design, just that it's by design), Writer includes headers and footers on the text area:

The only way around this is to reduce the top and bottom margins to get the right distance from page border to text area. Note that while editing the page style, on the corresponding header/footer tab you can set the vertical space taken by the header/footer.

more

Writer doesn't include headers/footers into text body. It separates the three areas (margins, header/footer, and page body) from each other, and allows to control them precisely (unlike in some other suites). Placing them inside some other area is wrong and not flexible.

Btw: the premise of that bug is wrong, than "I can't know exactly how tall a margin is" - the user just didn't try to understand the logic behind that.

( 2017-11-14 14:16:05 +0200 )edit

I did not say text body, but text area. Let's use headers as example. On LaTeX when you set margins with the help of geometry package, you set the distance from page border to text area and then how much the header is above that text area. On Writer you set the text area border and the header goes bellow that border. Not a tragedy, of course, you can always work out the right settings to get the same results: it's just different. But, IMO, LaTeX way is easier.

( 2017-11-15 00:07:17 +0200 )edit

Hmm. Yes, definitely, setting how much header is above is much easier than setting how much it is below...

( 2017-11-15 05:43:19 +0200 )edit

It is, because you don't need to figure out where the text area boundaries will fall. When you write a thesis or specially a legal document you may face strict formatting rules, and usually text area boundaries are far more important than header or footer positioning. Yes, on Writer you can (1) set the header size and then (2) subtract that value to the top margin to (3) get the needed distance from page border to the real text area, but that is two more steps than what you need on LaTeX.

( 2017-11-15 19:49:57 +0200 )edit

LO Wrtiter has a different approach to page real estate management than M\$ Word.

Il Writer, margin are no man's land forbidden to text flow. Only manually positioned objects, such as frames, can reside in there.

So, the question is: what is your page design? Draw a schema for your page. Set the margins which are "true" non-printing margins. Sketch the position of your header/footer and decide whether they have a fixed or adaptative height.

From your question, your consider the margins as defining the area where your text will be printed. With elementary arithmetic, you can compute the Writer-style margins dimensions then customise your page style in the Header or Footer tab. Spacing measures the white space between the header/footer and the text area. Size is the minimal height devoted to the header/footer and can made fixed if you uncheck the dynamic height check box.

If this answer helped you, please accept it by clicking the check mark to the left and, karma permitting, upvote it. If this is what you expected, close the question, that will help other people with the same question.

more

The bug tdf#33304 meanwhile was marked RESOLVED NOTABUG.
However some users still seem to have problems with adjusting the margins complying with their intention to place a header inside the area that was defined as the margin in advance of the insertion.

To ease those of them who can accept support by user code (supposed to get assigned to a sensitive area in the Format toolbar), I want to post a raw draft of a Sub doing the needed complicated calculations and setting the new margin based on the result.

Sub insertHeaderIfMissingAndAdjustMargin(Optional pDoc As Object, _
Optional pPageStylePtr As Object, Optional pMinPrintMargin As Long, _
Const minHbd As Long = 200, minPm As Long = 400
If IsMissing(pDoc) Then pDoc = ThisComponent
If NOT pDoc.supportsService _
("com.sun.star.text.GenericTextDocument") Then Exit Sub
REM There may be lots of possible errors not catched by the code,
REM in specific the current selection as the default PageStylePointer
REM may not (directly) have a .PageStyleName property.
REM The CurrentSelection should be an ordinary position within the bodytext
REM on a page having set the page style which shall be processed.
On Error Goto errorCase
If IsMissing(pPageStylePtr) Then pPageStylePtr = pDoc.CurrentSelection(0)
If IsMissing(pMinPrintMargin) Then pMinPrintMargin = minPm
If pMinPrintMargin<minPM Then pMinPrintMargin = minPm
pageStyles = pDoc.StyleFamilies.PageStyles
pgSName = pPageStylePtr.PageStyleName
pgS = pageStyles.getByName(pgSName)
With pgs
marginCorrection = _
End With
newMargin = pgS.TopMargin - marginCorrection
If newMargin<pMinPrintMargin Then newMargin = pMinPrintMargin
pgS.TopMargin = newMargin
errorCase:
End Sub


The complicated calculations I was talking of you find here:

 marginCorrection = _

The sole actual problem is to know the true height of the header itself if .HeaderIsDynamicHeight is True. That's the property shown as AutoFit height in the English UI. You should probably better switch this property off by an additional line of code and define the .HeaderHeight explicitly meeting your needs.