We will be migrating from Ask to Discourse on the first week of August, read the details here

Can't update style: line spacing

Hi, I think I might've hit a bug, either that or I'm really missing something.

I use LibreOffice version: 6.4.4.2 (x64), on Windows 10.

I have a long text (about 500 pages), written in different styles, Text Body, Headings and so fort. Most of it is written in Text Body. Today I wanted to update the Text Body style, and it turns out I can't change the line spacing properly.

I go to styles (on the right panel), right click on Text Body --> Modify. I go to the Indents & Spacing tab, I modify the line spacing. It doesn't matter to what I modify it to, I can change the fixed value, I can change it to 1.5 lines, whatever I want. I click on Apply, then OK. The "AutoUpdate" option in the Organiser tab is checked (but I don't think it has actually anything to do with this. I tried with it unchecked too. Nothing changes).

What happens: only some paragraphs written in the style Text Body are actually updated. Many others are left with the line spacing they had before, so I have this weird alternation of paragraphs with different line spacings, which is terrible. Interestingly, if I instead try to update the font, either the size or the type, then it works just fine. The font gets updated on all paragraphs without problems. So the program recognizes those paragraphs as all written in Text Body when I update the font, but apparently not when I edit the line spacing. If I click on one of the paragraphs which DIDN'T get updated, and then I go to the style selection tool on the top bar and click on Text Body again, even if it is already selected, then it does update the line spacing. So it seems as if the program temporarily forgets that those paragraphs are indeed written in Text Body (but it remembers it when I change just the font).

Workaround I found: I go to Find and Replace, select all text written in Text Body, and then choose Text Body from the style selection tool. Then it works. But I would much prefer if the stlye could be updated the normal way, also because I have indeed some text in the document which has some direct formatting that I would like to keep, for example different alignements, and which disappears if I do this. This would mean going through more than 500 pages (!!!) and change all the instances manually.

I tried changing the style in Safe Mode, with no results. The problem persists.

I would be extremely grateful for any help because I am going nuts. Is this really a bug? Does the fact that I have some direct formatting in the text somehow confuses LibreOffice? Important note: the paragraphs who don't want to change the line spacing ARE NOT the paragraphs with direct formatting. They're random paragraphs distributed throughout the whole ...

edit retag close merge delete

Followed your recipe but no problem here. Have you changed the default template? In which case, it could already contain some direct formatting or badly configured style.

( 2021-02-18 14:33:54 +0200 )edit

The waiting part seems to be fundamental (strongly wondering whether this has to do with autosave). I tried again with another brand new document and at first I couldn't replicate the problem either. Then I just kept tiping some random stuff here, replacing some there, and then the problem manifested itself again. I am truly at a loss of what to do here. Also, I found the templates under "File" but it can't figure out how to modify them so that this DF randomly attaching itself to the text I'm typing stops.

( 2021-02-18 14:59:54 +0200 )edit

Very strange, there should not be any change triggered by a delay. To make sure, save your user profile and try either to restart in safe mode or to reset your user profile.

( 2021-02-18 15:11:31 +0200 )edit

Tried with safe mode, same problem. Note: the problem seems to appear following a new modification to the style. That is: type random stuff, random paragraphs, random document (the random paragraphs are important. This seems to happen more if there are several paragraphs). Then modify the style and apply. Things should be normal now, and the style should have been applied correctly. Ok. Then some more random tipying, substitute words and stuff. Then change style again. At the second change, it goes wrong for me.

( 2021-02-18 15:22:49 +0200 )edit

Never experienced that. I'm short on ideas. Have you reset your profile? But save it before, just in case.

( 2021-02-18 15:39:23 +0200 )edit

