6
$\begingroup$

I want to create a notebook where the background is one color, the input cells are another color, and the output cells are white. I have tried messing around with Option Inspector and creating a custom style sheet, but it all cases I cannot get the background and the input cells to have a different color. Any thoughts?

$\endgroup$
6
  • 1
    $\begingroup$ You do not do this via the options inspector. Immediately above options inspector is Edit Stylesheet. That is what you need. If you search on this site there is ample information that covers this -- this is almost certainly a duplicate. For example for "Input" add Background->RGBColor[1,1,0],; for "Notebook" add Background->RGBColor[1,1,0]; for "Output" add Background->GrayLevel[1] $\endgroup$ Nov 15, 2015 at 11:12
  • 1
    $\begingroup$ Thanks Mike, but when I do this there is no "Notebook" style to choose from. I can choose "All" but that messes with the "Input" background too. $\endgroup$
    – PatrickS
    Nov 15, 2015 at 11:49
  • $\begingroup$ In order assure that @MikeHoneychurch sees your comment meant for him, you need to address it as I just did. You, PatrickS, automatically receive all comments to your question, but he does not. $\endgroup$
    – bbgodfrey
    Nov 15, 2015 at 12:08
  • $\begingroup$ Okay, thanks @bbgodfrey $\endgroup$
    – PatrickS
    Nov 15, 2015 at 12:19
  • $\begingroup$ @bbgodfrey - Does that comment trick work for all names or only names that don't have spaces. I frequently find that my "@xxx" disappears after entering a comment and don't understand the mechanism. $\endgroup$ Nov 16, 2015 at 0:42

1 Answer 1

5
$\begingroup$

You can do this by editing the private stylesheet (see other SE questions about this):

enter image description here

which gives:

enter image description here

or evaluate this, which can be inferred from other questions on this site about style sheeting:

SetOptions[EvaluationNotebook[],
 StyleDefinitions -> 
  Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData["Notebook"], Background -> GrayLevel[0.5]], 
    Cell[StyleData["Input"], Background -> RGBColor[0.87, 0.94, 1]], 
    Cell[StyleData["Output"], Background -> GrayLevel[1]]}, 
   StyleDefinitions -> "PrivateStylesheetFormatting.nb"]
 ]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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