New header for each chapter

Discuss the word processor
Post Reply
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

New header for each chapter

Post by Brigb »

I'm preparing books for publication and need a way to have a different header running from the second page of each chapter to its end. I've searched for help and tried various suggestions involving styles but they are either unintelligible to me or don't seem to work and I've tried a few ideas of my own. I've succeeded, with some difficulty, in getting the page numbers in footers to flow from page #1 in the first Chapter - though the numbering sequence doesn't flow consistently after that and I've found it necessary to add some page numbers manually. I expected the same method my work on headers, but it doesn't!!! Can anyone give me a simple, jargon free, step by step way to achieve what I want for headers please? I really will be most grateful (and relieved).
OpenOffice 4.1.7 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: New header for each chapter

Post by RoryOF »

A quick way, which may not suit you, is to apply a subtitle to each chapter, using a Heading style, so that for example one has

Code: Select all


Chapter 5 [in Heading Style 1]
Chapter Subtitle [n Heading Style 2]

Then, on the subsequent page headers, /Insert /Fields /Other : Document tab, Type: Chapter, Format: Chapter name, Level: 2

Look at the attached (quick and dirty) sample file.

Adjust the Heading level numbers to suit your requirements.
Attachments
sample.odt
(14.3 KiB) Downloaded 206 times
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: New header for each chapter

Post by John_Ha »

Brigb wrote:I ... need a way to have a different header running from the second page of each chapter to its end. I've searched for help and tried various suggestions involving styles but they are either unintelligible to me or don't seem to work
Basically, each page uses a Page Style and all pages using a given page style look identical as they use that page style. So all headers and all footers are identical on all pages using that page style.

Assume pages 1,2 and 3 use PageStyle_Tom, pages 4,5,6 and 7 use PageStyle_Dick and pages 8, 9 and 10 use PageStyle_Tom again.

Assume you want to put a different header on page 7 and 8. Therefore you must define a new page style PageStyle_Harry and apply it to pages 7 and 8.

The rule is: If the next page needs a different header, footer or different page style, then it must have a different page style from the previous page in order to make the change.

So, the first page in a chapter has PageStyle_FirstPageInChapter. The second and subsequent pages have PageStyle_SubsequentPagesInChapter. When you get to the next chapter the first page has PageStyle_FirstPageInChapter and the subsequent pages have PageStyle_SubsequentPagesInChapter.

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
greyinblue
Posts: 16
Joined: Wed Mar 07, 2018 3:14 pm

Re: New header for each chapter

Post by greyinblue »

I do this by putting the running chapter header field into left and right page styles. Then I define a paragraph style chapter heading to populate these. The paragraph chapter heading is set to include a page break beforehand and to be First Page style and always a right hand page, and it has the header unchecked. On the organizer tab set the next style to the left hand page.

This way the chapters will have only the chapter title and no header on the opening page of each chapter, and then the chapter title in the header of all subsequent pages to the end of the chapter.
AOO 4.1.7 and LO 7.1, Windows 10
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

Many thanks for this. I have been creating a new style for each chapter. In fact different style for page one of each chapter because I don't want the header to start until the second page. However, maybe I need to create separate styles for First pages, first page of first chapter, second and subsequent pages of each chapter. I'll try that, but OpenOffice programmers could make this so much easier by giving a drop down menu and OK button. I'll try that first, though don't have much confidence it will work!
OpenOffice 4.1.7 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: New header for each chapter

Post by RoryOF »

I use a ChapterPage style which is set as follows

Organiser tab: Next Style Default
Page tab: Format A5, Layout settings: Only right
Header tab: Header Off (unchecked)
Footer tab: Footer on (checked)

Then my Default Page Style is

Organiser tab: Next Style Default
Page tab: Format A5, Layouts settings Mirrored
Header tab: Header On (checked)
Footer tab: Footer off (unchecked)
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

I think I've solved. If you fiddle about long enough . . . I went to the bottom of chapter one page one, inserted a page break and selected the Page 2 style from the drop down box (didn't know what I'd find in there and no one's mentioned it.)
I do hope this may help others with the same problem. On the other hand, who knows what horrors are lurking!

Thanks for all the help and support folks. My wife (the author) will be delighted.
OpenOffice 4.1.7 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: New header for each chapter

Post by RoryOF »

Your method won't always work, as inserting a page break at bottom of a Chapter page will cause a paragraph mark in continuous text between p1 and p2, which may leave an oddly space bottom line on p1, broken mid line. It will be OK if P1 ends with the end of a paragraph..

Define styles as I suggest, insert a page break before a new chapter, using ChapterPage style, and all should be well.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

