Style, list, heading n, and level

I read the interesting and valuable info in https://ask.libreoffice.org/t/how-do-list-styles-work-and-what-is-their-relation-to-paragraph-styles/48402. Heading n seems a specific kind of style. I made a style using the list attribute with a tool bar button. I am usure if this is a style or not. It seems not direct formatting, because CTRL-M does not have any effect. But it seems not to be a list style either. If if select a style for Heading 1, it has no effect on Heading 2, or Heading 3.

What is the best way, with styles, to use Heading n? I want to use Heading 1 and Heading 2, in my Table Of Content (TOC) en discard Heading 3 and further. I could successful select the level in the TOC. But I would like, in my text, also only Heading 1, and Heading 2, with the outline numbering. And Heading 3 and further, should only display the heading name. I can not find a way to limit the numbering to a specific level.

I get further and further in styles, and I like the idea. I can work better with it in time. Understanding and using list styles would improve my document.

Direct formatting is an ubiquitous way of manually formatting things. Some effects interfere with paragraph and list styles overriding the style settings. These effects can be cancelled with Ctrl+M. Oher effects are more complex and don’t act on typographical attributes. Among these, you have the addition of bullet or number to make the paragraph a list item. When you do this with a press on the toolbar button, this is indeed a direct formatting. But it can’t be cancelled with Ctrl+M. Similarly, manually added page breaks are not erased with Ctrl+M.

This explains why, until the 7.2.x releases, it was very difficult to detect direct formatting because not all couold be eliminated with Ctrl+M. Now you have the Style Inspector, though it is still imperfect because it reports list style application (to bullet or number a paragraph) as direct formatting as if the toolbar button had been pressed.

The Heading n family of paragraph styles is very special. It is ready for numbering but you must enable this numbering (the reason for this is headings may be unnumbered in some documents; user should have the choice). The Heading n styles are pre-configured to be automatically collected when a TOC is build. They are also pre-associated with a reserved internal list style independent of any other list styles so that you have no adverse confusing interference between ordinary lists and numbered headings.

This is why, as @anon87010807 points out, you must never mix chapter numbering and bullet/numbering (whether through toolbar button or dedicated list style).

Use Heading n to identify your headings as such in your text.

If you want them numbered, customise Tools>Chapter Numbering. Every level can have its own number (alphabetic or numeric) or none.

Filtering which levels are included in the TOC is done when you insert the TOC. In the dialog which pops up, in Create Index or Table of Contents section, select the maximum level in Evaluate up to level:.

To answer your interrogation about styles and toolbar buttons, remember that any action with buttons or keyboard shortcuts is direct formatting. As per definition, direct formatting is an addition and does not modify the style (any category). Consequently, a paragraph assigned some style with numbering added through a button has no new style. It remains under the original style plus a numbering direct formatting which can’t be cancelled with Ctrl+M.

Creating a paragraph style with embedded numbering is the most difficult style exercise. Do it only after you’ve practised “elementary” style creation and configuration.

I am afraid I did use the toolbar button, for the list style. I want to make a total new .ott template, with no direct formatting at all. The previous one, was with all the editing to mixed up. The toolbar I used is direct formatting, and it can not be undone with CTRL-M. Is there a way to find this direct formatting, and remove this direct formatting?

The list buttons on the toolbars toggle the list state : click on them to turn the list formatting on, click again to turn it off. I’m not sure if nothing of the list formatting remains hidden somewhere in the document encoding (xml).

I noticed Ordered, and unordered list do have can be toggeled. But by clicking again not all can be undone. I need menu → Edit → undo for this. The outline does not have a toggle.

But because I could see the difference quite clear, I hope, and expect, I do not have a direct format. Digging into .xml would make things clear, but I just want to work with word-processing, with layout. This goes to far for my simple purpose.

@anon87010807 you, and ajlittoz, give both a good answer. Can I mark both as a solution?

You can upvote both answers, mouse over the arrow up to the left of the user avatars and click. See picture:
Schermafdruk van 2021-12-14 17-45-17

@anon87010807 I upvoted ajittoz, then I wanted to upvote your answer and got the message:

You cannot exceed the number of votes for your trust level.

So I marked your answer as a solution.

First, don’t mix list styles with the outline/chapter numbering.
If you want heading 1 & 2 numbered, the rest unnumbered, that’s quite easy: open Tools - Chapter Numbering; set the paragraph styles for level n to Heading n but assign numbering only to level 1 & 2.
Schermafdruk van 2021-12-14 16-40-56

Thanks floris_v. The chapter numbering does work now as expected…