EditingOptions: {
    contentPlaceholder: string;
    environmentPopoverPolicy: "auto" | "on" | "off";
    isImplicitFunction: ((name: string) => boolean);
    mathModeSpace: string;
    mathVirtualKeyboardPolicy: "auto" | "manual" | "sandboxed";
    placeholderSymbol: string;
    popoverPolicy: "auto" | "off";
    readOnly: boolean;
    removeExtraneousParentheses: boolean;
    scriptDepth: number | [number, number];
    smartFence: boolean;
    smartMode: boolean;
    smartSuperscript: boolean;
}

Type declaration

  • contentPlaceholder: string

    A LaTeX string displayed inside the mathfield when there is no content.

  • environmentPopoverPolicy: "auto" | "on" | "off"

    If "auto" a popover with commands to edit an environment (matrix) is displayed when the virtual keyboard is displayed.

    Default: "auto"

  • isImplicitFunction: ((name: string) => boolean)

    Return true if the latex command is a function that could take implicit arguments. By default, this includes trigonometric function, so \sin x is interpreted as \sin(x).

    This affects editing, for example how the / key is interpreted after such as symbol.

      • (name): boolean
      • Parameters

        • name: string

        Returns boolean

  • mathModeSpace: string

    The LaTeX string to insert when the spacebar is pressed (on the physical or virtual keyboard).

    Use "\;" for a thick space, "\:" for a medium space, "\," for a thin space.

    Do not use " " (a regular space), as whitespace is skipped by LaTeX so this will do nothing.

    Default: "" (empty string)

  • mathVirtualKeyboardPolicy: "auto" | "manual" | "sandboxed"
  • placeholderSymbol: string

    The symbol used to represent a placeholder in an expression.

    Default: U+25A2 WHITE SQUARE WITH ROUNDED CORNERS

  • popoverPolicy: "auto" | "off"

    If "auto" a popover with suggestions may be displayed when a LaTeX command is input.

    Default: "auto"

  • readOnly: boolean

    When true, the user cannot edit the mathfield. The mathfield can still be modified programatically.

    Default: false

  • removeExtraneousParentheses: boolean

    If true, extra parentheses around a numerator or denominator are removed automatically.

    Default: true

  • scriptDepth: number | [number, number]

    This option controls how many levels of subscript/superscript can be entered. For example, if scriptDepth is "1", there can be one level of superscript or subscript. Attempting to enter a superscript while inside a superscript will be rejected. Setting a value of 0 will prevent entry of any superscript or subscript (but not limits for sum, integrals, etc...)

    This can make it easier to enter equations that fit what's expected for the domain where the mathfield is used.

    To control the depth of superscript and subscript independently, provide an array: the first element indicate the maximum depth for subscript and the second element the depth of superscript. Thus, a value of [0, 1] would suppress the entry of subscripts, and allow one level of superscripts.

  • smartFence: boolean

    When true and an open fence is entered via typedText() it will generate a contextually appropriate markup, for example using \left...\right if applicable.

    When false, the literal value of the character will be inserted instead.

  • smartMode: boolean

    When true, during text input the field will switch automatically between 'math' and 'text' mode depending on what is typed and the context of the formula. If necessary, what was previously typed will be 'fixed' to account for the new info.

    For example, when typing "if x >0":

    Type Interpretation
    i math mode, imaginary unit
    if text mode, english word "if"
    if x all in text mode, maybe the next word is xylophone?
    if x > "if" stays in text mode, but now "x >" is in math mode
    if x > 0 "if" in text mode, "x > 0" in math mode

    Default: false

    Manually switching mode (by typing alt/option+=) will temporarily turn off smart mode.

    Examples

    • slope = rise/run
    • If x > 0, then f(x) = sin(x)
    • x^2 + sin (x) when x > 0
    • When x<0, x^{2n+1}<0
    • Graph x^2 -x+3 =0 for 0<=x<=5
    • Divide by x-3 and then add x^2-1 to both sides
    • Given g(x) = 4x – 3, when does g(x)=0?
    • Let D be the set {(x,y)|0<=x<=1 and 0<=y<=x}
    • \int\_{the unit square} f(x,y) dx dy
    • For all n in NN
  • smartSuperscript: boolean

    When true and a digit is entered in an empty superscript, the cursor leaps automatically out of the superscript. This makes entry of common polynomials easier and faster. If entering other characters (for example "n+1") the navigation out of the superscript must be done manually (by using the cursor keys or the spacebar to leap to the next insertion point).

    When false, the navigation out of the superscript must always be done manually.