Ask Your Question

Problems with styles [closed]

asked 2016-10-26 20:26:46 +0200

ctheobald gravatar image

updated 2016-10-26 22:23:12 +0200

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.


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by floris v
close date 2016-11-06 20:22:19.325799

2 Answers

Sort by » oldest newest most voted

answered 2016-10-27 09:17:15 +0200

ajlittoz gravatar image

updated 2016-10-31 08:50:52 +0200

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 ... (more)

edit flag offensive delete link more



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 gravatar imagectheobald ( 2016-10-27 23:11:48 +0200 )edit

@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.

mark_t gravatar imagemark_t ( 2016-10-28 00:26:53 +0200 )edit

answered 2016-10-27 23:58:50 +0200

ctheobald gravatar image

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-<double or="" triple="">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.

edit flag offensive delete link more



You can do that now.

floris v gravatar imagefloris v ( 2016-10-29 11:54:06 +0200 )edit

Question Tools



Asked: 2016-10-26 20:26:46 +0200

Seen: 1,606 times

Last updated: Oct 31 '16