1
$\begingroup$

I'm looking for a command to insert at the start of my notebook that would change the text color for all text cells (style "Text") to have the color magenta. Maybe something that starts with

SetOptions[EvaluationNotebook[], ?]

but I couldn't figure out what the "?" should be. I didn't want to change the default stylesheet or create a custom stylesheet. I just want a notebook with a different text color for text comments, which I can to someone else, and it will still look the same.

$\endgroup$

1 Answer 1

1
$\begingroup$

You can edit style elements using StyleDefinitions:

SetOptions[SelectedNotebook[], 
 StyleDefinitions -> 
  Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
            Cell[StyleData["Text"], FontColor -> Red]}]]

This command comes from examining the current value of StyleDefinitions option for a new notebook:

Options[SelectedNotebook[], StyleDefinitions]

Accordingly, you can modify what is in there by adding your own elements, using the same format as in style sheets.

$\endgroup$
0

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.