Chapter number to follow after the chapter name

Discuss the word processor
Post Reply
rdenbak
Posts: 4
Joined: Tue May 12, 2020 8:56 pm

Chapter number to follow after the chapter name

Post by rdenbak »

Hi, I'm trying to get my head around the following: I want the chapter number to follow the chapter name in such a way that I can use the chapter number (not the chapter name) in the Header of the document.
So for example the chapter titles of a couple of chapters can be:
Amy goes to school - 1
Amy goes on holiday - 2
Amy stays with her grand-parents - 3

The headings of the pages should follow the numbering of the chapters, prefixed with a fixed text: "Chapter " and then followed by the actual number of the current chapter, i.e.:
Chapter 1
Chapter 2
Chapter 3

If tried many ways, but I fail to get this done. Can anybody help me?
OpenOffice 4.1.7 - Windows 10
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Chapter number to follow after the chapter name

Post by JeJe »

Explained in the help file.

Edit.
For the first step 4 don't type anything
Type "Chapter " in the header and add a field with just the Chapter number after it.
Inserting a Chapter Name and Number in a Header or a Footer
Before you can insert chapter information into a header or footer, you must first set the outline numbering options for the paragraph style that you want to use for chapter titles.
To Create a Paragraph Style for Chapter Titles
1. Choose Tools - Outline Numbering.
2. In the Style box, select the paragraph style that you want to use for chapter titles, for example, "Heading 1".
3. Select the numbering style for the chapter titles in the Number box, for example, "1,2,3...".
4. Type "Chapter" followed by a space in the Before box.
5. Enter a space in the After box.
6. Click OK.
To Insert the Chapter Name and Number in a Header or a Footer
1. Apply the paragraph style that you defined for chapter titles to the chapter headings in your document.
2. Choose Insert - Header or Insert - Footer, and then select the page style for the current page from the sub-menu.
3. Click in the header or footer.
4. Choose Insert - Fields - Other and click the Document tab.
5. Click "Chapter" in the Type list and "Chapter number and name" in the Format list.
6. Click Insert and then click Close.
The header on every page that uses the current page style automatically displays the chapter name and number.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Chapter number to follow after the chapter name

Post by JeJe »

Unless anyone knows better, there doesn't seem to be a way to change it so that the chapter number in the heading is after the heading text instead of before.

If you have to have it that way you can add a chapter number field at the end of every chapter heading.
There is still the problem of the chapter number appearing before the heading - that can be hidden by setting the numbering character style to one with white text so the number isn't seen. See attached doc.
Attachments
Chapter nos.odt
(9.26 KiB) Downloaded 141 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Bill
Volunteer
Posts: 8933
Joined: Sat Nov 24, 2007 6:48 am

Re: Chapter number to follow after the chapter name

Post by Bill »

JeJe wrote:Unless anyone knows better, there doesn't seem to be a way to change it so that the chapter number in the heading is after the heading text instead of before.
Chapter numbering is basically paragraph numbering, so I don't believe that it would be possible to put the automatic chapter number after the chapter name.
JeJe wrote:If you have to have it that way you can add a chapter number field at the end of every chapter heading.
There is still the problem of the chapter number appearing before the heading - that can be hidden by setting the numbering character style to one with white text so the number isn't seen. See attached doc.
This worked for me with limited testing when saving in .odt format, but in .doc format the chapter number field in the header of the first chapter displayed "2" instead of "1".
AOO 4.1.14 on Ubuntu MATE 22.04
rdenbak
Posts: 4
Joined: Tue May 12, 2020 8:56 pm

Re: Chapter number to follow after the chapter name

Post by rdenbak »

JeJe wrote:Unless anyone knows better, there doesn't seem to be a way to change it so that the chapter number in the heading is after the heading text instead of before.
Thanks for helping. I was aware of the Help text, but that did not solve the problem for me since I too could not get the number after the Paragraph heading.
I might need to seek for another solution to bypass this problem.
Again thanks for helping.
OpenOffice 4.1.7 - Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32658
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Chapter number to follow after the chapter name

