Giter Site home page Giter Site logo

Comments (1)

dpvc avatar dpvc commented on August 14, 2024

I'm expecting to use mml3 for the output, and at the moment this code can only be used with the normal output/chtml and svg outputs

Yes, MathJax v3 and v4 only produce SVG or CHTML output, not MathML directly.

but the code for those outputs is not reproducible

I'm not sure what that means. Can you say more about what you re trying to suggest, here?

If you are looking to output MathML, there is an example of a replacement for the NativeMML output from v2. It is an example using the MathJax-components infrastructure, but you are using the direct-module approach, so should need to modify it to that setting. In particular, you would need to conclude the renderActions configuration options in your document options when you create the MathJax document with mathjax.document().

I haven't gone through your code very carefully, but it looks like your renderMath() function is called for every math expression, and that you create a new MathJax document each time. You could probably just set that up once and use it for all the math (that would allow you to use \newcommand in one expression and have it affect later expressions, for example, and would allow you to use \label and \ref. It seems you are calling RegisterHTMLHandler every time, which is not necessary (you only need to register the handler once, and you only need to create the liteAdaptor() once. However, if this is running in a browser, you don't want to use the liteAdaptor, but rather the browserAdaptor. That way you don't have to include all the LiteDOM code in your app.

Finally, you might find the MathJax node demos repository to be useful, in particular the direct examples, since you are making direct calls to the MathJax modules. See, for example, the tex2mml example.

from mathjax-demos-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.