Font Error: Heading & Remove Formatting Use LIBERATION MONO Though Ubuntu Specified in Options & Style

Hi, and hope you can help. I’m having a weird issue since I upgraded LibreOffice from the official Ubuntu version to the latest via PPA (v.7.2.5.2). I have heading styles defined, all in the Ubuntu font, and in Options > LibreOffice Writer > Basic Fonts (Western) all the fonts are different sizes of Ubuntu, but sometimes when I remove direct formatting, or use a heading style on a paragraph, it comes up in Liberation Mono. So, whether it’s reverting to Default Paragraph Style, or using (for example) Heading 3, it’s using that font instead of what they’re set to (Ubuntu).

I’ve looked around, and the common answer is what I’ve outlined above, though obviously this isn’t working for me. As you can see below, all the fonts in Options are Ubuntu (previously, I left the one for Heading as Liberation Sans - note not Mono - but have since changed that to Ubuntu too).

And to illustrate that the font for the particular heading I’ve used as an example is indeed Ubuntu, see the Paragraph Style pic below (sorry, I did have 3 separate pictures, but apparently as a new user I can only insert one, so have combined them all):

So is there something I am missing (like something I can change in Expert Configuration), or should I assume this is a bug? Especially since this is intermittent, I’m assuming the latter, but I thought I’d create an account here see what you learned chaps think. Many thanks in advance!

Find attached a small sample file in which both the incorrect font in heading and in text that had formatting removed was easily replicated.
Font Error Sample.odt (15.2 KB)

Summary of the discussion:

  1. When you copy text from websites, paste the text as Unformatted text. That way, you can avoid all kinds of problems with formatting that conflicts with the formatting of your document.
  2. Keep in mind that the formatting specs in direct formatting take precedence over the formatting specs in character styles and those over the formatting specs in paragraph styles.
  3. When you write long, structured documents with headings, headers, footers and so on, work with styles and don’t use the formatting tools on the toolbars and key bindings (like Ctrl+I for Italics).
  4. Read the documentation about styles in Writer. Visit the Styles dialog boxes (Paragraph, Character, Page styles are most important here), visit all tabs and make a mental note of what you can do. Note that you can always modify a style when you don’t like something about it - the font, the font size, line spacing, alignment, whatever, you change it instead of making your own styles.
  5. When you plan to write many documents with basically the same formatting, make a template for it, and make it the default template. Note that if you come from MS Word, the default template is very different. Last time I used Word (over ten years ago, so things may have changed), the default template (normal.dot) was modified every time you modified a paragraph style (yes, it had paragraph styles back then). In Writer, that doesn’t happen.
  6. When you make the template, be very careful that you don’t apply for instance a character style to text at the start of the document that will serve as the template. When you delete the text, the character style may still be in effect.

For the use of styles, see the posts by @ajlittoz.

2 Likes

in additional to @anon87010807 :

Professional text composition with Writer

In such circumstances a screenshot is next to no help to diagnose the issue. Edit your question to attach a sample file. Make sure the problem is still present in the sample.

The screenshots were just to illustrate that it wasn’t a font setting I had entirely overlooked, which was the case with pretty much all others asking for help on the same problem. I have attached a sample file I created, in which I was immediately able to replicate both errors (wrong font for heading, and wrong font when removing formatting from text).

Your paragraph styles are all correctly configured and you have no direct formatting.

But, you have applied character style Source Text in second and third paragraph.

In Writer there are three layers of formatting, from bottom to top:

  • paragraph style
  • character style
  • direct formatting

Each layer has its independent configuration. When conflicting attributes are set, the one in the highest layer takes precedence.

To fix your issue, select the sequence with the excess character style and apply No Character Style character style. You can do this by double-clicking on the relevant style in the style sidepane (F11). The character styles are listed after a click on the second icon from left in the pane toolbar.

1 Like

Thanks - I got that to work, but can I stop this from happening in the future? Like, should I be editing the default template or something, and how? At the moment, it all seems rather random: it happens to some paragraphs I use the Heading on, yet not to others; when I clear formatting on some paragraphs, it’s as expected, but in others it reverts to the Liberation Mono font. So is there a way to stop some paragraphs having the character style Source Text? I can see via that pane that Source Text is indeed applied to those paragraphs, however I am in no way manually doing that - I create new paragraphs that are Default Paragraph Style, and besides turning some into a heading via the Styles menu, that’s all I am doing. (And as I pointed out, this wasn’t happening to me prior to upgrading LO to the latest version via PPA).Any help in stopping this happening in the future would be greatly appreciated!

Edit: according to the Character Style pane, that first heading, and the 2nd paragraph of text (as in 4th paragraph) - in other words the ones correctly in Ubuntu font - are also Source Text, whereas the ones I edited are now No Character Style. So, I don’t know what to make of that!

Character styles take effect exclusively after manual application. Consequently, there is no point in modifying any template. You might have associated the style with a keyboard shortcut and may have triggered it while pressing the wrong key combination (e.g. Ctrl instead of Shift + another key).

If some paragraphs are Source Text without font change, then you also have some direct formatting above it in an attempt to fix the mishap.

A radical way to eliminate spurious character styles is to Ctrl + A and apply No Character Style but this will also eliminate all your intended character styles.

Also an important advice: in Writer Default Paragraph Style is not at all the “standard” style for your text/discourse. It is the ultimate ancestor of all styles and defines defaults applicable to all (a bit in the same way as Tools>Options, LibreOffice Writer>Basic Fonts (Western) but allows to set any parameters, not just font). The “standard” style for your text is Text Body which is automatically invoked when you hit Enter at the end of a Heading n paragraph to switch to “normal” text.

1 Like

Hi again. I figured out a couple of work-arounds, being that I could select the entire document if need be, and choose No Character Style - not ideal, but for documents where I am not using character styles, it’s fine. But, wishing to prevent having to do that, the other thing I did was just modify the Source Text style to be Ubuntu instead of Liberation Mono, so at least I won’t even know when Writer is deciding to add that character style to a paragraph (I’m assuming that will be the case).

However, if you (or anyone else reading this) knows why Source Text style is being applied, and how to prevent that (once again, just stressing that I am not the one doing this!), please feel free to fill me in. And if, taking into account I am not applying that style, you think this is indeed a bug, please let me know the correct place to report this. Thanks for your help!

Do the following: Tools - Customize - select Keyboard. In the Category box, scroll down all the way to Styles, double-click on that and select Character, that forces a list of character styles in use, with associated key bindings. If your Source code character style has one, delete it and your problem will go away.

1 Like

Thanks so much for that info - I can see there are shortctus for the Headings I use, and I’m going to use it to create my own hotkeys for other Paragraph styles. Unfortunately when it comes to Character styles, none were defined, so me accidentally hitting a key or combo isn’t what is causing this! Thought that would have been strange, since this only started happening in the 3 weeks or so since I upgraded to 7.2.x, so it would have meant me getting really clumsy on the keyboard all of a sudden, hehe. But I didn’t rule that out (even though this happens merely after hitting Enter to create new paragraphs), and was going to go looking for where shortcuts are defined, so thanks for making that easy (I would have looked in Tools > Options). So this is still looking like a bug, but I have ways around this now - and with Source Text now being set to the default font, I won’t really notice it is happening (though this won’t help any who do use that character style, so I’m still thinking I need to file a bug report). Many thanks once again.

Actually, if you start with a blank document, modify some styles, play with them on some text, apply the Source code character style to it, then delete the text, then save it as a template, that character style can stick. Then you start a new document based on that template, and you start typing in the Source code character style.

Thanks for your help - it’s been really informative! In the reply to floris_v below, you can see we can rule out hitting a key or combo (there isn’t one defined), and the random nature of when, where and how this occurs really does suggest a bug to me. I will always assume user-error on my part first, but it doesn’t look like I am doing anything wrong, and while I can replicate this error, as I said it is random: I might merely hit Enter to create a new paragraph and it happens, or use a paragraph style, or remove formatting. But I wanted ways around that, so while the why of it isn’t solved, the how to fix it has been established (though I’m happy with the compromise of having Source Text being the default font, as I don’t use that style).

As for Default Paragraph Style vs Text Body - that’s really interesting! When I create a new document, it always starts in Default Paragraph Style, so I just stick with that. I did notice that after hitting Enter after a heading that it becomes Text Body, but I always change it back to Default Paragraph Style for one reason: no formatting. Text Body has line-spacing (which I really don’t like) and spacing below paragraph (I prefer empty paragraphs between paragraphs, because a lot of what I type ends up getting pasted into my blog and other sites on the web). But I have removed those spacings from Text Body now (in this document - I guess I’ll have to open the template I import my styles from and fix it there), so is there a way to get new documents (and existing ones) to use that as the default paragraph style instead of Default Paragraph Style?

Well, all styles come with default settings that you can change according to your preferences.

When you modify a paragraph style, select the Organizer tab. You will see that the Heading n styles are configured to set the paragraph style for the next paragraph to Text body, which means you don’t have to apply that style yourself. I suggest that you visit all tabs of the paragraph style dialog box and carefully study all the options they offer. It’s worth it. LibreOffice may have lots of bugs, but this part was well-thought-out.

1 Like

floris_v: forgive this forum newbie question, but how are you managing to quote other users, with the name showing up? I only have a Reply link below comments, not a Reply/Quote option like other forums.

As for your info on styles and templates, that’s really interesting (and further helps me rule out some kind of error on my part, since I have never used the Source Text character style). While we’re on the subject, I import my Paragraph Styles from a document I created and saved as a template for that purpose - but is there a “default” template Writer uses that I can also edit? Besides wanting to add my styles to that, I’d like to “globally” edit the Text Body style (I want to remove the spacings). Or is the way to go about it is to make my own template the default that will be used for all new documents? Many thanks in advance.

No problem, you are very welcome.

  • Select the text that you want to quote, a popup to quote the selection appears.
  • “Or is the way to go about it is to make my own template the default that will be used for all new documents?” Yes, there is a default template. See [Tutorial] Creating a new default template.
1 Like

Select the text to quote and a Quote button appears; click that button.

1 Like

Awesome - I never even looked in that Organiser tab before! I will have to look into Inherit from: Default Paragraph Style, as despite the info above about what that style is, I still have to wrap my head around exactly what it is (previously, to me it was like Text Body but with spacing).

And thanks for the other info you just put up. I didn’t realise all I had to do is select text to quote. And I will definitely check out that article and create my own default template, so many thanks once again for your splendid help!

This is great - all I have to do is edit the template I created to store my heading styles, apply some of what I’ve learned in this thread about character and paragraph styles, and make it the default template. I’ve slowly come to realise there aren’t that many things that are “global” in Writer (I mean in regards to styles and formatting, etc), but that they’re defined in templates, so this will be invaluable in making Writer how I want it. Many thanks once again.

See Writer Guide 7.1 for an exhaustive introduction to Writer, especially chapters 8 and 9.