Numbered Section Heading

Hi,

I would like place in my document a numbered heading for a section within a chapter. Pretty much in the same way that textbooks have headings for their “Worked Example Sections” or a breakout section, e.g. Example 1.1; Example 1.2 under a Heading 1.

Is this possible?

Please elaborate more on your goal. Tell what you mean by “section” because this word has a specific technical meaning in Writer (an area whose layout is different from the enclosing page, mainly number of columns and margins).
Should these headings appear in the TOC?
Is the number continuous with the other headings? In other words, is this just another heading? Or is it a separate independent sequence, except for the first number which is the chapter number?
If possible, create a dummy example (1 or 2 pages long) and attach it to your question.
As usual, mention your OS name and LO version. What is your skill level with Writer? Do you master styles?

Thank you for your reply. I have attached a sample document to illustrate what I mean.

Basically, if you have a document outline like as follows.

  1. Chapter Heading
  • some text -

1.1 Sub Heading 1

  • some text -

1.2 Sub Heading 2

  • some text -

Section Heading 1.1 (e.g. Example 1.1)

  • some text -


Section Heading 1.2 (e.g. Example 1.2)

  • some text -

Can I get the Section Heading numbers to automatically number themselves, like I can with the Headings?

Should these headings appear in the TOC? I would love for these to be able to be included in the TOC as an option.

Is the number continuous with the other headings? In other words, is this just another heading? Or is it a separate independent sequence, except for the first number which is the chapter number? For me, it would be an independent number (NOT continuous with other headings), except for the chapter number.

Version: 7.2.5.2 (x64) - Windows 10.

What is your skill level with Writer? Do you master styles?
I’m not sure what skill level, but I would be confident in saying above beginner. My current Writer project is an Engineering Procedure for a truck parts company, and I have been using Styles and Indexes to help with headings and navigation of the document.

Thank you again.
QuestionSample.odt (17.2 KB)

All you need is to define a number range for your examples, the same way figures or illustrations are numbered in captions.

In the revised sample, I created two paragraph styles to avoid direct formatting you applied on your examples. Also, creating sections for them is not necessary here because you don’t modify substantially the page layout. Background colour can instead be applied to the paragraph styles and as long as indents are consistent, background areas merge seamlessly.

  • Example Heading is based on Heading, the ancestor of all headings.
    By the way, never format paragraphs with Heading which is intended to set common attributes shared by all Heading n and other “outline” styles.

    I attached it to outline level 2 (in Outline & List tab), left-indented it 1.5cm (in Indents & Spacing tab) and assigned it a light-gray background (in Area tab).

    This solves the look of the example heading and its inclusion and the TOC.

  • Example Text is based on Text Body.

    I gave it the same indent and background as Example Heading.

    This style will format example text.

You can, of course, set other attributes to your liking.

The remaining issue is numbering the examples. Although I could have used an existing number range such as Drawing or Illustration, I chose to create a dedicated one so that there is no conflict with captions in case you have figures, drawings, illustrations, …

The dedicated number range is created on first use:

  1. enter "Example " in an Example Heading paragraph
  2. Insert>Field>More Fields and go to Variables tab
  3. in Type select Number range, in Name (below the Type list), enter “Example” and from Numbering by Chapter set Level to 1
  4. Insert

The other number insertions are simpler:

  1. Insert>Field>More Fields and go to Variables tab
  2. in Type select Number range, in Select click on Example
  3. Insert

By requesting numbering by chapter, the number automatically resets when you add a heading at the designated level.

Your document belongs in the category “complex”. Consequently, follow a very strict procedure banning any direct formatting otherwise tuning your formatting will become a nightmare. I highly recommend you implement hierarchical styles (i.e. derived styles inherits their attributes from an ancestor and you only override the attributes needed to be different). So, when you modify attributes in the ancestor, this automatically cascade to descendant styles where the attribute is not overriden. This is very handy to assign a different font face in headings: you change it in Heading and all Heading n and Example Heading are updated.

Revised sample file (18.2 KB)

1 Like

Wow! Thank you so much for your help!!!

This has completely answered my inquiry. I’m very grateful :slight_smile: