Build a renderer. Async once, per process — init() reads MathJax's
components off disk, and calling it a second time with the same config
returns the same instance rather than doing the work twice.
Nothing here throws for a document reason. It can still reject if MathJax itself cannot be loaded at all, which is a deployment problem and not something a diagnostic can usefully describe.
Mathematics.
createMathRendereris what a caller builds and hands tocompile()throughCompileOptions.math; it is exported from the package root because a caller cannot obtain one any other way, and the engine — which acquires nothing for itself — will not build one for them.The static import graph reaching this line is small:
math/bridge.tsnamesmathjaxonly in animport typeand anawait import(), so requiring@ebook-reader/typesetstill costs a caller who sets no mathematics nothing.