"hierarchical" character style

What is a “hierarchical” character style, in Writer? What is “hierarchical” about such styles as Addressee, Caption, CommentText or TextBody?

Inheritance in paragraph styles in Writer

The same for Character Styles.
“Default Paragraph Style” is the source.

Hierarchical refers to inheriting. A style that is a “descendant” of another style “inherits” the attributes of the “parent” style unless a particular attribute is purposely changed.

Such inheritance has advantages. By using inheritance, you don’t need to set every attribute you want in a descendant style, only those attributes that you want to be different from the parent style.

Additionally, if you change an attribute in a parent style, that attribute will be automatically changed in any descendant styles that are inheriting that attribute.

As an example, Headings styles 1, 2, and 3 may inherit the font setting of the basic Heading style. However, the font sizes of these styles may be different. If you change the font in the Heading style, the font will automatically be changed in Heading styles 1, 2, and 3 as well. But the font sizes will remain different.

2 Likes

Style hierarchy is a way to define a style “like-another-one-except-for-…”.

I assume you have the style sidepane showing on the right side of the window. You can display the relationship between styles by selecting Hierarchical from the bottom menu.

You create a “derived” style with a right-click on some name and New. Initially the new style is a copy of the clicked one. But it has an additional property. Since it is a “child” of the original clicked one, any modification in the “ancestor” style is forwarded to the “child”.

An exact copy of a style has little use (except perhaps to markup the text as having a different “significance”). You can change some attributes in the copy. These changed attributes become “overrides”, i.e. they block changes made in the ancestor original style. The value set here will always be used, replacing the one from the ancestor.

With a carefully crafted inheritance (= derivation) scheme, you can dramatically reconfigure your document appearance by adjusting only a few “critical” styles.

As an example, consider Default Paragraph Style. It is the ultimate ancestor of all other styles. This means it is unusable for text or you don’t modify it because it impacts too deeply the others, requiring “overrides” on almost all parameters. It is meant to define your preferred defaults, such as font face or size, language, …

From it, you find “master styles”, such as Caption, Header & Footer, Heading, which are themselves at the top of a sub-hierarchy. For example, Heading is used to set defaults for all headings (usually only a change in font face) and again you don’t use it for real text.

The case of Text Body is a bit singular (unless I made an error on my usage schema). It is the standard style for the narrative, although it is at the top of the bulk topic hierarchy. Below it, you find the indented variants and List family.

Before leaving the paragraph styles, a few words about “stray styles”. Most style names reflect the semantics of a book. A few styles have been added out of the “book hierarchy” (they are immediate children of Default Paragraph Style) for letter composition: Addressee, Complimentary Close, Sender, Signature. Feel free to design your own template with these styles and customise them to fit your needs.

Character styles can also be organised hierarchically, though this is less useful because you can’t configure them contextually. Take the example of Emphasis which is frequently translated as italics effect. If you apply it inside a paragraph whose style already sets italics, you’ll see no change of appearance. Unfortunately, inheritance can’t “invert” an attribute: if italics is set in the ancestor, you can’t request “NOT ancestor-value”; you can only set italics or not italics. This means you need two character style and you choose manually which one to apply. And you create a possible document maintenance issue.

Note also that hierarchical character styles are defined relative to another character style. You can’t “cross-define” against a paragraph style. Both families live in different namespaces.

A last word about style names: the names suggest a usage, a meaning about the paragraph of word. This makes the style name independent from the appearance. This design choice encourages semantic styling where styling is some meta-information added by the author. You separate the significance from the appearance. Therefore Emphasis can be implemented any way able to emphasise the word: italics as in common typopgraphy or some fancy colour or font face. This is your creative freedom.

Thank you for the explanation. I see I should have asked about paragraph, not character, styles.
Since most styles are inherited, “hierarchical styles” includes most styles —not very useful as a category! It’s like AllStyles.

It’s just a confusing UI, making impression that “hierarchical” is a filter, like other elements in the list. No it is not, it is a view mode. There’s a task to remove it from the list, and make a separate checkbox.

The “All styles” option shows the existing styles in alphabetical order on the Sidebar. Sometimes you need that, and sometimes you need the hierarchial structure to find the proper style to apply.
(And there is the “Applied styles” option: it shows a shorter list: only the styles what are applied in the actual document. It very useful - when you already applied all of the desired styles: all of the unused ones will be hidden.)