Problems with styles

I’ve got a document which I am trying to format using styles to manage sections and sub-sections. My first concern is a hanging indent for paragraphs formatted with a modified Default Style. I’ve set Before text, After text, and First line all to 0.00", yet my paragraphs styled as Default Style show up with a hanging indent of about 0.30"

I am used to CSS styling, so my understanding of how LibreOffice does things is clearly wrong. I am needing to understand how to make Writer do what I want.

FYI, I have applied Clear Direct Formatting many times, but still the odd formatting remains.


Clear Direct Formatting applies to the selected area (character style) or the paragraph (paragraph style) where the cursor is positioned. It is not a global reset.

LO styling is quite simpler than CSS.

There are 3 layers:

  • paragraph style defines a “default” for the paragraph,
  • character style overrides the default formatting on the characters with this style inside the paragraph (only one character style can be applied, contrary to Quark Xpress or HTML’s <span>),
  • direct formatting overrides character style with anonymous manual formatting.

Paragraph and character styles may be defined for ease of use and consistent look and layout of document.

Very often, many attributes in paragraph or word categories are related. Think for example of the choice of one font for the text and another one for titling. It would be very inconvenient if the definitions could not be linked to one another (the inheritance feature you are familiar with in CSS). This can be done separately for paragraph and character styles through the Organizer tab of the style definition dialog, Linked with field.

You define a new style and link it with an existent one. The new style inherits all attributes of the old one. Then you modify any attribute to your liking. Doing so overrides the inherited settings. To revert to inherited settings, you must click the Standard button on this page; just setting an attribute to the value of the old style is not sufficient: you override to this value (should the original value be changed in the inherited style, it would not cascade down in the new style).

You can then build a dependency tree for paragraphs and another one for character styles. Remember that paragraph and character styles are independent. Although character styles are used inside paragraph, their overriding definitions apply to their static dependency definition among character styles, not to the dynamic usage against the paragraph style (this remark is important when you use a %-unit for the font size).

I would personnaly strongly advise against using Default Style paragraph for any text formatting because it is the common ancestor of all paragraph styles. It is better suited to define defaults for all other styles, the most important of which is the font family.

The second style to consider is Heading (again don’t use it for real work): this is where I define the font for titling.

The third important style is Text Body (used for non-specific text) where I define the general indents which are inherited by all “text” styles.

Dependency between character styles is not as useful as for paragraph styles. It is relevant only with very strongly related styles to compensate for the “only one character style” rule and the lack of toggling attribute in style definition (think for example of italics: if the base paragraph is already italicized, the character style should cancel italics, therefore I create two linked styles, one with italics, the second without it – but this is not satisfactory).

Default character style MUST NOT be tampered with because it allows to revert to the base paragraph style. This is so much important that LO locks this character style, preventing undesirable effects to occur.

Personally, I use character style for kind-of semantic markup: word or sequence of words are “highlighted” with a character style reflecting their semantic category (foreign words, filenames, trademarks, code examples, specific category within the document, …). This allows for fine-grained tuning of the final document appearance, though the number of stylistic variations is really much more limited than the number of categories (usually reducing to italicizing, according to general typographic rules), but it has many advantages when it comes to document maintenance.

Organizing the styles in a consistent dependency tree can make a big difference in the speed of typing your document (less manual formatting) and the ease with which your can transform its appearance.

If you think this answers your question, please check the tick mark at left. If it has some value to you, do not hesitate to upvote it, karma permitting.

EDIT 2016-10-31: added a complement on character styles

1 Like

This is an excellent summary of style formatting. I am taking the advice to not use Default Style directly, instead I am using Text Body Indent. I would up-vote, but lack the karma points.

@ctheobald: I think you should select this answer by @ajlittoz as correct answer. Click the grey tick to the left of the answer. It is a very clear and usefull reference of how to use styles correctly. I upvoted and added myself as a follower so hopefully I can find this again if needed.

ajlittoz did not directly answer the question, but provided me the information needed to fix my document.

I’ve concluded that either the document was corrupt or I hosed it badly with mis-use of Styles. To fix, I started from a fresh document and pasted all my text as Unformatted Text. I then imported (Load Styles…) from my template file and applied Text Body Indent to all text. I then went back and applied my “Heading n” styles as needed.

Note that you can select multiple Heading text entries at once, on OS X it is Command-click on each entry to select as many as you want. Then use the Styles and Formatting sidebar to select the desired Heading style/level.

Again, I’d up-vote ajlittoz, but my karma is not sufficient yet.

You can do that now.