Skip to main content

Style

Wolfram Kernel
Execution environment

Styling box used as a decoration for an arbitrary Wolfram Expressions

Style[expr_, opts__]
info

Expressions are editable

The argument opts contains directives for the formatted output.

Options

  • Background
  • FontFamily
  • FontSize

Directives

  • _Integer font size
  • _RGBColor font color
  • Bold
  • Italic

Example

Style[1, Background->Yellow]

For pure string options are much richer

Style["ddd", Background->LightBlue, FontFamily->"Monospace", Bold, Red, Italic,  20]

Hamlet's soliloquy, with repeated words successively has more contrast background

With[{data = ExampleData[{"Text", "ToBeOrNotToBe"}, "Words"]}, 
Take[MapIndexed[Style[#, 4 Count[Take[data, First[#2]], #]] &, data], 100]
]

Or for a regular expressions

Style[(*FB[*)((1)(*,*)/(*,*)((*SqB[*)Sqrt[2](*]SqB*)))(*]FB*), 18, Red]

Supported output forms