Creating Page Numbers In LibreOffice With Converted Styles

Hello All!

I have been through the forums here as much as I can and I cannot find the help I need to my - very specific problem.

Here goes. I am a novel writer and I recently left Google Docs (yeah!). My last few books were written and configured there, so I converted them from the .doc format to the .docx format when I left. I have those files exactly as I need them to convert to PDF for my printer so my books look exactly like they are supposed to. Those files are fine.

My problem is this: I am writing new manuscripts on LibreOffice (25.2.7.2 - x86_64) for Windows 11. I figured the easiest way for a non-computer inclined person such as myself to get the formatting right was to take one of my prior novel files and just clean out the text after the title page. This allowed me keep the title, copyright, dedication pages all exactly where they are supposed to be and start the Prologue/Chapter 1 with the exact right spacing at the top of the page to remain consistent through my books.

I am on physical page 5 of the book, where my Prologue begins. I want this to be numbered as Page 1 of the book and I do not want the page number to appear on this page, I would like the page numbers to start at the top of page 2. I already have 23 pages written, with a few blank pages (to put the section break title pages on the appropriate side of the book).

Here is my specific problem: On the first page of the Prologue, the page style is “Converted1” and I cannot access/change the page numbers for that (it does not currently have any). I’ve read other forums/answers here and I see the predominate answer to this problem being "Use the ‘Text Flow’ tab under the ‘Paragraph’ settings under the ‘Format’ option. I’ve tried that. EVERY time I put my cursor at the top of page 5 and go to the ‘Text Flow’ option, it INSERTS a break, a new “Blank Page”, which puts Page 1 on the wrong side of the book. Deleting that page deletes that and the blank page that is the back of the dedication page.

I have gone round and round and round and there is nothing I have been able to do that:

  • simply inserts a page number on page 5 as “1,”
  • maintains the current physical pages of the book where they are supposed to be,
  • makes it easy to continue this book with all of the default settings/spacing from the prior books intact so I can maintain uniformity between works without knowing all of the back end stuff myself (i.e. I am going to need to periodically place in blank pages that do not have numbers, section title pages that do not have numbers and have a blank page on the back of those).

Is there a way to simply:

  • turn on page numbers within a “ConvertedX” style in Writer,
  • change the page number within a “ConvertedX” style in Writer?

Thank you very much (in advance) for the help.

You are better advised to create your LibreOffice template from scratch.

As you can see, where there is a difference in page style in a .docx, Writer will create a new page style and you can end up will a proliferation of page styles that have their own separate properties. Other issues arise in styles too, as your book progresses the difficulties from starting with a .docx will not improve.

It is not too difficult to create a template from scratch in Writer, the important thing for ease of editing is to use styles.
Here is link to an earlier question, First image in a chapter vanishes when I save - #2 by EarnestAl . In the sample I gave, the Heading 1 style is numbered (you can turn that off in Tools > Heading Numbering) and it also starts on a new page (in the Text Flow tab of the style)

At the end of the page before your page number change, you need to click Insert > More breaks > Manual break. In the dialogue, select Page Break, then choose an existing page style, then tick the box, Change page number, Ok the 1 or choose a different number and OK.

They are normally inserted automatically if needed

You would need a page style for them. I presume they are included in the page numbering count?

1 Like

Thank you for the response. So, I really do have to make a whole book template and go from there. Okay… I guess that will be my day today.

But yes, to your final question, the section title pages would be included in the numbering count.

Thanks again for your help!

Okay, two problems that I have after following these directions.

First, I’m making a template, which now has everything in “Default Page Style” for the format that my prior books have been in from the publisher, so all of the orientations and gutters or whatever are already programmed in. That all seems fine. But now, I’ve gotten to the end of the first page of the first chapter and here I’m running into two problems:

  1. When I follow your directions for:
    At the end of the page before your page number change, you need to click Insert > More breaks > Manual break. In the dialogue, select Page Break, then choose an existing page style, then tick the box, Change page number, Ok the 1 or choose a different number and OK.

