Frequently asked questions - Writer
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
How to adapt the presentation of the text depending on the outline?
You want the text to shift automatically following the outline level. Example of the expected output:
It is possible to have this effect automatically using Conditional Styles. This functionality allows a single style to take on the attributes of other styles depending on the context.
For example, used in the header of a page, the Text Body style could take the attributes of the Header Style. We don’t recommend such “extreme” usage, because it can cause confusion. However, the feature is quite suitable for the automatic indentation we would like to use here.
In this example, the text will use only one conditional style (the titles use Heading 1, Heading 2, and Heading 3 respectively). The text style applied is automatically adapted to the context: when the text is in “level 2,” a predefined layout in another style is applied. The same applies for level 3, etc.
This is very handy, because you don’t have to bother with the layout when entering text. You choose the “conditional” style and, when you apply the titles (i.e. the Headings), the layout adapts by itself. We can achieve this in three steps.
Step one: create two ordinary, indented paragraph styles
To follow the above example, you need to create two styles which are “ordinary,” paragraph styles with only an indent defined before the text:
- create two new ordinary, body text styles and call them Text Level 2 and Text Level 3 (chose any names that you like);
- when you are creating Text Level 2, set its Before text Indent under Indents & Spacing tab to 0.5"; and
- when you are creating Text Level 3, set its Before text indentation to 1.0".
These two styles are not directly applied in the document.
Step two: create one conditional paragraph style
Now we create the conditional paragraph style that will be applied to the text following these steps:
- in the Styles & Formatting panel ( ▸ ▸ or press F11), right-click on the Text Body paragraph-style, then chose New;
- under the Organizer tab, give a name to the style;
- under the Condition tab, check Conditional Style;
- in the Context list, select 2nd Outline Level, in the Paragraph Styles chose Text Level 2;
- click on Apply and then OK; and
- repeat the previous step for the third level with the style Text Level 3.
Step three: modify the heading styles
You can update the title styles "Heading 2" and "Heading 3" to assign them an indentation (0.5 and 1.0).