deleting paragraph style B and replacing it with paragraph style A

Everything related to our flagship word processor.
Post Reply
shmuel
Posts: 13
Joined: 2019-10-18 06:55:45

deleting paragraph style B and replacing it with paragraph style A

Post by shmuel »

In my document, there are several very similar paragraph styles. How can I delete paragraph style B and make sure that all paragraphs with paragraph style B will be formatted with paragraph style A?
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: deleting paragraph style B and replacing it with paragraph style A

Post by adryan »

G'day, shmuel et al

One way of doing this is to use the Find & Replace system with settings as in the attached illustration. (The Case checkboxes don't really matter here.)

Changing Paragraph Style.jpg
Changing Paragraph Style.jpg (190.74 KiB) Viewed 17056 times

The expression in the Find field was obtained from the drop-down cogwheel menu ("Find what:") under Wild Card > AnyParagraph. The expression in the Replace field is "backslash zero".

Select the contents of the Find field, then Format > Paragraph Style > Paragraph Style B (or whatever).

Select the contents of the Replace field, then Format > Paragraph Style > Paragraph Style A (or whatever).

Then click on the Replace All button.

When making major changes such as this to an entire document, it's advisable to do it on a duplicate, just in case of mishap.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: deleting paragraph style B and replacing it with paragraph style A

Post by phspaelti »

With all respect to Adrian, the more straightforward method is to place your cursor in a paragraph with Paragraph Style B and then:
  1. Choose Paragraph Style:Select All in Style
  2. Apply the desired Paragraph Style A
Find is not really needed for this.
philip
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: deleting paragraph style B and replacing it with paragraph style A

Post by adryan »

G’day, Philip et al

Much better, Philip!

I don’t think I’ve ever needed to do this on a mass scale before, so I wasn’t aware of that command. Thanks for pointing it out.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
shmuel
Posts: 13
Joined: 2019-10-18 06:55:45

Re: deleting paragraph style B and replacing it with paragraph style A

Post by shmuel »

Hi Adrian and philip

Thanks to both of you for your help! Achieving this with Select All in Style is really easy, and the paragraph style list in my document is much cleaner now.

One thing that was bothering me a bit was that although after all occurrences of text in paragraph style B have been replaced this way by paragraph style A, when I then went on to delete paragraph style B from the style sheet, I was told that "This style is currently used in the document" – but I was not able to find it. I deleted it anyway, and so far I have not had any problems.
vwnisus
Posts: 58
Joined: 2016-04-24 00:13:31

Re: deleting paragraph style B and replacing it with paragraph style A

Post by vwnisus »

phspaelti wrote: 2019-10-25 02:40:00 With all respect to Adrian, the more straightforward method is to place your cursor in a paragraph with Paragraph Style B and then:
  1. Choose Paragraph Style:Select All in Style
  2. Apply the desired Paragraph Style A
Find is not really needed for this.
I would to know where I can find "Choose Paragraph Style:Select All in Style" in the menus? I can see there is a "Paragraph Style" in the Format menu but it does not have a "Select All in Style" option.
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: deleting paragraph style B and replacing it with paragraph style A

Post by phspaelti »

vwnisus wrote: 2019-10-26 00:04:17 I would to know where I can find "Choose Paragraph Style:Select All in Style" in the menus? I can see there is a "Paragraph Style" in the Format menu but it does not have a "Select All in Style" option.
Really? Mine does.
Select_All_In_Style_1.jpg
Select_All_In_Style_1.jpg (74.39 KiB) Viewed 17015 times
Also you should be able to find it in the Paragraph Style menu of the Paragraph Style icon in the bottom right corner:
Select_All_In_Style_2.png
Select_All_In_Style_2.png (27.18 KiB) Viewed 17015 times
Select_All_In_Style_3.png
Select_All_In_Style_3.png (136.49 KiB) Viewed 17015 times
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: deleting paragraph style B and replacing it with paragraph style A

Post by phspaelti »

Hello shmuel,
shmuel wrote: 2019-10-25 23:54:04 One thing that was bothering me a bit was that although after all occurrences of text in paragraph style B have been replaced this way by paragraph style A, when I then went on to delete paragraph style B from the style sheet, I was told that "This style is currently used in the document" – but I was not able to find it. I deleted it anyway, and so far I have not had any problems.
One reason you may see such a message is that the style may be used in the definition of other styles, either as the "based on" style, or as the "following style". If the deleted style did not add any crucial attributes, you might not even notice the deletion.
Alternately the style may have been adding attributes that are being overridden, so you might not notice that either.
Tracking down where a style is used in that way is not always easy, especially if it is part of an imported document with the styles created by the importing process.
philip
shmuel
Posts: 13
Joined: 2019-10-18 06:55:45

Re: deleting paragraph style B and replacing it with paragraph style A

Post by shmuel »

Thank you, philip!
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: deleting paragraph style B and replacing it with paragraph style A

Post by xiamenese »

Two other points might interest you, @shmuel:

1) You can access "All in Style" from the paragraph Icon in the status bar at the bottom …
Screenshot 2019-10-26 17.04.23.png
Screenshot 2019-10-26 17.04.23.png (288.52 KiB) Viewed 16982 times
2) A while back, I think it was Martin who posted a macro to remove unused styles. I can't find it quickly in the repository, so here it is if you want to try it out.
Remove Unused Styles.nwm
(7.41 KiB) Downloaded 559 times
Hope that helps.

Mark
vwnisus
Posts: 58
Joined: 2016-04-24 00:13:31

Re: deleting paragraph style B and replacing it with paragraph style A

Post by vwnisus »

vwnisus wrote: 2019-10-26 00:04:17 I would to know where I can find "Choose Paragraph Style:Select All in Style" in the menus? I can see there is a "Paragraph Style" in the Format menu but it does not have a "Select All in Style" option.

Really? Mine does.
Also you should be able to find it in the Paragraph Style menu of the Paragraph Style icon in the bottom right corner:
Sorry. You are right. For some reason, initially, I could not see it.
shmuel
Posts: 13
Joined: 2019-10-18 06:55:45

Re: deleting paragraph style B and replacing it with paragraph style A

Post by shmuel »

Thank you, Mark!
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: deleting paragraph style B and replacing it with paragraph style A

Post by xiamenese »

My pleasure!

:)

Mark
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: deleting paragraph style B and replacing it with paragraph style A

Post by martin »

Great advice and suggestions all around, thanks everyone! It's wonderful having such helpful and good natured users :)

Although the original question seems thoroughly answered now, I still want to point out this FAQ topic on searching for formatted text. It covers some of the techniques discussed already, but also introduces some other ways to select text by formatting.
Post Reply