I SPOKE TOO SOON!!!!!!!!!! Here's what I'm doing:
1. My document, a complete book of 149 pages, is in Word 97 format. The page is formatted to the correct book size (including bleed) and margins.
2. I set up a style called OpeningPages in which there are no headers or footers and apply this to the first page and subsequent seven. That seems to work okay.
3. I then double clicked a called ChapterPageOne at the beginning of the first chapter. This has a footer but no header. I clicked in the first paragraph, went to format/paragraph/text flow and under Breaks clicked Insert, selected With Page Style, First Page and made the page number 1. I also selected orphan and widow control. That worked beautifully.
4. I went to the second page of the first chapter and opened a style I had created called ChapterPage2. This has both a header and a footer. However it also creates an unwanted header on the first page of the chapter and whatever I enter in the header appears there as well. I tried again. This time the header in Chapter one disappeared and the header in Chapter two contained the heading for Chapter one!!!!!!!!!!!!!
5. I've also put a page break at the end of chapter one choosing ChapterPageOne style from the drop down box. It's when I try to change that to ChapterPage2 on the second page of the second chapter that it all goes banana!

This is driving me crazy. Is it a bug in Writer or is there a step but I need to take but haven't? I've tried inserting a page break at the end of the first chapter first page but that does nothing.
OpenOffice 4.1.7 on Windows 10
Bill
Volunteer
Posts: 8929
Joined: Sat Nov 24, 2007 6:48 am

Re: New header for each chapter

Post by Bill »

Brigb wrote:I SPOKE TOO SOON!!!!!!!!!! Here's what I'm doing:
1. My document...is in Word 97 format.
That may be part of the problem. Word 97 format does not support page styles. When you reload the saved document, the page styles will be renamed, starting with "Default" for the style applied to the first page. Subsequent page styles will be named "Convert 1", "Convert 2", etc.
Brigb wrote:3. I then double clicked a called ChapterPageOne at the beginning of the first chapter. This has a footer but no header. I clicked in the first paragraph, went to format/paragraph/text flow and under Breaks clicked Insert, selected With Page Style, First Page...
I'm not sure what you did here. It seems that you applied the "ChapterPageOne" page style to the first page of the first chapter, then used the text flow settings of the first paragraph (the chapter title) to replace the "ChapterPageOne" style with the "First Page" page style.
AOO 4.1.14 on Ubuntu MATE 22.04
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

Thank you so much for the quick reply, Bill. I find it all very confusing. Why OO doesn't have all the page formatting in one place beats me. I'll try in odt format as see what happens. I'll also miss out the operations you kindly pointed out in your last para. But not until tomorrow!
OpenOffice 4.1.7 on Windows 10
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: New header for each chapter

Post by John_Ha »

See [Tutorial] Differences between Writer and MS Word files for a description of differences and for why you should always work in, and save Writer files as .odt, Calc files as .ods, Impress files as .odp etc.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

Many thanks for the help.

So I save the document first to RTF hoping that would make sure that styles etc. would be erased, then I saved it to .ODT.

The opening pages were set at default style and the first page of the first chapter as a first page with a footer only and page number one. Okay so far. I created a style called head&foot, clicked at the end of page 1 of chapter 1 selected insert/manual break/page/head&foot. This I expected to change page 2 of the chapter and subsequent pages to contain both headers and footers. Instead the first eight pages, which previously were set to default changed to head&foot and the remaining pages of chapter 1 had no header or footer. There really is something badly wrong with the system. Not only is it wrong but it is inconsistently wrong. What our earth is going on here? Would it not be simple to have an option under the Insert menu which put the style code in at the beginning of the page required and nullified previous codes.

I tried modifying the first page style so that the head&foot style was next. That didn't work either. I think I'm gonna have to give up unless somebody can suggest a solution that works. It seems from looking through notes on the forum that I'm not the only one who has problems of this kind.

I really do appreciate the time and effort forum members give to helping poor lost souls like me.
OpenOffice 4.1.7 on Windows 10
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: New header for each chapter

Post by John_Ha »

Brigb wrote:So I save the document first to RTF hoping that would make sure that styles etc. would be erased, then I saved it to .ODT.
No - do not do this as .rtf does not store everything a .odt does and it will erase some things but not others.

If you want to strip all formatting, save as a .txt file (or Select All and press Ctrl+M).

Read the tutorial you were pointed to and always work in, and save your file, as a .odt. Never use other formats.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

Thanks John. Still nowhere near a solution, I'm afraid. But I did think maybe text would be better. It should surely be possible to insert a style at the beginning of a section and have all the subsequent pages follow that style until it's changed again. It doesn't seem as if Write is capable of that.
OpenOffice 4.1.7 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: New header for each chapter

Post by RoryOF »

Attached is a template that should do what you want. Open It, Save immediately under a name like Test.odt, and play with it. It has simple instructions in the various sections. You can open a new file using the template (Save that new file as MyNovel.odt or similar) and then commence inserting your text, which you may do by Copy and Paste.
Attachments
chapters.ott
(15.94 KiB) Downloaded 235 times
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

