# How do I make two styles in a stylesheet inherit the same style

Specifically I want different versions of 'Item1Numbered'. For example one with a frame and another with a background colour. How is that done?

-

You need to add StyleDefinitions -> StyleData["ParentStyle"] as an option to the StyleData of your new style (in the stylesheet), where "ParentStyle" is whatever you want to inherit from.

In your case, go to Format > Edit Stylesheet and add the following styles:

Cell[
StyleData["MyItemStyle1", StyleDefinitions -> StyleData["ItemNumbered"]],
CellFrame -> True
]

Cell[
StyleData["MyItemStyle2", StyleDefinitions -> StyleData["ItemNumbered"]],
Background -> GrayLevel[0.8]
]


-
Is there a way to make the frame cover the number and make the colour cover all of the inside of the frame and not just the number and the text? –  Sofic Aug 7 '13 at 20:26
@Sofic Not directly, but it is possible with some fiddling with the CellDingbat. The default definition for number is CellDingbat->Cell[ TextData[{ CounterBox["ItemNumbered"], "."}], FontWeight -> "Bold"], which is inherited from ItemNumbered. Now if you add CellFrame -> True also to the Cell used in CellDingbat, you will get a frame around the number. However, the two frames now overlap. To resolve this, you'll have to manually fiddle with the CellMargins (the left margin for the main cell and the right margin for the dingbat cell) to get a good appearance. –  rm -rf Aug 7 '13 at 20:40
Thank you very much. –  Sofic Aug 7 '13 at 21:04