No paragraph spacing at top of page - but only for some styles

I am aware of the compatibility option “Add paragraph and table spacing at tops of pages” - with this disabled, if I have a style that calls for spacing above paragraph, that spacing is ignored if the heading is the first thing on a page (but the spacing appears if the heading appears in the middle of a page). I’m trying to understand if it’s possible for this spacing to be ignored at the top of a page for one style, but to always be used for a different style.

Here’s an example. I would like to use Heading 1 for Chapter Titles, and would like the title always to appear 1.5" from the top of the page margin. Normally I would do this by (1) setting the Heading 1 style to include spacing of 1.5" above the paragraph and (2) checking the “Add paragraph and table spacing…” compatibility option. But I also want to use Heading 2 throughout the chapter - with space above Heading 2 if it’s in the middle of a page, but with no space if it’s the first thing on the page. Normally, I would do this by (1) setting the spacing in the Header 2 style, and (2) unchecking the compatibility option. But clearly, this can’t be checked and unchecked at the same time.

I know that one path is to uncheck the compatibility option (so spacing is ignored if a Heading is at the top of a page) and use extra returns above Heading 1 to move it down the page. Since I’m also looking to export as an epub, however, I’d like to avoid this option if possible (in order to help keep the code clean).

Is there another way to configure the document so Heading 1 always has space above it (even when it’s the first think on a page), but Heading 2 only has space when it appears in the middle of a page?

If the Chapter heading is always on a new page, you can create a special style for that page with more space for the Header so the Chapter title is effectively in the same place as measured from the edge of the page

Interesting - I hadn’t though about adjusting the style of the page in addition to the style of the header.

If I understand your suggestion correctly, I would:

  • Uncheck the compatibility setting (so Headings at the top of a page won’t have extra space, regardless of the style setting)
  • Configure Heading 2 (used in the middle of chapters) to have space before the paragraph (so there is space above Heading 2 if it’s in the middle of a page, but no space if it’s at the top of a page)
  • Set up a new page style (“Chapter Title”) with a larger header (so the first text is 1.5" from what is normally the top margin)
  • Always use Heading 1 with the Chapter Title page style. The compatibility option will strip off any space before the paragraph in Heading 1, but the Chapter Title page style will move it back down the page to where I want it.

Does that sound about right?

Yes, you have it. If you aren’t using a header, just set to top margin 1.5" greater than your normal page style
Set the next page style following “Chapter Title” page to be your normal page style.

Thanks. I can see that this will work, but am now having problems getting the new page style to “stick” to the chapter title page. Will look into this a little more and open a separate thread if I can’t figure it out myself. Thanks again for your good help here -

Modify the Heading 1 style to create a page break before it and specify the “Chapter Title” page style.

In sample below I have just used First Page as it existed. Look at the heading style for Heading 1, tab Text Flow under Breaks. Note the margins aren’t the same as yours.
ChapterOnNewPage.odt (50.8 KB)

Wow - well done. Thanks again - you just saved me hours of work on this :grinning:

This should never be done if you try to create “dynamic” headers, e.g. headers echoing the chapter heading (title). The device capturing the page state (heading level and title) only looks at the first paragraph of the page. Consequently if you add an empty paragraph to force spacing before your Heading 1 paragraph, Writer will see only the empty paragraph and would consider your page to belong in the previous chapter (eventually no chapter if this is the first chapter). It would then report the wrong chapter heading and number in the header.