Wolfram Research

Function Repository Resource:

SetContextStyle

Source Notebook

Set the auto-style options for a given context

Contributed by: Richard Hennigan (Wolfram Research)

ResourceFunction["SetContextStyle"][style]

sets the auto-style options for the current notebook and current context to style.

ResourceFunction["SetContextStyle"][context,style]

sets the auto-style options for the current notebook and context to style.

ResourceFunction["SetContextStyle"][nb,context,style]

sets the auto-style options for context to style in the notebook nb.

Examples

Basic Examples

Use the function:

In[1]:=
ResourceFunction["SetContextStyle"][Orange]
Out[1]=

Scope

Retrieve the ResourceFunction:

In[2]:=
ResourceFunction["SetContextStyle"]
Out[2]=

Retrieve the ResourceObject:

In[3]:=
ResourceObject["SetContextStyle"]
Out[3]=

Use Automatic to clear previously defined styles:

In[4]:=
ResourceFunction["SetContextStyle"][Automatic]
Out[4]=

Set the style for a particular context:

Set the style in a particular notebook:

In[5]:=
nb = NotebookPut[
   Notebook[{Cell[BoxData["MyContext`test"], "Input"]}, WindowSize -> {400, 200}]];
ResourceFunction["SetContextStyle"][nb, "MyContext`", {Blue, FontSize -> 24}];
Rasterize[nb]
Out[5]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information