LibreOffice Writer Character Styles

As we mentioned previously, there are 5 types of styles in LibreOffice Writer, and you can see them as the 5 icons you can select in the Styles and Formatting window. The first icon is for Paragraph Styles, which we have looked at in the case of an actual Paragraph, for Headings, and for Tabs. The other paragraph-level set of styles worth looking at is lists, but LibreOffice treats these separately because they can be complex and have a lot special configuring. But Character Styles are at a lower level than Paragraph Styles and let you tweak bits of text within a paragraph while leaving the rest of the paragraph in its usual state. Why would you want to do this? Well, LibreOffice Writer says this in its documentation:

Jean is a technical writer from Australia. She learned the value of character styles after her publisher told her to unbold menu paths in her 200-page book. Jean had not used character styles. She had to edit all 200 pages by hand, with some help from Find & Replace. This was the last time Jean failed to used character styles.

Another example I have encountered is on corporate documents where a company name is supposed to be rendered in a certain font and style. Having a character style for that makes it easier. But for the true master it goes much deeper. We all use character styles in a bad way every day. Three of them, in fact: BoldItalic, and Underline.  If you think about it, these are all cases where a bit of text within the paragraph gets special formatting while leaving the rest of the paragraph in its normal state.

Web technology gives us a clue here. While the early versions of HTML were quite happy to use tags for bold and italic,  those have since been deprecated in favor of strong (used in place of bold), and em (short for Emphasize, in place of italic).  And while those tags normally have the appearance you would expect, all of that can be changed by what you put in the style sheet. And you can change the appearance of one of these elements for an entire web site in just moment by changing that style sheet if you have set up your site properly. (To see what I am talking about you might want to check out the CSS Zen Garden site).

Now think about a long document in which you have made things bold, italic, or underlined by clicking on buttons as you go. And then you are asked to change, for instance, all of the bold to italic. If you try to use the Find and Replace capability you will quickly discover that it cannot do this, at least not in any easy way. You might then resign yourself to crawling through the entire document one page at a time to find and change all of the bold characters. But if you have created character styles for this, all you would need to do is to change the style definition in your document, and you can do that in seconds.

Another example that comes up frequently is with technical documentation. With this kind of writing you often need to have a consistent style for the path to a file, or a style for code snippets. These can often be handled at the paragraph-level by having a paragraph style, but it can be very handy to have character styles available for when you need to incorporate a brief reference into a paragraph without ending that paragraph and starting one just for your reference. You can also use character styles to have some words appear in a different color, or to have a shaded background. So these styles are quite versatile.

Built-in Character Styles

A look at the built-in character styles that come with LibreOffice can give you a sense of what these can do. These include:

  • Bullets – This style defines how the bullets themselves will look
  • Caption Characters – This is useful for putting a caption on included images
  • Definition – Useful for having a distinct style for defining terms, handy for technical writing among other things.
  • Drop Caps – This is where the initial capital letter of a paragraph extends below the line instead of above it.
  • Emphasis – Look at this. This character style makes things italic, just like the Web style we mentioned above.
  • End Notes
  • Footnoes
  • Links
  • Page Numbers
  • Quotations
  • Strong Emphasis – And this is the equivalent to the Web style “strong”, and makes characters bold
  • etc.

Applying Character Styles

This is quite easy. As with the paragraph styles you just need to have the Styles and Formatting Window open (and if you follow my recommendation you have it always open and docked on the left), and have the Character Styles tab selected. Click on the word you want to apply the style to (your insertion mark can be anywhere in the word, it doesn’t matter), then double-click on the style to apply it. For single characters or multiple words just select the text and then double-click the style. To go back to the default text style just double-click on default.

The best way to get to know these character styles is to spend 20 minutes applying different styles in a text document. When you do so, you will soon discover that multiple styles seem to look the same. For example, out-of-the-box the styles Emphasis and Variable both look the same. Why would you use both of them if they have the same appearance? The reason is the they serve a different function within your document. The style Variable is one you would want use while discussing coding, and you would want all of your variables to use this style. That way you can selectively change the appearance later of just the variables without changing all of the Emphasis-styled words, or vice-versa.

Also, some styles may not work properly. I noticed that the Drop Caps style did not seem to do anything at all, but when I went in to the style to modify it I could get it to work by selecting Subscript on the Position tab, removing the Automatic check mark, and then changing the font size to 100% and the raise/lower by to 17%. That seemed to do the trick for me.

Creating and Modifying Character Styles

Creating or modifying character styles is quite easy. As with the paragraph styles you just need to have the Styles and Formatting Window open, select a style and right-click on it to choose Modify. Or right-click anywhere in the window and choose New to create a new style. The options here are simpler than they are for the Paragraph styles because all you are doing is setting a text appearance. On the first tab, Organizer, you have the name and possible link to another style. Then you get the Font, Font Effects, Position, and Background. As a reminder, remember that styles are contained in Templates, so if you are creating or modifying styles that you want to permanently have available, make sure you are editing your default template. Or if you are doing this for a particular type of document, you may want to create a template specifically for that purpose.

Example: The one common text style that does not seem to have a built-in character style is the Underline style, so let’s create one! Go to File –> Templates –> Edit, and select your default template. Then with the Character Style tab open in the Styles and Formatting window, right-click, and select New. On the Organizer tab, give it the name Underline. As before, do not link it to any other styles. For Font I selected Liberation Serif, normal, 12 pt. That is the font I use as my usual font for my Paragraph style, so that keeps everything consistent. For Font Effects I select a single underline. leave my position normal, and no background fill. Click OK and the style is created.

When you start to understand the power of these styles you will probably create or modify more of them to meet your needs. But for now, I will leave you with a quote from the LibreOffice Writer documentation that is good to really study and understand:

  • Never mix character styles and manual formatting. Manual formatting supersedes character styles. If you combine them, you may end up wasting hours in frustration trying to figure out why your character styles don’t work.
  • Right-clicking and choosing Clear Direct Formatting removes manual formatting but not character styles. To remove a character style, select the characters, then select the Default character style.
  • Realize that clicking the Bold icon in the toolbar is not easier than double-clicking on a character style that is preset for bolding the font typeface.
  • Leave the Styles and Formatting window open to make character styles easy to access.

Again, if you are using the Bold, Italic, or Underline buttons (this is what they mean by Direct Formatting or manual formatting) you are doing it wrong!

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

CC BY-SA 4.0 LibreOffice Writer Character Styles by Kevin O'Brien is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.