1
$\begingroup$

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.

$\endgroup$
2
$\begingroup$

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]
    }]
 ]
$\endgroup$
2
  • $\begingroup$ Got it. Where in the documentation should I have found this information? (I find the StyleData docs to be useless.) $\endgroup$
    – Alan
    Aug 27 '15 at 11:08
  • $\begingroup$ 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 $\endgroup$ Aug 27 '15 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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