Skip to content

TemmlRenderer

Namespace: Temml

public static class TemmlRenderer

Converts TeX math to MathML. Maps to temml.js, the main entry point of Temml.

Inheritance: object

View source

public const string Version = "0.14.0"

The version of Temml that this library ports.

Value: string

View source

public static void DefineMacro(string name, TemmlMacro macro)

Adds or replaces a builtin macro, for every later call in the process. Maps to __defineMacro.

Parameters

Name Type Description
name string The command, such as “\RR”.
macro TemmlMacro The definition; a string converts implicitly.

View source

public static TemmlMacroDictionary DefinePreamble(string expression, TemmlOptions? options = null)

Parses a preamble and returns its macros, to be passed to later calls as TemmlOptions.Macros. Maps to definePreamble.

Parameters

Name Type Description
expression string The TeX source of the preamble.
options TemmlOptions The options, or null for the defaults. Its macros are not used.

Returns: TemmlMacroDictionary

Exceptions

Type Condition
ParseError The source is invalid.

View source

DefineSymbol(TemmlMode, string, string?, string, bool)

Section titled “DefineSymbol(TemmlMode, string, string?, string, bool)”
public static void DefineSymbol(TemmlMode mode, string group, string? replace, string name, bool acceptUnicodeChar = false)

Adds or replaces a symbol, for every later call in the process. Maps to __defineSymbol.

Parameters

Name Type Description
mode TemmlMode The mode in which the symbol exists.
group string The parse node group, such as “mathord” or “rel”.
replace string The character the symbol stands for, or null.
name string The command or character that makes the symbol.
acceptUnicodeChar bool Also accept the replacement character as input.

View source

public static MathDomNode RenderToMathMLTree(string expression, TemmlOptions? options = null)

Parses and builds an expression, and returns the build tree. Maps to __renderToMathMLTree.

Parameters

Name Type Description
expression string The TeX source.
options TemmlOptions The options, or null for the defaults.

Returns: MathDomNode

Exceptions

Type Condition
ParseError The source is invalid and ThrowOnError is set.

View source

public static string RenderToString(string expression, TemmlOptions? options = null)

Parses and builds an expression, and returns the markup. Maps to renderToString.

Parameters

Name Type Description
expression string The TeX source.
options TemmlOptions The options, or null for the defaults.

Returns: string

Exceptions

Type Condition
ParseError The source is invalid and ThrowOnError is set.

View source

MIT · Copyright 2020 Ron Kok · unofficial community port of Temml