Remove direct formatting but retain character styles
Remove direct formatting but retain character styles
How do I remove all direct formatting but retain all applied styles, including character styles and list styles.
I just needed to tidy a document containing both direct and styled formatting. I was unable to remove direct paragraph or character formatting without losing applied character styles, and list styles left me hopelessly confused. Was I doing something wrong (select, right-click, default), or is this just the way things are?
I use mainly Calc and don't have much experience with styles beyond Calc's cell & page styles.
I just needed to tidy a document containing both direct and styled formatting. I was unable to remove direct paragraph or character formatting without losing applied character styles, and list styles left me hopelessly confused. Was I doing something wrong (select, right-click, default), or is this just the way things are?
I use mainly Calc and don't have much experience with styles beyond Calc's cell & page styles.
Re: Remove direct formatting but retain character styles
Direct formatting and character styles exist at the same level in the code, so removing the direct formatting---that is, applying the default paragraph formatting---will also remove character styles because they're not part of the default paragraph format. I don't like that either, but I don't see a way around it.huw wrote:How do I remove all direct formatting but retain all applied styles, including character styles and list styles.
What exactly do you mean by having problems with list styles? If they truly are list styles, you won't lose anything by applying default paragraph formatting to them. Could you please be more specific, or maybe post a sample file?
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Re: Remove direct formatting but retain character styles
Thanks. That's what I feared.foxcole wrote:Direct formatting and character styles exist at the same level in the code, so removing the direct formatting---that is, applying the default paragraph formatting---will also remove character styles because they're not part of the default paragraph format. I don't like that either, but I don't see a way around it.
It was a bulletted list, one item of which had a numbered sub-list of its own. When I selected the lot and set it to default, none of the bullets or the sub-list numbering disappeared, even though none of the list styles highlighted in the styles pane when the cursor was in a list item. The sub-list did lose its indent for item number 1 (the only sub-list item to have retained its indent). The content was pasted with formatting into a blank Writer doc from an email application.foxcole wrote:What exactly do you mean by having problems with list styles? If they truly are list styles, you won't lose anything by applying default paragraph formatting to them. Could you please be more specific, or maybe post a sample file?
I have attached an anonymised version. I can't tell whether the lists are using hidden styles, or if they have direct formatting that doesn't get removed with the usual method. But as I say, I am new to this.
- Attachments
-
- Copy & pasted list.odt
- (11.05 KiB) Downloaded 366 times
Re: Remove direct formatting but retain character styles
I think this might be the case, since it's pasted in from e-mail. The paragraph style of those bulleted items appears to be Text Body. If I open the file with 7-Zip, I see the Text Body style definition includes a bullet... even though nothing shows up on the Numbering tab in that Text Body style, and even though the Bullet tool in the toolbar is not highlighted as I would expect for direct formatting. It seems to be treating the bullet as part of the paragraph's default style.huw wrote:I can't tell whether the lists are using hidden styles, or if they have direct formatting that doesn't get removed with the usual method. But as I say, I am new to this.
But if you click in one of those paragraphs and click the Bullet tool, the bullets go away.
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Re: Remove direct formatting but retain character styles
Writer knows they're a list because the Bullets & Numbering toolbar appears when the cursor is in it, but creating new text using the Text Body style does not result in bullets appearing, so they're neither a simple bullet character at the beginning of a paragraph with a hanging indent, nor a style, they are direct formatting which can't be removed using the Default Formatting option.
In fact, this is what is created in a new blank document using the list button on the Formatting toolbar (I just tried it). No wonder it's so hard to convert people to styles! Writer has a reputation as one of the better word processors to use them, and it still requires obscure knowledge like this to create a purely styled document with no direct formatting.
Most of us know how difficult it is to work on a document using styles until all direct formatting has been removed, but my ideal approach is to apply styles over the top and then set the doc to Default, revealing the styles beneath. Which is obviously not practical in all situations, including this one, beacause
Thanks for your help. I'll go back to my spreadsheet now...
In fact, this is what is created in a new blank document using the list button on the Formatting toolbar (I just tried it). No wonder it's so hard to convert people to styles! Writer has a reputation as one of the better word processors to use them, and it still requires obscure knowledge like this to create a purely styled document with no direct formatting.
Most of us know how difficult it is to work on a document using styles until all direct formatting has been removed, but my ideal approach is to apply styles over the top and then set the doc to Default, revealing the styles beneath. Which is obviously not practical in all situations, including this one, beacause
- Character styles are removed along with direct formatting when Default is applied, and
- Some direct formatting is not removed by applying Default
Thanks for your help. I'll go back to my spreadsheet now...
Re: Remove direct formatting but retain character styles
I just came across issue 85464: Choosing 'Default formatting' does not remove character styles, which implies that although poorly specified / documented, it is intended behaviour for 'Default Formatting' to remove character styles.
It's a shame there's no simple way to remove all direct formatting, but retain all applied styles.
It's a shame there's no simple way to remove all direct formatting, but retain all applied styles.
Re: Remove direct formatting but retain character styles
I read i85464 to mean that the intended behavior was that Format > Default would not remove applied styles, only direct formatting. The latest snapshots behave this way: Format > Default no longer removes applied characters styles.
I added a comment/question to Issue 47893: Format --> Default resets applied character style., but have gotten no response.
Are these two issues duplicates? Looks like it to me.
Sorry, I'm probably butting in and confusing the issue--again
I added a comment/question to Issue 47893: Format --> Default resets applied character style., but have gotten no response.
Are these two issues duplicates? Looks like it to me.
Sorry, I'm probably butting in and confusing the issue--again
AOO4/LO5 • Linux • Fedora 23
Re: Remove direct formatting but retain character styles
Not confusing, but definitely reading it differently to me. I still read 85464 as saying failure to remove character styles was a regeression, and that it has been fixed. I'd expect it to appear in the latest build soon.
Anyway, I've had my say at 47893 too.
Anyway, I've had my say at 47893 too.
Re: Remove direct formatting but retain character styles
You are too kind. After some more coffee and a second reading, I think you are exactly right: issue 85464 is intended to make Format > Default remove character styles again.... definitely reading it differently to me.
AOO4/LO5 • Linux • Fedora 23
Re: Remove direct formatting but retain character styles
When you think about it, that's the way it should be, isn't it? To return a paragraph to its default style means to remove everything that's not the paragraph's default style.
It is unfortunate that you can't tag character styles when you apply them, so they'll be protected when default formatting is applied, but all told, I'd rather know what to expect when I ask for the default paragraph style and not have to guess what will or won't be removed. I realize this can be awkward for people who use character styles to apply different languages within a paragraph, but there doesn't seem to be a one-size-fits-all solution for this, yet, so I'd rather err on the side of predictability.
It is unfortunate that you can't tag character styles when you apply them, so they'll be protected when default formatting is applied, but all told, I'd rather know what to expect when I ask for the default paragraph style and not have to guess what will or won't be removed. I realize this can be awkward for people who use character styles to apply different languages within a paragraph, but there doesn't seem to be a one-size-fits-all solution for this, yet, so I'd rather err on the side of predictability.
Cheers!
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
---Fox
OOo 3.2.0 Portable, Windows 7 Home Premium 64-bit
Re: Remove direct formatting but retain character styles
Surely it is a better compromise to have to use two steps to remove all styles (i.e. apply default character style, then apply default paragraph style), than it is to be able to do that in one step (with Default), but have no way of removing direct formatting alone!