Skip to content

TemmlDom

Namespace: Temml.Dom

public static class TemmlDom

The parts of Temml that work on a document, on AngleSharp. Maps to render in temml.js, to src/auto-render.js and to src/postProcess.js.

Inheritance: object

View source

public static void PostProcess(IElement block)

Numbers the AMS equations of the document and fills each \ref and \eqref under the element. Call it once, after every expression has been rendered. Maps to postProcess.

Parameters

Name Type Description
block IElement The element whose references are filled. Labels come from its whole document.

Exceptions

Type Condition
InvalidOperationException A reference has no matching label.

View source

public static void Render(string expression, IElement baseNode, TemmlOptions? options = null)

Parses and builds an expression, and replaces the content of an element with the result. A math element is populated instead of getting a nested one, and its math gets no soft line breaks. Maps to render.

Parameters

Name Type Description
expression string The TeX source.
baseNode IElement The element to fill. Its document must not be in quirks mode.
options TemmlOptions The options, or null for the defaults. The object is not changed.

Exceptions

Type Condition
ParseError The source is invalid and ThrowOnError is set, or the document is in quirks mode.

View source

RenderMathInElement(IElement, TemmlAutoRenderOptions?)

Section titled “RenderMathInElement(IElement, TemmlAutoRenderOptions?)”
public static void RenderMathInElement(IElement block, TemmlAutoRenderOptions? options = null)

Finds the math delimiters in the text under an element, renders each expression in place, and then runs PostProcess(IElement) on the element. Maps to renderMathInElement.

Parameters

Name Type Description
block IElement The element to search.
options TemmlAutoRenderOptions The options, or null for the defaults.

Exceptions

Type Condition
InvalidOperationException A reference has no matching label.

View source

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