Manage styles list?

Everything related to our flagship word processor.
Post Reply
derekroff
Posts: 7
Joined: 2006-12-12 09:39:15

Manage styles list?

Post by derekroff » 2016-02-19 16:47:25

My styles list has about 15 styles created by Nisus. Four character styles, and 11 paragraph styles, by my count. These include emphatic, strong, note reference, headings 1-6, and several others. While I have used a couple of these on occasion, they are rarely useful to me. I've created a few styles of my own, and I do use "Normal" from Nisus. Is there a way to hide all the others? Or delete them from a current document? Or prevent them from appearing in every new document? I don't want to get rid of them absolutely and forever, but I want to get them out of my way. Is there a way to reorder the order in which they appear, in my styles list in the tool drawer? If I could get all the Nisus ones to be at the bottom, that would be less bothersome. They appear to be in alphabetical order. The meaningful names that I choose often come with letters after 'H', and therefore don't show in the list, unless I scroll down. I'd also like to group my created styles in a meaningful way, which isn't always alphabetical order.
Derek Roff
Language Learning Center
University of New Mexico
derek@unm.edu

jb
Posts: 89
Joined: 2007-11-09 15:27:25

Re: Manage styles list?

Post by jb » 2016-02-19 17:24:02

You might want to have a look at the User Guide (under menu item 'Help'), especially what it says about Styles.
But two things will help right away.
1. To remove a style from a document, go to View > Style Sheet. On the left you'll see all the styles in your document. Highlight any style you want to remove and click on the minus button at the bottom.
2. Sounds like you want a new Template. When you create a New file, Nisus opens a copy of your New File Template. So, make a document with the styles you want and save it as a Template. Go to Preferences> New File and click on Advanced. There you'll see what template you're using.

Ask again if you have more trouble.

derekroff
Posts: 7
Joined: 2006-12-12 09:39:15

Re: Manage styles list?

Post by derekroff » 2016-02-19 17:41:32

Thanks for your response, JB. Your answers give me some options. I did search Help, the FAQ, the forum, and the User Guide and its index for various terms. The term "delete style" is absent from all locations. So is "manage styles", "reorder styles", "hide styles", and several other searches that I tried. I skimmed many of the hundreds of instances of "styles" that a search of the User Guide has, and the Styles section, without finding what I was looking for (and finding much that I wasn't looking for).
Derek Roff
Language Learning Center
University of New Mexico
derek@unm.edu

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

Re: Manage styles list?

Post by martin » 2016-02-19 17:46:17

jb has given some excellent suggestions and covered the bases. Here are a few less important tips:
derekroff wrote:Is there a way to reorder the order in which they appear, in my styles list in the tool drawer? If I could get all the Nisus ones to be at the bottom, that would be less bothersome. They appear to be in alphabetical order. The meaningful names that I choose often come with letters after 'H', and therefore don't show in the list, unless I scroll down.
There's no way to reorder the list of styles, but the palette can be expanded to show more styles. You can click and drag the horizontal "grabber" mark along the bottom edge of the palette to resize it. If you have a big list of styles and use them often, you might find it convenient to float the Styles palette so it no longer resides in the palette drawer for each document, but instead is always visible on screen.

User avatar
phspaelti
Posts: 912
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Manage styles list?

Post by phspaelti » 2016-02-19 23:15:32

I am attaching here a macro that will delete all unused styles in your document.
It presents a list of the unused styles and lets you exempt any you want to keep from deletion.
Attachments
Delete Unused Styles.nwm
(5.82 KiB) Downloaded 46 times
philip

xiamenese
Posts: 422
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Manage styles list?

Post by xiamenese » 2016-02-20 03:31:02

I remove unwanted styles by going to Stylesheet view, highlighting the ones I want to remove—.doc(x) files imported from Word are littered with huge numbers of unused and weird styles—and tapping the <delete> key.

I have also come round to the position, that for my own work, rather than making lots of templates apart from ones that have boilerplate text, I should have a minimal Nisus New File, and a set of stylesheets for the various document types I need to produce. I then open either a New Nisus file, or, since I use Scrivener for most of my writing, open the exported RTF file, and then from Stylesheet view import the stylesheet I wish to use from the Styles Library, telling it to replace the one or two existing styles—Normal, for instance—with the similarly named style in the the stylesheet.

Now, if I could write a macro to run when I first open a file new to NWP, which would ask me to select the stylesheet in the library I wish to import, then import it with the "Replace Existing" option …

:)

Mark

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

Re: Manage styles list?

Post by martin » 2016-02-22 17:28:00

xiamenese wrote:Now, if I could write a macro to run when I first open a file new to NWP, which would ask me to select the stylesheet in the library I wish to import, then import it with the "Replace Existing" option …
This is already possible using the menu Insert > New Style > Import From Style Library. You'll be shown a list of your style collections from the style library. You can checkmark one or more style collections (and/or just constituent styles) and then import them into your document. If there are any conflicts, Nisus Writer will give you options on how to proceed.

I should say this command and import dialog is also available in a variety of other places, including the Style palette's plus icon button and the Style Sheet's import button.

Of course, if you really want a macro to do it, we could reproduce the functionality. See the attached macro :)
Attachments
Style Import From Library.nwm
(4.37 KiB) Downloaded 36 times

User avatar
phspaelti
Posts: 912
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Manage styles list?

Post by phspaelti » 2016-02-22 22:38:09

martin wrote:Of course, if you really want a macro to do it, we could reproduce the functionality. See the attached macro :)
Martin, thanks for the macro. I tried to write a macro like that myself, but I got stuck at the following step:

Code: Select all

$activeDoc.addStyles($styleDoc.allStyles, "replace")
According to the documentation the .addStyles command calls for a text argument, but apparently you are allowed to use a style (in fact an array of styles) as the argument as well. I was wondering how to work around this. Didn't occur to me to just try it. :o Might be nice to indicate this in the Macro Language Reference :wink:
philip

xiamenese
Posts: 422
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Manage styles list?

Post by xiamenese » 2016-02-23 01:55:46

Thank you very much, Martin, and for your personal communication. I would hope that many others will find this macro useful. From this or other discussion, I learned about the "Import from Style Library…" option—familiarity breeds contempt … I'm so used to using NWP that most of what I need to do has a shortcut applied to it, so I virtually never look at the menus!—but I wanted to have a macro to do it, that I could use together with other macros to achieve my ends.

If Philip hadn't succeeded in getting a macro for this to work, what hope did I have!? I was floundering totally. :)

Mark

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

Re: Manage styles list?

Post by martin » 2016-02-23 14:49:52

phspaelti wrote:According to the documentation the .addStyles command calls for a text argument, but apparently you are allowed to use a style (in fact an array of styles) as the argument as well.
Oops! That feature should be mentioned in the macro references, and its omission is an error. We'll get it corrected, thanks Philip.
xiamenese wrote:If Philip hadn't succeeded in getting a macro for this to work, what hope did I have!? I was floundering totally. :)
That's good point, haha. If Philip's impressive macro skills can't solve the problem, dire times indeed :P

Post Reply