TemmlRenderer
Namespace: Temml
public static class TemmlRendererConverts TeX math to MathML. Maps to temml.js, the main entry point of Temml.
Inheritance: object
Fields
Section titled “Fields”Version
Section titled “Version”public const string Version = "0.14.0"The version of Temml that this library ports.
Value: string
Methods
Section titled “Methods”DefineMacro(string, TemmlMacro)
Section titled “DefineMacro(string, TemmlMacro)”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. |
DefinePreamble(string, TemmlOptions?)
Section titled “DefinePreamble(string, TemmlOptions?)”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. |
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. |
RenderToMathMLTree(string, TemmlOptions?)
Section titled “RenderToMathMLTree(string, TemmlOptions?)”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. |
RenderToString(string, TemmlOptions?)
Section titled “RenderToString(string, TemmlOptions?)”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. |
MIT · Copyright 2020 Ron Kok · unofficial community port of Temml