Comments (4)
For v3, you'll need to look at the examples in https://github.com/mathjax/MathJax-demos-node/
from mathjax-node.
For v3, you'll need to look at the examples in https://github.com/mathjax/MathJax-demos-node/
The only relevant difference I found between the script above and the related example was the use of mathjax-full
instead of the MathJax module obtained with npm i mathjax@3
.
In the readme.md linked above, it indeed states that:
Note: this technique is for node-based application only, not for browser applications. This method sets up an alternative DOM implementation, which you don't need in the browser, and tells MathJax to use node's require() command to load external modules. This setup will not work properly in the browser, even if you webpack it or bundle it in other ways.
Does that mean we should use npm i mathjax-node
for it to work on browsers, or are both implementations of mathjax-node the same, meaning neither are supposed to work on browsers?
from mathjax-node.
The MathJax.tex2chtml()
function takes a TeX string as its first argument, not a serialized HTML string, so it is processing the HTML tags and other text as mathematics, not HTML. That is why your output includes italics, the dollar signs, and the tag names. See the documentation for more details.
Does that mean we should use
npm i mathjax-node
for it to work on browsers, or are both implementations of mathjax-node the same, meaning neither are supposed to work on browsers?
The section of the readme you site refers to the use of require('mathjax').init({...})
, not to MathJax v3 in general. This technique is a quick way to get MathJax running in node, but it is set up to handle loading of extensions and other MathJax files using node's require()
function, and to use the LiteDOM internally, while in-browser use requires a different method for loading extensions, and should use the browser DOM rather than the LiteDOM.
MathJax can be included into node programs in several different ways, and these are illustrated in the different directories in the MathJax-demos-node repository (e.g., component
and direct
), and these can be used to pre-process math on the server.
This repository for mathjax-node
is a v2-only hack that makes it possible to run MathJax v2 in a node application. MathJax v3 was designed to be able to be used directly in node (with the proper configuration), so there is no need for mathjax-node if you are using v3.
from mathjax-node.
Thank you very much, @dpvc! That was very informative.
I will use this example and try to adapt it for an HTML string instead of a file.
from mathjax-node.
Related Issues (20)
- tex2svg converted image further rendering problem HOT 1
- how to set it to a transparent background? HOT 1
- Do mathjax-node support MathJax@3 HOT 2
- Mathjax- node:Latex Error converting latex to SVG with "\ \ [" HOT 3
- Cannot read property 'childNodes' of null HOT 3
- Rendering problems of latex $$\cong$$ in SVG HOT 5
- '\nolimits is allowed only on operators' which render right in mathjax v3 HOT 2
- width of svg is too small HOT 2
- Unknown node type "mstack" HOT 1
- Cannot get the same result with mathjax-node as with MathJax on the browser HOT 7
- Undefined control sequence even after defining it HOT 2
- "Error: TeX parse error: Missing \end{array}" HOT 2
- MathJax on Linkedom.. HOT 2
- Vercel - Error: Could not load script: "file:///var/task/node_modules/mathjax/unpacked/jax/element/mml/jax.js?V=2.7.9" HOT 5
- Correct mapping for prime symbol HOT 3
- Cannot read properties of null (reading 'childNodes') HOT 4
- how to fix “missing open brace on subscript”? HOT 6
- use 'tex2svg' cannot generate formula correctly HOT 1
- Setting background-color style to SVG element HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathjax-node.