Migrating from upstream
This package ports Temml 0.14.0. The behavior follows upstream; the names follow .NET conventions.
Entry points
Section titled “Entry points”| JavaScript | C# |
|---|---|
temml.renderToString(tex, options) |
TemmlRenderer.RenderToString(tex, options) |
temml.render(tex, element, options) |
TemmlDom.Render(tex, element, options) |
temml.renderMathInElement(element, options) |
TemmlDom.RenderMathInElement(element, options) |
temml.postProcess(element) |
TemmlDom.PostProcess(element) |
temml.definePreamble(tex, options) |
TemmlRenderer.DefinePreamble(tex, options) |
temml.__renderToMathMLTree(tex, options) |
TemmlRenderer.RenderToMathMLTree(tex, options) |
temml.__defineMacro(name, body) |
TemmlRenderer.DefineMacro(name, macro) |
temml.__defineSymbol(mode, group, replace, name, acceptUnicodeChar) |
TemmlRenderer.DefineSymbol(mode, group, replace, name, acceptUnicodeChar) |
temml.__parse(tex, options) |
not public |
temml.version |
TemmlRenderer.Version |
temml.ParseError |
ParseError |
TemmlRenderer, TemmlOptions, and ParseError are in the Temml package and namespace. TemmlDom is in the Temml.AngleSharp package, namespace Temml.Dom, and works on AngleSharp elements.
Options
Section titled “Options”| JavaScript | C# |
|---|---|
displayMode |
DisplayMode |
annotate |
Annotate |
leqno |
Leqno |
throwOnError |
ThrowOnError |
errorColor |
ErrorColor |
macros |
Macros, a TemmlMacroDictionary |
wrap: "none", "tex", "=" |
Wrap = TemmlWrap.None, TemmlWrap.Tex, TemmlWrap.Equals |
xml |
Xml |
colorIsTextColor |
ColorIsTextColor |
strict |
Strict |
trust: true |
Trust = true |
trust: (context) => ... |
TrustHandler = context => ... |
maxSize: [em, pt] |
MaxSize = (em, pt) |
maxExpand |
MaxExpand, an int |
Auto-render options (delimiters, fences, ignoredTags, ignoredClasses, errorCallback, preProcess) are properties of TemmlAutoRenderOptions, in PascalCase. See DOM and auto-render.
Differences
Section titled “Differences”- There is nothing to include for
mhchem,physics, andtexvc. They are always available, as in upstream’stemml.cjs. copy-texis a browser clipboard script and is not ported. You can still serve upstream’s file; it needsAnnotate.- The stylesheets and
Temml.woff2are embedded in the package. See Styles and fonts. MaxExpandis anint. Where upstream code passesInfinity, passint.MaxValue.
Server-side rendering that was in Node.js
Section titled “Server-side rendering that was in Node.js”If a build step or a server called Temml through Node.js only to turn TeX into MathML, RenderToString replaces that call.
MIT · Copyright 2020 Ron Kok · unofficial community port of Temml