LibreOffice Writer Working with Paragraph-Level Styles

Because Paragraph-Level styles are the most common styles, it makes sense to take a look at how you can work with them in LibreOffice Writer.

New Text

This is not hard. If you are creating a new document most of the work is already done if you have been following our tutorials here. I recently did a class in LibreOffice at Ohio LinuxFest, and I opened the class by simply opening LibreOffice Writer. I made an ostentatious point of removing my hands from the keyboard as soon as the new document opened, and asked everyone to tell me what they saw. It took a few moments for them to get it, but soon they started pointing out that my document had started with a Heading 1. Then that the cursor was in the middle of the line. Of course, I had set my default template to always start with a Heading 1, and my style properties for Heading 1 said that it would be centered, Then they noticed the font was Liberation Sans, that it was bold, that the size was 17.s points (this is the equivalent of the 145% I had set in my properties). That is a lot of settings in place merely for opening a document.

I then typed a title for my document, and then very dramatically used one finger to press the Enter key. This immediately jumped down two lines because my Heading 1 style included a blank line after the Heading 1 object in my properties. It also jumped to the left of the page, and changed the style to Heading 2, with a font of Liberation Sans, size 16, Bold and Italic. This happened because in my properties for Heading 1 I had set it that the next style would always be Heading 2. All of the rest of the settings were part of the properties for Heading 2. Again, I  got a lot done for just one press of a key.

So I typed a sub-section heading, then one more dramatic flourish of pressing the enter key with one finger. This time it jumped two lines as before (because my style properties for Heading 2 also included a blank line after), but instead of being all the way to the left margin, it was indented a half-inch. And then you could see that the style had just changed to Paragraph (because my properties for Heading 2 specified that the next style should be Paragraph), the font had just changed to Liberation Serif 12-point, and there was no bold or italic involved. Of course, this was all from my Paragraph style properties. I typed a few sentences, then did the one-finger press of the Enter key one more time, and it jumped down two lines (yes, I added a blank line after to the Paragraph style as well), indented again, and was ready for my next Paragraph. This was because my Paragraph style properties said that the next style should  be Paragraph.

The point of this is that a one-time investment in setting up styles can yield time savings forever. And that is just the time savings you get in the initial creation of the document.

Changing Styles in a Document

This is not hard. In the example I gave above I had each style set to specify which style would follow. My Heading 1 said to follow with a Heading 2. My heading 2 said to follow with a Paragraph. And my Paragraph said to follow with another Paragraph. This was all based on probabilities and my own personal style and workflow. Which means that what works for me might not work as well for you. What really matters is the technique involved. But even for me there comes a time when I finish a paragraph and need to follow it with something else. Maybe I need another Heading 2 because I am starting a new section of my document. Or maybe I need to start a list, or put in a quote. That is not a problem.

If you look at your LibreOffice Writer screen there is a drop-down box right above the docked Styles and Formatting window on the left (you do have this docked, right):

The Apply Style drop-down box

The Apply Style drop-down box





If you look at the first drop-down, which right now happens to say “Paragraph”. that is the Apply Style dropdown. To use it, just place your blinking insertion mark anywhere within the object you want to apply the style to. This is commonly done by clicking on it. BTW, I distinguish between cursor and insertion mark. A cursor is the thing your mouse moves around the screen, and an insertion mark is the blinking vertical line that shows where the stuff you type will show up. A lot of people will call this a cursor, but they are wrong. Anyway, with your insertion mark anywhere within the object, just select a style from the drop-down box and it will be applied.

But what if the style you want is not there? This dropdown box contains a few default styles, plus any styles you have used so far in this document. If there is a style you have not used yet, and it is not in this dropdown, there is still a simple way. Just find the style you want in the Styles and Formatting window that is docked on the left side of your screen. Double-click on the style while your insertion mark is within the object, and it will both apply the style and add it to the Apply Style dropdown.

Let me give an example of how this can help you in a large document.

Some years ago I was given the task of assembling the catalog for the college where I worked. I say assembling because writing the content was left to each department. But we had many departments, both administrative (e.g. Registrar, Financial Aid) and academic (e.g. History, Physics). So in the final analysis I got documents sent to me from perhaps 40 or 50 different departments, and no two of them were done the same way. It was a mess. The first thing I did was take each document submitted to me (thankfully, these were all electronic submissions) and start to assign styles functionally. I did not worry at all about how each style would look at this stage, because as long as I had the right functional labels on each piece of text I could deal with the appearance easily later. But I needed to make sure each paragraph of text was labelled as a paragraph, each list labelled as a list, and each heading was labelled as a heading. None of this had been done on what go sent to me. (Well, there might have been one. My friend in the Political Science department actually knew what he was doing.)

Headings and lists were the biggest headache. None of the headings  were labelled, and I also needed to put them in a logical order. Which one has a Heading 1, which was a Heading 2, ad so on. And with lists it got really weird. No one used styles. Many of the lists had been done with repeated presses of the tab key, instead of using tab styles with leaders. So I had to go through each document and assign the appropriate style to each element of the document. Fortunately, that is not hard. I just started applying styles to each object as described above. I didn’t worry yet about how each style would be formatted in the end. I knew that once each object was labelled I could change the appearance easily.

Changing Style Properties in a Document

Of course, when you have a long document with a lot of objects to manipulate (my college catalog was over 200 pages, with multiple headings, multiples levels of headings, multiple lists (both numbered and bulleted), and quite a few tab leader lists. Keeping this in order was not easy, but styles made it a lot easier. And what happens if some vice-president looks at a draft and decides that she doesn’t like the fact all Heading 3 styles had italic fonts and asks to change all of them? Not to fear, this is actually pretty easy. And you don’t need to go through the whole document a page at a time to find each instance either. You simply change all instances in one operation.

Which way you do this may depend on the Template you are working with. If it is your Default template I would suggest you create a style on the spot that has the properties you want, then do a Find-and-Replace to swap out the styles. In this case, I might create a new Heading 3 style, maybe called Heading 3 1.1. I begin by clicking on Heading 3 once to select it. It should now be highlighted. I then go to the top right of my Styles and Formatting window docked on the left, which is the New Style From Selection dropdown:

The New Style from Selection dropdown

The New Style from Selection dropdown





The dropdown is on the right, and has a paragraph mark on it. Click it, and select “New Style from Selection”. This will create a copy of the existing style, which you can edit. Just change the name to Heading 3 1.1 (in our example), and change the font from italic to one without italic. Then do a Find-and Replace. Go to the Edit menu, select Find & Replace. In the window that comes up, make sure you click More Options if you don’t see this. At the bottom there is a check box for Search for Styles.

Find & Replace Styles

Find & Replace Styles

Make sure you you check that box, and then the “Search For” and “Replace With” drop-downs will be populated with styles. The “Search For” will have all of the styles in use in your document, and the “Replace With” will have all of the styles available to you.

I said I would do it this way if I was in a document based on my default Template. The reason is that I don’t want to change my default style definition. If I make this change and save the document, when I go to my next new document the new style I created will not be there because I never made it a part of the Template. Remember that to have a style permanently available you need to save it in a Template. But in the example of the College catalog I think I would recommend creating a specific template for the purpose. I could then just modify the way the style is defined in the Template.

Listen to the audio version of this post on Hacker Public Radio!

 Save as PDF