the following happens:
I am at the bottom of page 9 when I do this. It creates a blank page 10 and generates page 11.
No number appears on the top of the page.

Second, for a template, this seems a remarkably inconvenient way to go about solving this specific issue in that - if I am understanding this correctly - at the bottom of the first page of every chapter, I will have to do this same thing and basically manually format the first page break of each chapter in order to do this?

I appreciate the help… Thank you!

It depends on your style practice. The first paragraph in your chapter is probably a heading (never use empty paragraphs to leave space at top of page before a heading). Then style it Heading 1 and modify this paragraph style Text Flow tab properties to include what you’d do manually at end of every chapter. Including the ad hoc settings there automates the process:

  1. you type the last sentence of the chapter
  2. you hit Enter
    A new paragraph of the same style is created below the last sentence.
  3. press Ctl+1
    Your paragraph becomes a Heading 1 and is flushed at top of next page.
  4. you type your heading
  5. after Enter, you type the first sentence of the new chapter.

Above I warned you against empty paragraphs. Writer has a look ahead capability to analyse the nature of the first paragraph in a page. A starting empty paragraph will mask this look-ahead and hide the heading. If you need empty spacing above the heading, do so by modifying Spacing above in paragraph style Indents & Spacing tab.

You didn’t present the details of the page style you select in your manual break. Writer has a hard-coded rule: any odd-numbered page appears at right and conversely any even-numbered page appears at left. Consequently, if you restart page number after page 9 to an odd value, there always will be an internally generated blank page.

1 Like

Not at all. Heading 1 style does this for you with the automatic page break. In the sample below, at the end of the document is “Second Steps”, click in that and press Ctrl+1 to apply Heading 1 style.

I have modified the document to use Default page style with Mirrored pages and, in the footer, I unticked the box Use the same content for both right and left pages. I also modified First Page style to be Mirrored, this will allow the start of a chapter on either left or right pages.

BookWithLayout131154.odt (15.3 KB)

1 Like

Hi!

Thank you VERY much for your response!

You noted: It depends on your style practice.
Yeah, I think that is definitely an issue; I write and I want to be able to put my work into a template that makes variables as minimal/few manual as possible. So, anything that requires me to do anything more programmy that takes away from my writing/flow is irksome to me. To wit; I used to enjoy the simplicity of “What You See Is What You Get” web page design. That’s essentially what I need out of my word processing/publishing program. I need something where when I set it up in the program, when it is done and I make it into a PDF for the printing press, it’s exactly what I saw in my program.

This is relevant here only in “style practice” is something I am trying very much to avoid; I’d like as much of what I make for the template to essentially be “plug and play”/“What I See Is What I Get” without having to go excessively into settings after I create the template(s).

I appreciate what you wrote about the Headings, but that’s not relevant to my needs: I have a set number of spaces [enters] that I have for my “Chapter Title” block. I don’t need that automated by the program. What I DO need is the ability at the end of a chapter to put a break after my last line, have the next page not have a page number on it (as that would be the start of a new chapter). Might you point me in the direction of an article that tells me how to do that?

I am fine with the pages on the right being odd numbered. That actually works perfect for me any my books.
For my template, I am trying to fill the first page (9) with enough writing to get it to the second page (10). Page 10 will be a left side, even-numbered page which I would like to have be page 4. Is there any easy way you can tell me to set-up this template so that when my text appears on page 10, page numbers, starting with 4 appear in the header?

I greatly appreciate the help; I’m not stupid - I’m just not a programmer and clarity for directions genuinely makes my life easier and the more I can automate a template like this, the faster I can get back to focusing on the work I am actually trying to do. Regardless, thank you VERY much for your help and response(s)!

(Also, I’m currently saving this template in .docx format; would my life be made any easier by saving it in the ODF Text Document format?)

