How do I Alternate headers and page styles for different 1st page of chapter?

If it makes a difference I am on Libreoffice 6.0.7.3 on 64bit windows 7.
This is a little more complicated.
Thoughts and workaround appreciated.
I have a novel with parts Header 1 and chapters header2.

In principle I should be able to define several page styles and set the headers for each style. Simple right?
sotestformatnewdocument.odt

  1. Book part with next style book part
    no problem — when I define a new part I
    set Header 1 to the part name and
    page style appropriately and
    suppress header
    2 Chapter goes to chapter
    no problem – when I define
    a new chapter I set Header 2 to the
    chapter title and set page style and
    insert Chapter title field to header 2

Problem occurs when I try to add a page style to suppress the header of 1st page of chapter.
The pattern would say. Set page style without header and next style as Chapter.
1st page style with chapter as next style
kill header
Change page style on first page of chapter.
If necessary reset second page to chapter style.

Only this only works for the very first chapter in the document. No other change will work correctly. Not only that but somethings the system starts overriding all headers and styles in the document.
Uploaded file is the document for an entirely new document with manually entered data. and the paste multiple chapters file
testformatpastetextmultichapters.odt
Thanks in advance. Maurice

Remember that headers are a property of page style. To change header, you must change page style, but beware! there is only one header per page style. This means: if you reuse the same page style somewhere else in your book, you get the same header. Changing the header will change it in every occurrence of the page style. This can be solved with field insertion so that the header is dynamically computed from page content.

From your question, I assume you already use fields to have a “variable” header.

Page styles can be configured to behave as “first page special” and left/right pages. These are 2 options found in the Header tab of the page style dialog. You check Header on to enable headers and uncheck Same contents on first page with the effect the page style becomes two related styles.

If you don’t want a header on the first page of the sequence controlled by the page styles, just erase anything present in the header. Don’t uncheck Header on because it will remove all headers.

Finally, to start a new chapter, don’t forget you need a page break to force use of a new style. This page break is preferentially stored in a paragraph style, Text Flow tab or provided with Insert>Manual break but this is direct formatting, a bad practice which will play nasty tricks on your back sooner or later.

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!

EDIT 2018-12-12

I checked your attached file. You nearly made it!

I suggest you modify Heading 1, Text Flow tab to Insert a )page break Before with page style Part header. Similarly, insert page break to Chapter in *Heading 2, Text Flow` tab.

You can then delete your manual page breaks. Styling your headings with Heading n automatically does the page trick.

I noticed in file testformatpastetextmultichapters.odt you manually inserted chapter numbers. You can have your chapters automatically numbered through playing with Tools>Chapter Numbering. Don’t number level 1, start at level 2.

Also, you seem to want page numbers at outer margin. You correctly set page layout as Mirrored and unchecked Same content on left and right pages. But you used the same paragraph style Footer for both pages, which forced you to define tabs at the right margin. What will happen if you change your margins in the page style? Your right tab will no longer be where you expect it. This is solved by using paragraph styles Footer Left and Footer Right in the respective pages. Just change Alignment to right in Footer Right and you’re immune to any margin adjustments.

It was a good try but I tried this method and it does not work correctly. At least for my purposes.

I need a solution that lets me skip chapter headings with each new chapter.
This method lets me skip the 1st page with a ‘chapter’ style in the entire document

That is not helpful since there are 3 parts and 23 chapters.

In fact it is worse than that. If I have
Chapter style 15 pages
Part style 1 page
Chapter style 20 pages

then the 1st page different solution only works for the original Chapter and not in the second.

If I had to guess I would say that whoever coded this is not processing Styles as a hierarchical document.
That is the original problem I spotted.
Even the pattern
Chapter 1st style with next Chapter Style,
Chapter style,
Chapter 1st style with next Chapter Style

will not work correctly and accept the Chapter style to Chapter 1st Style.
Again the coder seems to be working at the document level rather than processing the Style changes in sequence

It works perfectly provided you associate every chapter start with a forced page break to the adequate page style. This is usually done in Heading 1 (if this is the style for chapter heading). You didn’t tell what “parts” are for you. Are they Heading 1? In which case chapters are shifted to Heading 2, but it works the same.

The Same content checkbox is a poor man’s substitute for the “professional” one with 3 separate styles linked through Next Style field. But it should work. I’m no developer but the feature is fit fpr hierarchical documents. You could perhaps upload somewhere a slimmed down version of your document so that I could have a look.

Thanks for sticking with this.

I understand what you say and I have done all that you suggest.
Using ctl enter and manual insert page break between chapters.
the document refuses to create a new Chapter 1st page header.on subsequent chapter page styles.

One observation, simply using a forced page break would never be a reliable way to trigger a new 1st page. There are many cases with a printed document where a forced page break is needed that does not mean a new chapter.

New chapter would have to be triggered by a new heading 2 and a page break. Since you are certain this is not a bug or design flaw, hopefully that is the way it is implemented.

Let me work on this today and I will try to get a stripped down example to upload.
Maurice

Ctrl+Enter just inserts a page break, keeping the current page style. You must Insert>Manual Break so that you can choose to which page style you break. The most reliable way is to encode this switch within a paragraph style definition so that it becomes automatic as soon as you choose the paragraph style.

Ok, I have part of this figured out although there are still mysteries.
It turns out that I cannot take an existing file and change the page styles. It just doesn’t work regardless of how I use page breaks. I can’t even take a multi-page document with various headers and cut and paste the entire document.

When I started a new document and began to test the 1st page different for the page style it did not work at all. I haven’t even tried to debug that because my preferred solution does work. different left right does work.

My original plan to have ‘chapter 1st page’ and ‘chapter’ page styles does work
as long as I enter text by hand and insert the proper manual page breaks for new chapters. Or I can paste each chapter with a leading manual page break.

So I get to insert the 23 chapter and 4 part book chapter by chapter. Fun and games but doable.
I hunted around and could not see how to upload my test file.
Thanks for sticking with this

I’ve upvoted your question. You now have enough karma point to attach your file (it must be done wit question editing because you can’t attach files to comments).

Thanks for the help! Looks like using the header properties to set page breaks and style actually got the document recognizing subsequent Chapter>Chapter 1st page transitions!!!
Libreoffice just does not like manual assignments.
Your observation that headers where a property of Page Styles was a key observation. That helps immensely when thinking about the process.