StyleHints

StyleHints

is an option for cells and notebooks that specifies an association containing hints used to control stylesheet behaviors.

Details

  • StyleHints provides a mechanism to allow a stylesheet to refer to parameters that can be set by a user to override the default stylesheet choices, while maintaining the overall integrity of the collection of styles. A hint might refer to a font family name, a color or any other style parameter. Setting the hints together allows the stylesheet to be tweaked to represent a theme with a different look while maintaining the overall integrity and choices set in the stylesheet.
  • Hints used by built-in Wolfram stylesheets include:
  • "CodeFont"the default FontFamily for input, output, code and other codelike styles
    "GroupOpener"the default ShowGroupOpener value for section and sectionlike styles
    "OperatorRenderings"the default list of AutoOperatorRenderings used by input and similar styles
  • StyleHints<|key1val1,|> effectively merges the keyi with any keys inherited from a more general scope. The fully merged set of keys and values can be read using AbsoluteCurrentValue.

Examples

open allclose all

Basic Examples  (2)

Use a style hint on a cell to override the code font setting:

Query the resolved value of a style hint:

Scope  (2)

Set a style hint on a notebook:

Create a style definition cell that uses a style hint:

new style

Possible Issues  (1)

CurrentValue might not return all style hints in effect if some are inherited:

To fully resolve all inherited style hints, use AbsoluteCurrentValue:

Wolfram Research (2021), StyleHints, Wolfram Language function, https://reference.wolfram.com/language/ref/StyleHints.html.

Text

Wolfram Research (2021), StyleHints, Wolfram Language function, https://reference.wolfram.com/language/ref/StyleHints.html.

CMS

Wolfram Language. 2021. "StyleHints." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StyleHints.html.

APA

Wolfram Language. (2021). StyleHints. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StyleHints.html

BibTeX

@misc{reference.wolfram_2024_stylehints, author="Wolfram Research", title="{StyleHints}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/StyleHints.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_stylehints, organization={Wolfram Research}, title={StyleHints}, year={2021}, url={https://reference.wolfram.com/language/ref/StyleHints.html}, note=[Accessed: 21-November-2024 ]}