Options
All
  • Public
  • Public/Protected
  • All
Menu

Module LaTeX

Support for LaTex formatting of our expressions and data.

Index

Type aliases

RGB6Color

RGB6Color: string

We take our colors in 6 RGB hex digits, e.g. RRGGBB, {RR, GG, BB} ∈ 00..FF.

StyleKey

StyleKey: StyleKeyStyler | StyleKeyData

The valid style keys to be used with setStyle.

StyleMap

StyleMap: { applyUnit: Styler<string | number, [IUnitBase]>; applyUnitFunction: Styler<string | number, [IUnitBase]>; call: Styler<IPFunction, [Variable[]]>; exponentStyle: Style | "self" | "exponent"; function: Styler<IPFunction>; number: Styler<number>; numberFormat: NumberFormat; numberPrecision: number; numberSpecials: Map<number, string>; numberTrimTrailingZero: boolean; unit: Styler<IUnitBase>; unitFraction: Styler<string, [string]>; unitProduct: Styler<string[]>; unitSymbol: Styler<IUnitBase>; variable: Styler<Variable> }

A type map of StyleKey to Styler (plus the supporting data items).

Type declaration

Styler

Styler<I, R>: (continuation: StylerFn<I>, thisStyle: Style) => StylerFn<I, R>

A styler takes a LaTeX fragment and transforms it in some way.

A Styler is required to be synchronous; no use of await or promises is allowed.

Type parameters

  • I = string | number

  • R: any[] = any[]

Type declaration

    • (continuation: StylerFn<I>, thisStyle: Style): StylerFn<I, R>
    • Parameters

      • continuation: StylerFn<I>
      • thisStyle: Style

      Returns StylerFn<I, R>

Variables

Const DEFAULTS

DEFAULTS: StyleMap = ...

The stylers. These handle adding style formatting to the syntactic expressions components.

Let DEFAULT_STYLE

DEFAULT_STYLE: Style = ...

The Style that items are formatted with by default. May be changed; the initial value is in INITIAL_STYLE.

internal

Const INITIAL_STYLE

INITIAL_STYLE: Style = ...

The initial DEFAULT_STYLE.

Const LATEX_STYLE_KEYS

LATEX_STYLE_KEYS: StyleKey[] = ...

List of the valid style keys for setStyle.

Let SPECIAL_NUMBERS

SPECIAL_NUMBERS: Map<number, string> = ...

Functions

Const chain

  • chain<I>(...stylers: Styler<I, any[]>[]): Styler<I, any[]>

Const colorStyler

  • colorStyler(color: string): Styler<any, any[]>

fractions

  • fractions(max?: number, maxDenom?: number): Generator<number[], void, unknown>
  • Parameters

    • max: number = 10
    • maxDenom: number = 10

    Returns Generator<number[], void, unknown>

Const setStyle

Const specialNumber

  • specialNumber(continuation: StylerFn<number, any[]>, thisStyle: Style): StylerFn<number, any[]>
  • Parameters

    • continuation: StylerFn<number, any[]>
    • thisStyle: Style

    Returns StylerFn<number, any[]>

Generated using TypeDoc