# basic StyleDefinitions question: setting cell Backgroun when printing

I am having trouble getting good StyleData guidance from the Mma docs. Am I overlooking the good stuff? Anyway, suppose I run the following in a notebook:

SetOptions[EvaluationNotebook[],
StyleDefinitions -> Notebook[{
Cell[StyleData[StyleDefinitions -> "Default.nb"]],
Cell[StyleData[All, "Printout"], ShowCellLabel -> False],
Cell[StyleData["Input", "Printout"], CellFrame -> True],
Cell[StyleData["Output", "Printout"],
CellMargins -> {{100, 100}, {10, 10}}],
Cell[StyleData["Output", "Printout"],
CellDingbat -> "\[FilledCircle]"],
Cell[StyleData["Output", "Printout"], Background -> Yellow]
}]
]


Now to see the result I do this:

Export["c:\\temp\\temp.pdf", EvaluationNotebook[], "PDF"];


When I examine the document, I don't see the dingbats or the background color. Should I?

Btw, this is not a request for comment on the horrible style. I just want to understand why I'm not getting the expected result.

You have 3 separate definitions for "Output" so only the first one will be used therefore the 2nd and 3rd that contain the dingbat and background are ignored.

SetOptions[EvaluationNotebook[],
StyleDefinitions -> Notebook[{
Cell[StyleData[StyleDefinitions -> "Default.nb"]],
Cell[StyleData[All, "Printout"], ShowCellLabel -> False],
Cell[StyleData["Input", "Printout"], CellFrame -> True],
Cell[StyleData["Output", "Printout"],
CellMargins -> {{100, 100}, {10, 10}},
CellDingbat -> "\[FilledCircle]",
Background -> Yellow]
}]
]

• Got it. Where in the documentation should I have found this information? (I find the StyleData docs to be useless.)
– Alan
Aug 27 '15 at 11:08
• it is not explicit in the docs as far as I am aware but a general principle of Mma is that only the first occurrence of options is used and even though these are style definitions rather than options the same principle applies Aug 27 '15 at 20:34