Yeah I resetted everything :( On a side note, OpenOffice doesn't do this. I just tried. I hope it's okay to say this on a LibreOffice forum, but I won't get mad if the comments gets cancelled. Which is a shame by the way because I think LibreOffice is great and look much better than OpenOffice too, but it's a catatstrophe for me to have a document of several hundred pages with DF randomly sneaking in :(

( 2021-02-18 15:47:15 +0200 )edit

I mean not that it cannot be fixed with some patience but still, it's really a problem.

( 2021-02-18 15:50:59 +0200 )edit

DF didn't sneak in on its own. You created it at first and now you painfully struggle to get rid of it. DF is evil. It was offered supposedly to ease transition from Word to OO and LO but IMHO it's a sin against rigorous document design. It took me a long time to discover the benefits of styles. I still have old documents which need to be cleaned but I move backwards to it because of the amount of work on 100+ pages docs. If I finally tackle this task, I'll also template them so that they get automatically updated when I tune my template.

Of course, if you hand LO to a new user and from scratch require styling, s/he'll run away as fast as possible because it's just like trying to enter desktop publishing without knowing what it is.

( 2021-02-18 15:55:51 +0200 )edit

But how am I creating it? I don't understand this. If I type new words into a new paragraph, or substitute a word, without changing anything, just typing as I described above, why does it get DF? You said it's strange right? So it isn't supposed to happen? And indeed in OO it very much does not happen! Tell you what, I'll delete the program and try again with a brand new installationa and pray for the best.

( 2021-02-18 16:00:39 +0200 )edit

I discovered what happens. I uninstalled everything, I dowlonaded the latest version, the one in development, 7.1, and I enabled the experimental mode so I could access the style inspector. I opened a new blank document, I opened the style inspector and I started my random typing around. The DF sneaks in when I double click on a word or when I in any other way select a portion of text and then type new stuff in. The new text now has DF. Fun fact: if I delete the text portion I previously selected, no problem, the DF doesn't appear. It's super weird with extra weird on top but I'm happy that at least now I know how this happens and know how to avoid it. Is this behaviour meant to be? If not, should I report it somewhere? You could also try do the select ...(plus)

( 2021-02-18 17:34:54 +0200 )edit

Sort by » oldest newest most voted

This is indeed a bug, but it doesn't have to do with line spacing specifically.

What happens is: when you select a portion of text, be it a word or a whole paragraph, and then directly type new text in order to substitute it, LibreOffice applies direct formatting to the new text, meaning that the new text has all the same characteristics of the old one, but they are recorded as characteristics belonging to direct formatting and to the style of the paragraph. Since direct formatting doesn't change when you change paragraph or character style, when you try to later edit the paragraph style you'll find that the new changes won't apply to all the text you typed above old text. So basically you can't update your style properly and you'll have patches of directly formatted text all over your document if you've been substituing a lot of text.

There is a workaround to this that's not too bothersome: instead of typing the new text, you first delete the old one and only then you type. So no substituting text, ever, at least until the bug is fixed.

The bug has been seen on several versions of LibreOffice, backward until at least 6.4.4.2, and in the new versions too, on Windows 10. Maybe different OS don't have this problem but that's unsure.

Important note: always use styles and no direct formatting. This has no effect on the bug, but I mention it because if you have to fix a document with a lot of direct formatting sprinkled in it as a result of the bug, it's going to be much easier if you don't have to deal with the direct formatting you put in voluntarily yourself. Example: you have a paragraph directly formatted to be centred instead than left aligned. Then you realize there's direct formatting everywhere as a result of the bug, so the obvious thing to do to fix it is to select everything and just hit CTRL+M. Well, now the text you wanted to be centred is going to be left aligned as per style format. So using by default no direct formatting at all is going to save you time and energy, generally and even more if you have to deal with this bug.

more

First beware of the AutoUpdate option in the Organizer tab of the style definition. I rather strongly recommend to not check this box. It is somehow a poor substitute to real style formatting for people coming from Word and used to its workflow heavily based on direct formatting. When checked, a seemingly innocuous direct change on a paragraph may have unexpected effect everywhere.

If modifying Text Body does not cause the paragraphs to update, it is a sign you have direct formatting on these paragraphs. Any action on toolbar icons is direct formatting, not only bold or italic. You may have used Set Line Spacing button and you don't remember it. This is enough to "lock" the line spacing and prevent update by the style. Even if you use the button to set line spacing to the exact same value as in the style, this is still a "forcing" value overriding the style setting.

The fact it works with font face and size just says these settings were not overridden by direct formatting.

The only way to recover to normal style behaviour is to get rid of all direct formatting.

You mention you don't want to lose some of the direct formatting. This is also the sign that you didn't understand the purpose of styles: they are not intended to mark typographical variations in your text but to give semantic significance to parts of the text. You translate this significance by configuring the styles for typographical attributes as a consequence of the significance. Therefore, if some Text Body paragraph have a different alignment from others, then they have not the same significance and should receive another style (perhaps derived from Text Body so they inherit most of the attributes and changes to Text Body also apply to them).

Don't neglect character styles. They say that the words within a paragraph have not the same "value" as the others. You should not bold a word with Ctrl+B but mark it with Strong Emphasis or another style whose name will "explain" why it is formatted differently. Note also that bold words, rendered identically, may be styled differently because they don't belong in the same significance.

Maintaining a 500-page document is impossible if you don't implement a consistent collection of styles (paragraph, character, page, frame and list -- all are equally important and contribute to the "comfort" and ease of formatting).

Forget about typographical attributes to focus your attention, as an author, on the significance and semantic value of paragraphs and words. This is the most important part. The appearance comes later. With an appropriate style markup you should be able to change completely the appearance of your document without the need to re-read it. And in a matter of a very small number of minutes.

Then no bug but a wrong workflow.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of ...

more

Hi,

ok, from now on I will not use any type of direct formatting at all.

I still don't think this solves it though; I created a new document with the first few paragraphs of my original document. It's in attachment and I just typed random stuff in it. It has all the problems of the original documents and some more (somehow, it appears that if I type new words, or delete a word and type again, it creates more randomization). There's no direct formatting in it for what concerns font and size.

As for the Set Line Spacing button, I don't think I've ever used it in all my life. I don't even know where it is. So are there other ways I could've directly formatted my line spacing?

( 2021-02-18 14:00:09 +0200 )edit

I just managed to replicate the problem with a brand new paragraph, in the same document. I created a new style, Text Body Bold, which is the same as the text body just bold, as you suggested. So I just typed random things. I tried to apply modifications to the style, and everything went fine, line spacing, font size, everything worked and the style changed. AutoUpdate was unchecked. Then I just selected some of the random words and typed in other random stuff in their place, as if I was normally modifying a document. And there it was! Now if I tried changing the style, those new words were regarded as directly formatted, even if the only thing I did was simply typing them in place of other words, without changing style or anything else. But if I try this in a new document, that is, I take a completely ...(plus)

( 2021-02-18 14:11:39 +0200 )edit

I tried something else: I selected the entire text of the experiment document I attached, I cleared all direct formatting. I expect things to be normal now. They weren't. Again, if I type new words in place of others LibreOffice regards them as directly formatted. And then I managed to replicate the problem in the brand new document too. All I did was waiting some minutes, then adding a line of text in the style Heading 1, and then I just modified some words at random in random paragraphs and boom, the style Text Body could not properly update anymore. Note that in this new document I didn't apply any type of direct formatting at all. So no, it is NOT my original document, something I'm quite happy about, but it's something else, something I'm desperate about.

( 2021-02-18 14:12:24 +0200 )edit

Your sample file shows that the "aaa" paragraphs are "pure", i.e. without direct formatting. Those with random text are plagued with DF.

When you replace words in text, what you type inherits the total formatting (styles+DF) at the position of the cursor. Thus, even if you type without adding anything, you still inherit DF in effect at the initial position of the cursor. This DF blocks any attempt to update text with style modification.

Remember, it is very difficult to get rid of DF and DF always plays tricks on your back.

Side question: has your text ever been store in Google Docs? When I open it it complains the Italian hyphenation package is missing (which is true), but usually it results from some corruption by Google Docs.

( 2021-02-18 14:27:40 +0200 )edit

"When you replace words in text, what you type inherits the total formatting (styles+DF) at the position of the cursor. Thus, even if you type without adding anything, you still inherit DF in effect at the initial position of the cursor. This DF blocks any attempt to update text with style modification."

Ok I think we're onto something here. You're saying that if I type something new in place of something typed before, then I automatically get DF on the new text, is that so? Because this is the behaviour I also thought I noticed. So how do I get rid of this? How to I make modifications and changing words without sprinkling DF all over my text? You named "default template" in the other comment, does this have something to do with DF? Because it becomes rather cumbersome if I have to select Text Body everytime ...(plus)

( 2021-02-18 14:42:37 +0200 )edit

I typed a DF paragraph. I put the cursor somewhere and Ctrl+M in the hope to start without DF. No luck!

To get rid of DF, I must type a character, select it and Ctrl+M. BUT, if I overwrite it, I get again DF because DF is in effect before the character I replaced. The procedure seems to be: type a char, select it to Ctrl+M, move cursor past this character and type. Now, what you type inherit from the cleared char. Of course, if this char was a dummy, you must later erase it.

Not user-friendly at all. This illustrates once again why DF should be avoided.

I was mentioning templates in case your document was template-based and you had some mis-configuration in it. Doesn't seem to be the case.

( 2021-02-18 15:07:56 +0200 )edit

So to summarize, you're telling me that: - if I type something in order to substiute something I had typed before, I get DF, EVEN IF the text I'm typing over didn't have any DF at all from before, and neither did the whole paragraph or the whole document for that matter? - and that it is a pain to try and remove DF afterwards? Not user friendly at all, no!

Do you know if there's a way to highlight text pleagued by direct formatting in the document? So that I can at least see what in the world is going on?

( 2021-02-18 15:14:43 +0200 )edit

No way presently. Upcoming 7.1 will have a "style inspector" which will show all the layers paragraph+character+DF. Meanwhile, nope.

( 2021-02-18 15:42:12 +0200 )edit