mathjax / MathJax-node

MathJax for Node
Apache License 2.0
615 stars 97 forks source link

Very basic example #242

Closed acad2 closed 8 years ago

acad2 commented 8 years ago

I know this is a stupid question, but I couldn't find a solution. Suppose, I have a HTML page like this:

<!DOCTYPE html>
<html>
<head>
<title>MathJax TeX Test Page</title>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
<script type="text/javascript" async
  src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML">
</script>
</head>
<body>
When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</body>
</html>

Now, how can I get the corresponding image?

pkra commented 8 years ago

Now, how can I get the corresponding image?

If you are looking for an image representing the entire document, then mathjax-node is not the right tool.

Just like MathJax itself, mathjax-node only processes equations within a document and can generate SVG or HTML (or MathML) markup to render the equations.

If that's what you're after then the fastest way to try it out is probably to use the CLI tools page2html and pages2svg in the bin folder. Something like

page2html < in.html > out.html

should give you a first result. You can learn about all options from the files themselves.