Specifically I want different versions of 'Item1Numbered'. For example one with a frame and another with a background colour. How is that done?
1 Answer
$\begingroup$
$\endgroup$
2
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]
]
-
$\begingroup$ 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? $\endgroup$– SoficCommented Aug 7, 2013 at 20:26
-
$\begingroup$ @Sofic Not directly, but it is possible with some fiddling with the
CellDingbat
. The default definition for number isCellDingbat->Cell[ TextData[{ CounterBox["ItemNumbered"], "."}], FontWeight -> "Bold"]
, which is inherited fromItemNumbered
. Now if you addCellFrame -> True
also to theCell
used inCellDingbat
, you will get a frame around the number. However, the two frames now overlap. To resolve this, you'll have to manually fiddle with theCellMargins
(the left margin for the main cell and the right margin for the dingbat cell) to get a good appearance. $\endgroup$– rm -rf ♦Commented Aug 7, 2013 at 20:40