In my sample, that is done by Heading 1 style having Break before set in the Text flow tab of the style. It also specifies that the page style for Heading 1 will be First page which has been set up to have no header or footer. The First page style is followed by Default Page Style (set in the General tab of First page style. Default Page Style has page numbering in the footers.
Note, it does not need to have the Heading numbering, to turn it off, click Tools > Heading Numbering, in the dialogue, select tab Numbering then select Level 1, set Number to None and delete everything in Before and After.

Once the template has been set up there is very little, if any, manual layout to do. In my sample you can just type, apply headings and carry on.

You might like to refer to the Writer Guide, download from English documentation | LibreOffice Documentation - LibreOffice User Guides
And for a deeper explanation of why styles make it easier, see Designing with LibreOffice, download link from English documentation II | LibreOffice Documentation - LibreOffice User Guides

You’re creating all the conditions to head into problems. A document saved in DOCX format needs a conversion when loaded. Another conversion to DOCX is also done on save. Since DOCX and ODF format largely differ, approximations are done during conversions. And because the approximations are not idempotent, document state does not converge towards a stable representation. The document is changed cumulatively with non-trivial alterations you discover only after a certain number of edit sessions. At this stage, it is too late to recover it. Among other seriously harmful issues is the fact that DOCX has no concept of page styles. You will end up with a form of direct formatting where each page has its own individual page style. This will completely cancel the smart automation presented by myself and @EarnestAl. This will make any page tuning or modification a real nightmare.

Definitely yes. Working in native format eliminates conversions on load and save and guarantees stability in file encoding. As a general rule, work with any application in its native format. Only export to alien format when the document is finalised and only if the recipient is really unable to accept native format. Anyway, if recipient returns an amended copy, don’t work on it to make further improvements: you’d revert to problems. Instead, incorporate the changes manually into your working original. You can also avoid “pollution” and structure corruption by pasting as unformatted text and applying manually styles.

Styles are fully compatible with WYSIWYG. They provide an additional layer of automation and spare a lot of manual job. You don’t need to be a programmer. You simply need to understand a few notions of typography (a very small number) and be able to abstract your text into a few semantic categories relative to its significance (headings, running discourse, notes, important, emphasis, understatement, quotation, …). Styles are really your friends. Writer is style-rich. It offers of course the most known paragraph styles (the only ones present in M$ Word). But you also have character, page, frame (to control image layout relative to text) and list styles.

1 Like

Okay!

This is an EXCELLENT response, so I am going to resave as ODF Text Document and try to apply some of the changes you’ve mentioned. Thank you both!

Hopefully, I won’t be adding to this after this… :wink: Be back soon!

I am not enjoying this process.

Okay, here is where I am at:
I have resaved my Template as an .ODT file. That (at least) seems to make it so every time I fail, I can bring things back to what I last expected.

For a brief time, I had pages 1-8 set up as “Title Page” which I figured would eliminate all other style issues. No clue how I lost that and how I can no longer replicate that.

For a time, I had 1-9 set up as “First Page.” Then, I went through the set-up for making “Default Page Style” follow the first page of a chapter, which was the final page of “First Page.” I do appear to have that working such that when I finish the first page of the first chapter (9), it flows into the second page and changes to Default Page Style.

BUT

Now, my Template has somehow magically reformatted itself such that all Odd numbered pages are “First Page” and all Even numbered pages are “Default Page Style.” WTF?! The last time I went to the bottom of the Default Page Style and attempted to continue from page 10 to page 11, page 11 is “First Page.” The last time I attempted to put page numbers on “Default Page Style” it thus only numbered the even pages and now I am even more frustrated than I was this morning.

And now, I am noticing that the “First Page” and “Default Page Styles” seem to have different header margin even though I have removed the page numbers.

Thank you both for your help. This is excruciating.

Do you want to upload a sample document from Google docs that works for you with the page size and layout and pages up to and including the second page of the main body, that is, including all the front pages?

You can fill with some random text (type lorem and press F3)

I no longer use/have access to Google Docs; their stance on A.I. led me to completely abandon that platform after removing all of my content from it.

Do you want to upload a sample of what you have and say what parts you want fixed?

1 Like

I looked at your “template” (technically an “ordinary” document). It shows a caricature of mechanical typewriter workflow (no offence intended), even by M$ Word standards. Absolutely everything is direct formatted (manual). There is even no use of DOCX styles for your headings.

Your best approach to convert it to ODF (Writer format) is to start from scratch because there is no formatting to salvage from it.

But, before starting this, read the excellent Bruce Byfield’s Designing with LO (you need to click on “More…” and scroll down a bit to access this book). It will explain what you’ll gain from styles. It is more clearly stated than in the Writer Guide (available from the same page).

If you want different layouts (page numbering or header/footer are elements of the layout) among your pages, you document must be composed of several “parts” (I use word “part” because “section” has a different technical meaning betwee Word and Writer). Each part is characterised by a page style (this concept does not exist in DOCX).

Therefore your first 10 pages will be controlled by a dedicated page style (or even perhaps several if you single out the cover). Built-in First Page is configured to switch automatically to Default Page Style on page crossing. Intended usage is either for the cover page (single use) followed by default pages; or for the first page of a chapter followed by running page in Default Page Style. It is up to you to decide which track you choose.

Even/odd pages are traditionally controlled by built-in Left Page and Right Page styles. They automatically alternate.

Transition between parts are done with a special page break inserted with Insert>More Breaks>Manual Break which allows you to select which page style is activated after the break and optionally a new starting page number. This transition can also be configured into Text Flow properties of a paragraph style so that it is automated. It is frequently done on Heading 1 applied to chapter headings, causing the chapter to start at top of a new page, without explicitly inserting a page break (because it is in the paragraph style configuration).

Generally speaking, Writer has 5 style categories:

  • paragraph to define the geometric and text flow properties of a paragraph; it also provides a default character style for the paragraph
    This is the sole category DOCX knows of.
  • character to apply typographical (visual) attributes to characters, different from the default in the paragraph style
  • page for global page layout, header, footer and note configuration
  • list: the name is misleading; it does not describe list formatting, it only controls the look of bullet or numbering
    This type of style must be applied over a paragraph in addition to the paragraph style. It can also be associated to a paragraph style, so that numbering is automatic as soon as the paragraph style is applied.
  • frame to control how images or side text annotations are positioned and interact with text
    This latter category is extremely difficult to master but is a key factor for layout stability when you have pictures or side notes. You can leave it aside when starting to learn Writer but keep in mind you’d need it in sophisticated documents.

You’ll find also something called table “style” but they are not styles in the traditional sense. Preferentially, stay away from them unless you accept unconditionally the layout chosen by the developer.

One last word: your “template” has extension .docx, i.e. it is a “standard” document. When you open it, you must care not to overwrite it. As far as I can remember, Word had a special extension for templates, .dotm? Writer makes also a distinction between templates with extension .ott and documents .odt… When you open an .ott, it creates an untitled .odt. Thus even if you save out of muscle memory, your template is not overwritten.

To create a template, proceed as usual and in the end File>Templates>Save as Template. Do it only through this command: template internals are slightly different from ordinary documents; changing the extension is not enough.

2 Likes

I am don’t understand, typically (always?), the foreword or introduction is not included in the page numbering of the body of the novel. I have given it its own numbering, i, ii, iii but you can delete the numbering field. I could include the foreword in the page numbering if you insist but the single paragraph spacing in the foreword is different to that used in the body of the novel so you might like to consider if you want it to be different.

Chapter 1 starts on Page 1 but the numbering does not show until page 2. Note that convention has it that page 1 is a right hand page (recto). This is built into Writer although I would guess that some workaround could be found if you insist on starting the novel on a left hand page as in your sample.

When you want to start a new chapter, just start a new paragraph with the working name of the chapter and press Ctrl+1 to apply Heading 1 style. That will create a page break with the Chapter heading on a page without number showing.

I have removed almost all the words in your sample so you can make it a template, (click File > Templates > Save as template, give it a name and select My Templates, OK.
Enter the title of your novel in the third page and it will show on the first page too.

Save in native format, .odt always or some of the features might not work. If someone wants a .docx, then File > Save a Copy and send that but carry on working in the original .odt

Have a play with this and see if you need changes.

[Edit] I hadn’t saved the last changes so here is updated version
NewTemplateForBooks131154EA.odt (11.8 KB)


[Edit 2]
To see the first Title after you have entered it on page 3, you will need to click in the menu Tools > Update > Update All. It might seem a bit over-the-top but if the title appears in other places then a change in the name can be updated in one place and all the related fields will get updated too, no variation in spelling or typos.
Empty paragraphs can cause problems, I removed empty paragraphs except for the one on the first page to easily get the different spacing from the top for the title. Any others are only there to show show where you can start typing.

1 Like

Crap. It wasn’t until you pointed it out that I realized I sent the wrong file!

My new ODT template is:
TemplateForNovels.odt (13.2 KB)

But yes, I basically need it to be the basic text document into which I can type the text for my books into without having to worry about formatting afterwards. But thank you for catching that I provided the wrong file. This is the one that has all of the errors I mentioned above.

Sure! That would be great!

TemplateForNovels.odt (13.2 KB)

That is my current template, which is the basic form I need - I had the wrong file there before. This is the correct one.
Known Issues:

  • Even number pages are “Default Page Style,” Odd number pages are “First Page.” I would like the template to not have page numbers or headings or anything until what is currently page 10, so I think they are supposed to be “First Page” for 1-9, with “Default Page Style” starting on Page 10.
  • The left and right pages seem to have a different top margin. I’d like it to be the same spacing as the bottom margin on both the left and right pages, not sure which of the two is off here…
  • Starting with page 10, I’d like page numbers at the above where the existing text appears (i.e. not lowering where that top line is). I’d like Page 10’s number to be page 4.
  • [Please Confirm] When I reach the end of the first chapter, I’d have to insert a manual page break to start the next chapter, yes? When that happens, I need to set the next page to be “First Page” again so that it does not have a page number at the top, yes? And when I get to the bottom of that page, will it continue with “Default Page Style” and the next proper page number?

If this is too much, I get it, but that’s what I need and where I’m at in the process. I appreciate the help if you are willing to assist me. Thank you. Seriously; thank you VERY much.

I am SO SO SO sorry you wasted your time on that one! I was distracted and sent the wrong file when I uploaded it (I had an ODT file which I had meant to, but somehow I got the wrong one).

I am so sorry you wasted your time on that file; it wasn’t the right one. Anyway, if you’re in the mood to play with it, I have the right one in this thread now and I don’t need the provided text to be anything different from what it is, it’s all of the weird formatting issues that came up (as described) that I am trying to fix so that with subsequent works, I basically have a “plug and play” template that I can easily work in and then print to PDF for my printer without there being any other (or new and exciting) issues. That’s what I’ve been after because I’m competent with the writing; the back-end stuff with all these different programs… not so much! :wink:

Thanks for all you did, even if you don’t choose to help with the proper file. I appreciate all you did. Thanks!

Barring all of this…

I found I have a file that seems to actually be working for me as far as all of the formatting goes and is in ODT format (yea!). The ONLY problem I have in that one is this: the first chapter where it starts is Converted3 and physical page 10 is numbered page 11. I need that first numbered page to be 4. I cannot find anywhere in the settings for my Converted3 that has page numbers or how it is picking that number to start on.

So, one (hopefully basic) question would be: is there a place without adding any other pages, forms or formats where I can go to change the page number for a Converted3 page style? Without inserting any new pages, above, below, etc. Is there one simple place to go, access it and see that there’s something about the page numbers that fixes this issue without adding any page numbers to any prior pages or causing any new problems?

If anyone can answer that and the response works, you’re my new hero! :wink: