Formatting books with parts in Writer

I’m looking for suggestions or templates for formatting multi-part books in Writer. I also plan to use the option to export to EPUB when I’m done. It’s pretty straightforward to write books with regular chapters by formatting the chapters as “Heading 1”, but if the book parts use that first heading instead, then the EPUB export puts all of its chapters (formatted as “Heading 2” in the same continuous section and chapters reset as 2.1, 2.2, etc. I just want single pages to mark the major parts of the book without affecting the chapter numbering and sectioning in EPUBs.

I’m pretty new to using styles in Writer, but after a few hours of reading and tinkering, I think I know how to format everything the way that I want. The only problem now is organizing it in a way that ToC generation and EPUB export work as expected.

@ajlittoz:
To clarify: I’m trying to assign the right type of headings/styles so that everything indexes properly and gets split up into sections properly when exporting to EPUB. Consider the following layout:

  • Title (title page using Title)
  • Prologue (Heading 2)
  • Part I (Heading 1)
  • Chapters 1 - 7 (Heading 2)
  • Part II (Heading 1)
  • Chapters 8-12 (Heading 2)
  • Part III (Heading 1)
  • Chapters 13-18 (Heading 2)

If this gets exported to EPUB, it gets split into sections as follows:

  • section001: Title page, Prologue
  • section002: Part I, Chapters 2-7
  • section003: Part 2, Chapters 8-12
  • section004: Part 3, Chapters 13-18

I’d rather have each part (intro page) and chapter have it’s own section file. Also, the reason I set Prologue as “Heading 2” instead of “Heading 1” was because they look similar to the chapters and because they are followed by regular text. The “Part” pages are just single pages introducing the major divisions in the book. Even if the Prologue is changed to “Heading 1”, the chapters are still grouped under their respective parts as one continuous file.

And what is exactly your question?

Is it about the way of using Heading 1 for parts (unnumbered) and Heading 2 for chapters within a part without the part number? Is it about the tip to have continuous chapter numbering across parts?

Or is it specifically about EPUB export once you have your book the way you expect it?

Please edit your question to better explain. Don’t use an answer. It is exclusively reserved for solutions on this site.

See my answer. Creating a dedicated style for the “part” titles will allow you to have continuous chapter numbering (at level 2) across all parts. If you style your parts as Heading 1, this resets chapter numbering (level 2) whenever you enter a new part.

Keeping Heading 1 for parts is possible, but this requires tweaking both Tools>Chapter Numbering and Heading 1 definition. If you aren’t familiar with styles, I won’t elaborate on this.

The simplest way is to use a dedicated paragraph style for your “part titles”. Call it PartHeading. This will be an excellent exercise for style creation/customisation. I recommend you read the style chapters in the Writer Guide.

Ideally, make this style depend on built-in Heading so that it inherits the common attributes of all Heading n styles.

Tune the properties of this new style as follows:

  • in Text Flow, enable a page break before the paragraph so that the part heading appears on a page of its own
  • in Indents & Spacing, set the Spacing before to the vertical distance needed for the heading to be positioned where you want it in the page
  • in Outline & Numbering, set Outline Level to Level 1: this will enter your part heading in the TOC

Since PartHeading is not referenced in Tools>Chapter Numbering, your parts will not be numbered

Depending on how you want the TOC to be formatted, you may style your chapter headings as Heading 1 or Heading 2

If you style them Heading 1, parts and chapters will have the same appearance in the TOC. In case you want to format differently the part headings in the TOC (e.g. center them while chapters are left-aligned), your chapter headings must be on a different level that the part ones. Then, style your chapter titles with Heading 2 and arrange the numbering in Tools>Chapter Numbering.

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!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

Thank you. I think this will do what I need it to. However, I have one quick question: What is the “Heading” style in Writer? I notice that it’s not included in the indexing and numbering. All the source I can find on headings in Writer talk only about “Heading 1”, “Heading 2”, and so on. Is it just non-indexed heading style?

Styles in Writer are organised in a tree-like way, just like a genealogical chart. Styles inherit attributes from their ancestors. If you don’t force the inherited attributes, when you change one in an ancestor, the change is cascaded to all descendant styles without the need to modify them. This is a very user-friendly feature to update a look-and-feel when yourt styles are grouped according to general category.

Heading is the ancestor of all Heading n and its role is to set the font face for heading and the base size. All Heading n define a %-size so that when you modify *Heading font size, all Heading n are updated but keep the same ration relative to Heading.

To quickly format all your headings in a cursive font twice as big, just change the font face in Heading and the size and all your heading will “magically” be updated.

This kind of magic make the whole style feature very handy and flexible to change document formatting without ever touching the text.