# How can I remove a style from the list of available styles?

I have a stylesheet that has inherited some base definitions from another, but would like to "prune" the list of available styles, by removing or disabling1 some. Is there a way to do this?

1. This is not a question about how to delete I style I've defined from my stylesheet, but how to disable a style that my stylesheet has inherited.

-
I haven't counted but if there are probably over a hundred styles going up the inheritance hierarchy. Why do you want to disable a style? If you are not using that style then what does it matter? If you are using that style then do you really mean "disable" it or do you mean alter it? –  Mike Honeychurch Nov 12 '12 at 1:55
@MikeHoneychurch: For usability. It's a style that we don't use, and is not customized to fit with the other styles, so using it would be an error. It should be absent from list of available styles, to prevent that error. –  raxacoricofallapatorius Nov 12 '12 at 2:11
Sorry but I do not understand. If you do not use a style then so what. There is no need to remove it if it is not being used. Can you explain in your question why you think having a style that you do not use causes an error -- please give an example. I (and mostly likely all users) probably never use 100+ built in styles that inherit in my stylesheets. So what -- I do not need to disable them simply because I am not using them. –  Mike Honeychurch Nov 12 '12 at 2:34
Additionally I'm not sure you could "disable" a style -- you haven't defined what you mean by "disable" but I would think the only way to make a style not able to be used would probably be to delete it. Above all else you do NOT want to be editing or otherwise modifying the built in stylesheets that are bundled with Mma. In your comment you make it sound like you may want to edit the list displayed in Format > Style. Is that what you mean? If so you still need to define those "disabled" styles in your custom stylesheet. –  Mike Honeychurch Nov 12 '12 at 2:43
@MikeHoneychurch: For the same reason you'd disable or deprecate an API, the use of which you want to discourage; or that you'd use encapsulation. I have a team producing documents that should have particular formatting that has been specified in my stylesheet, but because that stylesheet has inherited from another (Default), it has styles in it that no one should use (and that have not been customized to follow standards). I just want to yank those from the list of styles they can apply. –  raxacoricofallapatorius Nov 12 '12 at 2:43

If you don't want a style to be available from the menu then edit your stylesheet and add all the styles that you want removed from the style listing.

For example if you don't want the Text style to appear then add this cell to your stylesheet:

Cell[StyleData["Text"],


Do this for all styles that you want to remove from the style listing.

Cell[StyleData["Style#1ThatIWantRemoved"],

Could I go the other way: StyleMenuListing->None for the whole stylesheet and then just StyleMenuListing->Automatic for the ones I redefine and want to use? –  raxacoricofallapatorius Nov 12 '12 at 3:01
No because styles are inherited upwards. So at the cell level they are still defined as Automatic even if at the notebook level you set it to None, so you need to set it as each cell level. –  Mike Honeychurch Nov 12 '12 at 3:07