Fork me on GitHub

Context

Context

new Context()private

This class contains the rendering context of the current parse level.

It also holds information about the parent context to handle scaling adjustments.

When a new scope is entered, a clone of the context is created with .clone() so that any further changes remain local to the scope.

A scope is defined for example by:

  • an explicit group enclosed in braces {...}
  • a semi-simple group enclosed in \bgroup...\endgroup
  • an environment delimited by \begin{<envname>}...\end{<envname>}
Properties
mathstyle : string

'text' (aka 'inline'), 'display', 'script' or 'scriptscript'

opacity : number
size : number
generateID : boolean | object

If true, unique IDs should be generated for each span so they can be mapped back to an atom. Can also be an object with a seed field to generate a specific range of IDs. Optionally, if a groupNumbers property is set to true, an additional span will enclose strings of digits. This is used by read aloud to properly pronounce (and highlight) numbers in expressions.

parentMathstyle : string
parentSize : number
macros : object

A macros dictionary

Methods

clone(): Contextprivate

Returns a new context with the same properties as 'this'.

: Context   

setMathstyle(value: string)private

Change the mathstyle of this context

value : string

'auto' to indicate that the mathstyle should in fact not be changed. This is used when specifying the mathstyle for some environments.