Find and replace styles

Everything related to our flagship word processor.
Post Reply
Amaru
Posts: 4
Joined: 2010-09-11 14:55:02

Find and replace styles

Post by Amaru »

I would like to replace the headings with the format "1. Heading name" with the style "Heading 1" which I have created in Nisus Writer Pro. I figured out how to use the Find and Replace window, and Nisus finds the headings and apparently applies the style, but the text doesn't change in the document. Nevertheless, if apply the Heading 1 style directly, the font and other attributes change accordingly. What am I doing wrong?
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Find and replace styles

Post by Kino »

Amaru wrote:What am I doing wrong?
Perhaps the style attributes of the replace text may not be adequate but I’m not sure. Anyway, it is not a good idea to use the Find/Replace to replace a paragraph style globally because a much more easier way is available.

In the status bar at the bottom of the document window, you see [] menu.

1. Put the caret (insertion point) somewhere in a paragraph having “1. Heading name” style;

2. Choose Select All from [] menu and all paragraphs having “1. Heading name” style will be selected;

3. Choose “Heading 1” [] menu to apply “Heading 1” on all selections.
ParaStyle.png
ParaStyle.png (63.29 KiB) Viewed 6839 times
Amaru
Posts: 4
Joined: 2010-09-11 14:55:02

Re: Find and replace styles

Post by Amaru »

Kino, Thank you for your suggestion. It, indeed, works great when the original text has a predefined style already. The problem is that the file I'm opening does not have predefined styles. So, if I use the "select all" option, the whole document gets selected. That is why I am trying to using the names of the headings (which follow the same pattern) to give them the correct style.

I tried to do this because it's fairly easy, for instance, to find all the words in boldface and replace their attribute with a single underline. I imagined that there would be a way to find text and replace its style as well.
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Re: Find and replace styles

Post by Hamid »

When you place the cursor in a style which is not defined, then in the Statusbar you will see an icon of a ruler for all paragraphs which follow that ruler or, for undefined character style, you will see an underlined small letter a:
Ruler.png
Ruler.png (8.51 KiB) Viewed 6803 times
Font.png
Font.png (8.75 KiB) Viewed 6803 times
You can click on the ruler icon and select all paragraphs that follow the same undefined style and change them to a defined style.
Similarly, you can click on the small underlined a icon in the Statusbar to select all instances of a particular undefined character style and change them to a defined character style.
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Find and replace styles

Post by Kino »

Amaru wrote:I tried to do this because it's fairly easy, for instance, to find all the words in boldface and replace their attribute with a single underline. I imagined that there would be a way to find text and replace its style as well.
Then, if what Hamid suggested does not fits your needs, [1] use “Find All” in the Find panel to find/select all texts in a specific style, [2] activate the document window, for example, by clicking on its toolbar, and [3] use style menus in the menubar or in the status bar to apply a desired style on all selections.

If you prefer an attribute sensitive replace all, make sure to apply :Format:Any Attribute on find/replace strings in the Find panel before applying style attributes on them.
User avatar
martin
Official Nisus Person
Posts: 5230
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Find and replace styles

Post by martin »

Kino and Hamid offer good advice. I too don't like to use the attribute sensitive Replace option to reformat found text. I think it's much more natural to do a "Find All" and then use the menus/palettes to format it as normal. However:
Amaru wrote:I figured out how to use the Find and Replace window, and Nisus finds the headings and apparently applies the style, but the text doesn't change in the document. Nevertheless, if apply the Heading 1 style directly, the font and other attributes change accordingly. What am I doing wrong?
Likely the attributes applied to your document text override the style you are adding. For example, if some piece of found text has a manually applied (eg: non-style) font size attribute of 13 pts, adding a Heading style that define the font size to be 14 pts will not change the font size of the text, eg: the text will stay as 13 pts because manually applied attributes override styles, and the attribute sensitive replacement option does not clear away these attributes, though it can add them.

If you really want to clear away all non-style formatting for these paragraphs, I'd recommend:
1. Find All the desired text.
2. Apply the Heading 1 style.
3. Choose the menu Format > Remove Attributes Except Styles.
Amaru
Posts: 4
Joined: 2010-09-11 14:55:02

Re: Find and replace styles

Post by Amaru »

Apparently I haven't seen what a powerful word processor Nisus Writer Pro is. Your suggestions have helped me to solve my problem and learn in the process. Yes, the select all option, and the find all option, are really powerful and make reformatting text much easier. Thank you Kino, Hamid and Martin (I miss San Diego). By the way, this is a great community.
Post Reply