Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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]
]

enter image description here

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.