Post by Hagar Delest »

It should be possible by using the trick explained in this tutorial: [Tutorial] "In-line" or "run-in" headings.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Bill
Volunteer
Posts: 8933
Joined: Sat Nov 24, 2007 6:48 am

Re: Chapter number to follow after the chapter name

Post by Bill »

Another possibility: Insert the normal chapter title, then cover (hide) it with a frame containing a chapter name field and a chapter number field. After inserting and formatting the frame over the first chapter title, it can be copied and pasted over the other chapter titles.
Attachments
Chapter_Name_Frame.odt
(9.57 KiB) Downloaded 131 times
AOO 4.1.14 on Ubuntu MATE 22.04
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Chapter number to follow after the chapter name

Post by JeJe »

A slightly better way of hiding the Chapter number than my earlier white text method is possibly to indent the first line of the paragraph so it is off page.
Attachments
Chapter headings indented.odt
(9.48 KiB) Downloaded 146 times
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Chapter number to follow after the chapter name

Post by RoryOF »

The Amy... lines are easier if you decide to use this format
1 - Amy ...
2 - Amy ...

that is, place the chapter number before the chapter title.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Chapter number to follow after the chapter name

Post by JeJe »

Hagar Delest -
An all white text paragraph above is an interesting idea - a paragraph style with hidden text above works as well, and there isn't a visible line above.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Hagar Delest
Moderator
Posts: 32658
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Chapter number to follow after the chapter name

Post by Hagar Delest »

I think we had this discussion at that time and IIRC a hidden paragraph style leads to... no entry in the ToC.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Chapter number to follow after the chapter name

Post by JeJe »

If I set heading 2 paragraph style font effects to hidden the TOC in that document you posted a link to works fine.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Hagar Delest
Moderator
Posts: 32658
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Chapter number to follow after the chapter name

Post by Hagar Delest »

Sure?
Have you updated the ToC? I just tried and the links disappear from the ToC. Can you upload a document that works so that I compare?
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Chapter number to follow after the chapter name

Post by JeJe »

You're right the links disappear from the ToC if you update it - so you'd have to turn the hidden effect off while you update the ToC.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Chapter number to follow after the chapter name

Post by keme »

It is possible, sort of. Much like the second post from JeJe above, but with some "control bits" added, and with a more intuitive workflow (methinks) than the solution for "inline headings".
  • Activate numbering for headings. Numbering followed by space, right aligned to zero, with zero indent. (Later you can adjust from this starting point.)
    When you right align the numbering, it does not interfere with placement of heading text. This may be confusing until you get the mindset. Without this, headings from 10 upwards may appear misaligned, depending on what other settings you have for font size and spacing.
  • Set character style for numbering to background color (usually white).
  • Create a new paragraph style - named say Heading repeat - based on Heading 1, but do not change any settings.
  • Create a frame without borders and without spacing, anchored as character, no spacing, bottom aligned to baseline, automatic heigth and width.
  • Place that frame on the end of the heading line.
  • Insert Chapter number field in the frame using the Heading repeat style you just created.
  • Copy that frame, and paste it into each heading where you want the numbering to appear.
With this, you get a numbering which does not interfere with ToC because it is "shielded" inside a frame. If you change the heading style, the numbering will follow suit, because its style is a clean link to the heading style.

I attached a template file which illustrates this. I made the numbering character style light grey so you see everything. Change that to white and you have your workaround.
 Edit: Forgot the page header, but I guess you'll figure that out... 
Should someone test the template in other office suite incarnations, note that LibreOffice sometimes displays erratic behavior when you adjust placement of outline elements. The attached template works fine as it is in LO, but does not react consistently to editing of those settings.
Attachments
NumberBackwards.ott
(10.61 KiB) Downloaded 141 times
Post Reply