Giter Club home page Giter Club logo

Comments (5)

pkra avatar pkra commented on June 12, 2024

There are no examples in /bin that do provide this out of the box. Theoretically, page2svg could help but I don't know how well jsdom would handle an SVG (they are not focused on XML support).

Also, it's not straight forward to have MathJax work inside an SVG (cf. http://stackoverflow.com/questions/15962325/mathjax-inside-svg). You could follow the idea from the second answer there: write your own wrapper that loops through the TeX fragments, runs tex2svg, and inserts the results into the larger SVG.

(FYI, check out #70 for Windows related issues.)

from mathjax-node.

tobysharp avatar tobysharp commented on June 12, 2024

Thanks, but if MathJax-node doesn't do this, what does it do? Could you provide a couple of examples, with command lines using the sample files?

from mathjax-node.

pkra avatar pkra commented on June 12, 2024

if MathJax-node doesn't do this, what does it do?

MathJax-node provides APIs to call MathJax from node.js programs. This repository also contains example programs (in /bin) of using those APIs.

Could you provide a couple of examples, with command lines using the sample files?

Try runnning an example from bin or just read them.

  • from tex2svg: "Usage: tex2svg [options] 'math' > file.svg"
  • from page2svg: "Usage: page2svg [options] < input.html > output.html"

In other words, tex2svg converts a TeX string into an SVG, page2svg processes an HTML document, replacing mathematics with svg renderings. See each example for the specific options.

Perhaps you can explain what you're after in more detail. Also, IIUC the develop branch is not yet working on Windows as two PRs are not yet incorporated.

from mathjax-node.

tobysharp avatar tobysharp commented on June 12, 2024

Thank you. I'm sure I will understand a little better when I have one or two of these simple examples running and can see how they work. Hopefully the fixes for Windows will be incorporated soon too. However I would suggest updating the readme file with at least one complete "getting started" example that can be run after installation to generate some sort of trivial output. IIUC this should work?:
node tex2svg 'x^2+y^2=r^2' > circle.svg

Thanks again.

from mathjax-node.

dpvc avatar dpvc commented on June 12, 2024

Yes, your example should work. And the develop branch should work in Windows except for PNG generation.

from mathjax-node.

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.