Very many thanks for this Rory. Much appreciated. I look forward to playing with it.
OpenOffice 4.1.7 on Windows 10
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: New header for each chapter

Post by John_Ha »

It is much easier if we can see the file. Send a PM or email to Rory or I asking for our email ID so you can send the file and one of us will fix it for you.
Attachments
Clipboard01.png
Clipboard01.png (7.79 KiB) Viewed 8948 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

So sorry, Rory, but I'm not finding this at all easy. I need to amend some of the styles to include footer only and I'm not clear on which styles have been embedded. Also after the first page the next page is numbered 3 and the system won't let me change it to 2. Perhaps I'm descended from Jonah. :)
OpenOffice 4.1.7 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: New header for each chapter

Post by RoryOF »

The preliminary pages have footers only; also the Chapter pages; to see which styles are used, turn on Navigator (F5 key) and select Applied Styles from the dropdown on its bottom bar. In the template the preliminaries are numbered, shown as Page v at foot of the Table of contents, as front pages have a back page; the first Chapter Page is numbered 1.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: New header for each chapter

Post by John_Ha »

Brigb sent me the example file test document .odt below.
Test document.odt
As received
(9.55 KiB) Downloaded 215 times
I responded: See attached file where I have set the different page styles to different colours to make it obvious - it helps a lot!
Test document jh.odt
coloured pages
(9.88 KiB) Downloaded 264 times
If you type something like fred into a header or footer then fred is placed in every page using that page style. Page numbers can be different because the thing that is the same is the Page_number_Field.

Page Style Default is yellow. It has no header or footer

Page Style Chapter P1 is green. It has no header. It has a footer with page number.

Page Style ChapterSubPages is pink. It has a header with Chapter 1 in it. It had a footer with a page number.

So, every instance of a pink ChapterSubPages page will have Chapter 1 written in the header.

You therefore need a different page style for Chapter 2 subsequent pages which is, say, blue, and has Chapter 2 in the header.

If you rename ChapterSubPages to Chapter1SubPages you see you need the following Page Styles:

Default
Chapter P1
- Chapter1SubPages
> has Chapter 1 in header
Chapter P1
- Chapter2SubPages
> has Chapter 2 in header
...

It is very helpful to sketch all the page styles on a sheet of paper so you can see that if it looks different (ie one header is Chapter 1, another is Chapter 2) then it must have a different page style.

It is even more helpful to create a "skeleton book" in a folder with one sheet of paper at each place where the page style changes. It is then obvious.
ScanImage001.png
Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Brigb
Posts: 24
Joined: Thu Jan 07, 2021 7:13 pm

Re: New header for each chapter

Post by Brigb »

Thank you Bill and John for your support here. The answer is actually very simple so here's the solution I produced with help. To create a different header for each chapter each chapter has to have its own page style.

1. Create a page style for the first page of each chapter called CHPage1.This has the correct page format and footers only turned on. To achieve this:

Click the arrow on the right side of the style box (Found on the left-hand side the lower toolbar).
Select 'More'
click on the fourth icon from the left, which is the page icon.
In the drop down box right click and select 'New' to open styles window
Give the style a name of your choosing
click on the footer tab click in the box to switch footers on
click okay and the new style will appear in the styles drop down selection box.

2. Create a page style for the subsequent pages of chapter 1 by following the actions above but this time clicking on the header tab and turning headers on.

3. Here's a simple way TO create page styles for all subsequent chapter pages

open the page styles drop down by clicking 'More' from the styles menu on the toolbar. (Fourth icon along)
click on CH01 to highlight it
click on the icon in the top right of the drop down box and select New Style from Selection
give your new style the name CH02.
Then click modify to check that the page layout is right and headers and footers are turned on. I have found that sometimes OO changed the top and bottom margins, though it left the rest of the page information intact. It also occasionally undid the header setting.
Press OK and you have a new style set. Keep repeating this for as many chapters as you have in the book.

4. To create your book with default pages to begin with, there are chapter page with footers only and subsequent chapter pages with a header in which you can put the title of your chapter. For the first chapter you will need to select the option to change the page number to 1. After that page numbering will simply keep in sequence. Just keep inserting an appropriate manual break on the page before each new chapter and at the end of the first page of each chapter. This will ensure that your headers will only apply to the chapter in question and that the footers will run right through the document with the correct page number.

I did have a problem when inserting a Manual Break at the end of some pages. This seemed to be when the end of the page was in the middle of a widow and orphan control. In inserting the manual break the system simply inserted spaces at the beginning of the first line of text on the next page making it into a new paragraph. I found that by leaving the cursor in that space and inserting a manual break again headers appeared but I then had to reformat the paragraph that the system had mistakenly created so that there were no leading spaces. This seems to have solved the problem.

I do hope that my fellow authors and book publishers will find this helpful.
OpenOffice 4.1.7 on Windows 10
Post Reply