mathjax / mathjax-node Goto Github PK
View Code? Open in Web Editor NEWMathJax for Node
License: Apache License 2.0
MathJax for Node
License: Apache License 2.0
Hi, at work we choose mathjax to convert Latex into human friendly mathematics. Since we need to convert our document in pdf and epub, i decided to give MathJax-node a try.
It's almost good, i just have one problem and that is the fact that currently when i convert a HTML page to SVG, the math ml doesn't get converted.
I'm wondering if i'm doing something wrong or if this is a bug ? Here is the code that seems relevant (so i excluded everything that has to do with file reading and template form sending/reading), the source HTML and the result of the conversion:
Relevant code
preview = true;
speech = true;
speechrules = "mathspeak";
speechstyle = "default";
linebreaks= false;
nodollars=false;
nofontcache = true;
localcache = true;
format = "AsciiMath,TeX,MathML";
eqno = "none";
vimg = "";
font = "TeX";
ex = 6;
width = 100;
function processHTML(html, callback) {
console.log("processoHtml = "+html)
fs.unlink('upload/output.html');
var document = jsdom(html,{features:{FetchExternalResources: false}});
console.log("afterjsdom")
var xmlns = getXMLNS(document);
mjAPI.typeset({
html: document.body.innerHTML,
renderer: (vimg == "" ? "SVG" : "IMG"),
inputs: format,
equationNumbers: eqno,
singleDollars: !nodollars,
useFontCache: !nofontcache,
useGlobalCache: !localcache,
addPreview: preview,
speakText: speech,
speakRuleset: speechrules.replace(/^chromevox$/i,"default"),
speakStyle: speechstyle,
ex: ex,
width: width,
linebreaks: linebreaks,
xmlns:xmlns
}, function (result) {
console.log("prcoessHTML 2")
document.body.innerHTML = result.html;
document.head.appendChild(document.body.firstChild);
if (vimg !== "") {
var img = document.getElementsByClassName("MathJax_SVG_IMG");
for (var i = 0, m = img.length; i < m; i++) {
var N = (i+1).toString(); while (N.length < 4) {N = "0"+N}
var file = vimg+N+".svg";
var svg = [
'<?xml version="1.0" standalone="no"?>',
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',
new Buffer(img[i].src.replace(/^.*?,/,""),"base64").toString("utf-8")
].join("\n");
fs.writeFileSync(file,svg);
img[i].src = file;
}
}
var HTML = "<!DOCTYPE html>\n"+document.documentElement.outerHTML.replace(/^(\n|\s)*/,"");
callback(HTML);
});
}
function getXMLNS(document) {
console.log("get XMLNS")
var html = document.head.parentNode;
for (var i = 0, m = html.attributes.length; i < m; i++) {
console.log("XMLNS iter = " + i);
var attr = html.attributes[i];
if (attr.nodeName.substr(0,6) === "xmlns:" &&
attr.nodeValue === "http://www.w3.org/1998/Math/MathML")
{return attr.nodeName.substr(6)}
}
return "mml";
}
the Source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
</head>
<body id="article-127" class="textes article">
//////////////////////////////////////////////////
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mo lspace="1px" rspace="1px">−</mo>
<mi>i</mi>
<mfrac>
<mo rspace="0px">∂</mo>
<mrow>
<mo rspace="0px">∂</mo>
<mi>t</mi>
</mrow>
</mfrac>
<msup>
<mi>Ψ</mi>
<mo>∗</mo>
</msup>
<mo>=</mo>
<mo lspace="1px" rspace="1px">−</mo>
<mfrac>
<msup>
<mo lspace="1px" rspace="1px">∇</mo>
<mn>2</mn>
</msup>
<mrow>
<mn>2</mn>
<mi>m</mi>
</mrow>
</mfrac>
<msup>
<mi>Ψ</mi>
<mo>∗</mo>
</msup>
</mrow>
</math>
///////////////////////////////////////////
</body>
</html>
The Result
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"><head>
<style id="MathJax_SVG_styles">.MathJax_SVG_Display {text-align: center; margin: 1em 0em; position: relative; display: block!important; text-indent: 0; max-width: none; max-height: none; min-width: 0; min-height: 0; width: 100%}
.MathJax_SVG .MJX-monospace {font-family: monospace}
.MathJax_SVG .MJX-sans-serif {font-family: sans-serif}
.MathJax_SVG {display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 100%; font-size-adjust: none; text-indent: 0; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0; min-height: 0; border: 0; padding: 0; margin: 0}
.MathJax_SVG * {transition: none; -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none}
.mjx-svg-href {fill: blue; stroke: blue}
</style></head>
<body id="article-127" class="textes article">
//////////////////////////////////////////////////
<span style="font-size: 100%; display: inline-block;" class="MathJax_SVG" id="MathJax-Element-1-Frame" role="math" aria-readonly="true"></span><script type="math/mml" id="MathJax-Element-1"><math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mo lspace="1px" rspace="1px">−</mo>
<mi>i</mi>
<mfrac>
<mo rspace="0px">∂</mo>
<mrow>
<mo rspace="0px">∂</mo>
<mi>t</mi>
</mrow>
</mfrac>
<msup>
<mi>Ψ</mi>
<mo>∗</mo>
</msup>
<mo>=</mo>
<mo lspace="1px" rspace="1px">−</mo>
<mfrac>
<msup>
<mo lspace="1px" rspace="1px">∇</mo>
<mn>2</mn>
</msup>
<mrow>
<mn>2</mn>
<mi>m</mi>
</mrow>
</mfrac>
<msup>
<mi>Ψ</mi>
<mo>∗</mo>
</msup>
</mrow>
</math></script>
///////////////////////////////////////////
</body></html>
When I run
./bin/page2svg < test-files/sample-tex.html > test.html
The resulting file has no visible equations either on Firefox (31.0) or Chrome (36.0). After some tweaking, setting useFontCache to false fixes the issue.
Unless this is a local issue (thought i doubt it) which shoud be investigated, I think it would be sensible to set it to false by default.
We tried to merge
dpvc/MathJax@98e3f09
to support displaystyle mathml
however our example {\displaystyle {\text{geometric series:}}\quad {\begin{aligned}\sum _{{i=0}}^{\infty }2^{{-i}}=2\end{aligned}}}
does not seem to work in normal TeX mode.
In case of interest our exactract post data submitted to the mathoid server:
type=tex&q=%7B%5Cdisplaystyle%20%7B%5Ctext%7Bgeometric%20series%3A%7D%7D%5Cquad%20%7B%5Cbegin%7Baligned%7D%5Csum%20_%7B%7Bi%3D0%7D%7D%5E%7B%5Cinfty%20%7D2%5E%7B%7B-i%7D%7D%3D2%5Cend%7Baligned%7D%7D%7D
Is there an example that is fixed by
dpvc/MathJax@98e3f09
so that we can test if we merged the fix successsful.
Something like
Produces
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mspace width="2em">
<mn>1</mn>
</mspace></math>
-- which is invalid.
It doesn't seem a general MathJax problem where I get
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mspace width="2em" />
<mn>1</mn>
</math>
For large documents with lots of math, this api appears distinctly slower than in the browser. (I haven't profiled, but I'm guessing it's due to jsdom...)
This probably isn't a big problem, since this api likely isn't being used to render math on a page while it's being read. However, I'd find it useful to get percentage-complete callbacks.
The approach described here would work, except that there isn't currently a way to touch MathJax.Hub from outside the API.
Would it make sense to add as a config option an onInitComplete() callback, which could be called at the end of AuthorInit()? This could serve as an analogue to the ability in the browser to have arbitrary mathjax configuration code.
tl;dr: typeset()
, then start()
, then typeset()
yields the error, "Can't make callback from given data".
Here's a self-contained reproduction.
#! /usr/bin/env node
var fs = require('fs');
var path = require('path');
var jsdom = require('jsdom').jsdom;
var mjAPI = require("../lib/mj-page.js");
var html = "<html><body><div>$x$</div></body></html>";
mjAPI.config({MathJax: {SVG: {font: "TeX"}}});
mjAPI.start();
typeset(html, function(result) {
console.log("Once!");
setImmediate(function() {
// without this line, it works fine, but if we wanted to change the configuration
// between typesets, we'd need this.
mjAPI.start();
typeset(html, function(result) {
console.log("Twice!");
})
})
})
function typeset(html,callback) {
var document = jsdom(html,null,{features:{FetchExternalResources: false}});
mjAPI.typeset({
html: document.body.innerHTML,
renderer: "SVG",
inputs: ["AsciiMath", "TeX", "MathML"],
equationNumbers: "none",
singleDollars: true,
useFontCache: false,
useGlobalCache: false,
svgPreview: true,
imgSVG: false,
speakText: true,
ex: 6, width: 100,
linebreaks: true,
xmlns:'mml'
}, callback);
}
I wasn't sure if this is an upstream bug but I suspect it is.
Something like
$ tex2mml --semantics '\begin{align} a < b & c > d \end{align}'
will have
<annotation encoding="application/x-tex">\begin{align} a < b & c > d \end{align}</annotation>
That is, &
, <
, and >
are not escaped.
(This leads to validation problems, in particular in XML environments.)
This bug does not appear when only one rendering opption is used. It happens only when we turn off the imgSVG or the imgPNG option.
suppose we set:
data.imgSVG = true
then render. Everything renders fine.
Then if we switch to
data.imgSVG = false
The resetGlyph method gives an error message:
file:///Users/project/node_modules/MathJax-node/mathjax/unpacked/jax/output/SVG/jax.js?rev=2.4-beta-2:388
GLYPH.defs.innerHTML = "";
^
TypeError: Cannot set property 'innerHTML' of null
at SVG.Augment.resetGlyphs (file:///Users/project/node_modules/MathJax-node/mathjax/unpacked/jax/output/SVG/jax.js?rev=2.4-beta-2:388:32)
at StartQueue (/Users/projects/node_modules/MathJax-node/lib/mj-page.js:654:7)
at Object.exports.typeset (/Users/project/node_modules/MathJax-node/lib/mj-page.js:709:35)
at /Users/projects/server/mailer/mailerCtrl.js:201:38
at fn (/Users/project/node_modules/async/lib/async.js:641:34)
at Object._onImmediate (/Users/project/node_modules/async/lib/async.js:557:34)
at processImmediate [as _immediateCallback] (timers.js:330:15)
This bug is relatively easy to understand. Might come back to this later.
My goal is to pass a Tex string to MathJax and receive HTML & CSS back.
It looks like this library only allows you to output the math as SVG, PNG or MML. Do you intend to add HTML?
We should add speech output to the MathML.
Depends on #49.
These are supposed to be the MathJax element's ID followed by -Title
and -Desc
but the ID is taken from the wrong place and ends up empty, so every SVG on the page has <title id="-Title">
.
Double struct letters rendered as junk characters. Both input html and output html available in the link mentioned below:
https://drive.google.com/file/d/0ByIDsiVMQVJRNkFOdWVuaGRqYUk/view?usp=sharing
Received error --- Unknown character (59): U+2146 in MathJax_Main,MathJax_Size1,MathJax_AMS
Since MathJax-node assumes a fixed page width, equation numbers can make small equations take up a large amount of space. That's in particular a problem on small viewport sizes. While overflow:auto
or automatic scaling help to some degree, neither is very good.
Can we do something smart here? Such as fixing the padding between equation and label to a fixed amount?
Make MathJax a semi-regular dependency, with npm using a tarball from a slimmed down branch.
Hi,
I got the mjAPI.typset() to work. All is well until I started to run async tests against it.
It looks like if one does:
require('MathJax-node').typeset(data, callback)
if you run two renders at the same time, without the first one finish, you get an error message:
/node_modules/MathJax-node/lib/mj-page.js:442
if (data.renderer === "None") {content.innerHTML = "<p></p>"}
^
TypeError: Cannot read property 'renderer' of null
at TypesetDone (/node_modules/MathJax-node/lib/mj-page.js:442:11)
at Function.CALLBACK.execute (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:236:26)
at cb (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:218:59)
at BASE.Object.Subclass.Process (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:488:38)
at BASE.Object.Subclass.call (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:501:37)
at Function.WAITEXECUTE (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:341:50)
at cb (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:218:59)
at BASE.Object.Subclass.Process (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:488:38)
at BASE.Object.Subclass.call (file:///node_modules/MathJax-node/mathjax/unpacked/MathJax.js:501:37)
at Function.WAITEXECUTE (file:///node_modules/MathJaxa-node/mathjax/unpacked/MathJax.js:341:50)
npm ERR! weird error 8
npm ERR! not ok code 0
Any thoughts on how to fix this?
It would be nice to allow the command-line tools to specify additional MathJax configuration (like left-side alignment, etc.)
When trying something like:
./bin/tex2svg 'P(E)= {n \choose k} p^k (1-p)^{ n-k}' > math.svg
I'm getting an empty (zero byte) file math.svg
.
Any pointers on how to debug this??
Example:
$ bin/page2svg < test-files/test-tex.html
produces an svg with attribute viewbox
instead of viewBox
. This might be a jsdom issue.
Hi. I'm trying to get started with MathJax-node and be able to run some simple examples. I want to be able to author files with both SVG and math content, and use MathJax-node to turn them into pure SVG.
I'm running on Windows.
After installing node.js, npm and python 2.7, I was able to run the npm install which completes with just a couple of warnings. Seeing that there were recently some issues resolved with running on Windows, I used git to checkout the 'develop' branch.
However, I'm new to this whole environment and could use a few hints. How do I convert math to SVG? Should I be able to run something like
node tex2svg test-files/sample-tex.html > test.svg
Please could you post at least one command that I should be able to run if set up correctly to generate an output file. This will help me figure out whether I am getting the installation steps right. Thanks.
It seems to me mjpage
could be coaxed to produce mjsingle
output, so that a configuration option might be enough. What am I missing?
npm install https://github.com/mathjax/MathJax-node/tarball/master
gives me:
npm ERR! Failed resolving git HEAD (git://github.com/dpvc/MathJax.git) fatal: ambiguous argument 'node-package': unknown revision or path not in the working tree.
npm ERR! Failed resolving git HEAD (git://github.com/dpvc/MathJax.git) Use '--' to separate paths from revisions, like this:
npm ERR! Failed resolving git HEAD (git://github.com/dpvc/MathJax.git) 'git <command> [<revision>...] -- [<file>...]'
npm ERR! Failed resolving git HEAD (git://github.com/dpvc/MathJax.git)
npm ERR! Darwin 13.4.0
npm ERR! argv "/Users/anand/.nvm/v0.11.14/bin/node" "/Users/anand/.nvm/v0.11.14/bin/npm" "install"
npm ERR! node v0.11.14
npm ERR! npm v2.0.0
npm ERR! code 128
npm ERR! Command failed: git rev-list -n1 node-package
npm ERR! fatal: ambiguous argument 'node-package': unknown revision or path not in the working tree.
npm ERR! Use '--' to separate paths from revisions, like this:
npm ERR! 'git <command> [<revision>...] -- [<file>...]'
And I don't see a node-package
tag or branch in dpvc/MathJax.
For the input ${\displaystyle $math}$
rendered in inline-TeX mode (e.g.
curl -d 'type=inline-TeX&q=%7B%5Cdisplaystyle%20E%3Dmc%5E2%7D' localhost:10042
) the generated xml output is invalid because it contains a two times the same xml attribute display
We fixed that in mathoid in
https://gerrit.wikimedia.org/r/#/c/165946/1/mathoid-worker.js
but it would be great if that coud be fixed within mathjax-node as well.
MathJaX-node seems not to render displaystyle equations properly
See http://en.wikipedia.beta.wmflabs.org/wiki/User:Physikerwelt/Displaystyle
the query string used is {\\displaystyle \\text{geometric series:}\\quad \\begin{align} \\sum_{i=0}^\\infty 2^{-i}=2 \\end{align}}
according to fredw 's proposal we might want to add an option to preTranslate: function (state) if @dpvc agrees?
Example:
$ bin/tex2svg "\text{ }"
produces
...
<path stroke-width="10" id="E1-MJMAIN-20"></path>
...
or more precisely
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" style="vertical-align: -0.167ex; margin-left: 0ex; margin-right: 0ex; margin: 1px 0px;" width="0.667ex" height="0.167ex" viewBox="0 -23.9 255 47.9" xmlns="http://www.w3.org/2000/svg">
<defs>
<path stroke-width="10" id="E1-MJMAIN-20"></path>
</defs>
<g stroke="black" fill="black" stroke-width="0" transform="matrix(1 0 0 -1 0 0)">
<use xlink:href="#E1-MJMAIN-20"></use>
</g>
</svg>
Adding empty attribute d=""
should fix this.
This looks like an upstream bug in MathJax.
Via https://phabricator.wikimedia.org/T78518.
$ ./bin/tex2mml '\overline{M}^1'
throws
TeX parse error: Double subscripts: use braces to clarify
although MathJax itself does not seem to have a problem with this.
Sometimes MathJax add a position:absolute CSS style to the svg element. If page2svg-img encounter such situation, the resulting equation will be out of flow. This can be demonstrated with this example :
Perhaps we can keep a single CLI parameter set around?
Is the first line, #! /usr/bin/env node --
, could be #! /usr/bin/env node
?
I'm not familiar with nodejs, and I'm not sure that, but when i delete --
, i can get things ok.
E.g.,
$ node bin/tex2svg --inline '\definecolor{red}{RGB}{255,0,0}\color{red}e^{i \pi} + 1 = 0'
returns with
TeX parse error: Undefined control sequence \definecolor
But
$ node bin/tex2svg --inline '\require{color}\definecolor{red}{RGB}{255,0,0}\color{red}e^{i \pi} + 1 = 0'
works fine.
Thanks for this great library! What's the configuration to convert svg to png images? I followed the instruction and now have the batik library uncompressed inside the batik
folder.
If I pass
data = {
renderer: 'png',
html: '<p>some html ....</p>'
MathJax-node gives me an error message:
file failed to load: file:///project_folder/node_modules/MathJax-node/mathjax/unpacked/jax/output/png/config.js
Thanks!
I'm working on improving MathJax support in GitBook 2.0.0 by inlining svg but I have some issues with MathJax -Node:
For example with:
\begin{multline*}
\frac{\partial\xi^{(k+1)}}{\partial\xi^{(k)}}=
I-\mathcal{D}_{22}^{-1}(\omega^{(k+1)},\xi^{(k)})
(\mathcal{D}_{21}(\omega^{(k+1)},\xi^{(k)})
\frac{\partial\omega^{(k+1)}}{\partial\xi^{(k)}}
+\mathcal{D}_{22}(\omega^{(k+1)},\xi^{(k)}))=\\
\mathcal{D}_{22}^{-1}(\omega^{(k+1)},\xi^{(k)})
(\mathcal{D}_{21}(\omega^{(k+1)},\xi^{(k)})
\frac{\partial\omega^{(k+1)}}{\partial\xi^{(k)}}
\end{multline*}
The output with the normal MathJax in a webpage (output SVG) is:
And with MathJax-node:
If I use the option linebreaks
, I have the issue #62:
I successfully got the npm install to work in Windows 7 (which was a nightmare and a half already), but the MathJax-node binaries don't work for me. Using mingw bash (also tested with windows command prompt just in case that helped, but it has the same result).
I run:
$ bin/tex2svg 'x_2'
The result is nothing - i.e. it pauses for about 1-2 seconds then exits and shows the $ prompt again, with no output.
Originally I was using node.js v0.10.something. I've since updated to the latest v0.12.0 (and did a rebuild and update) but with same result.
I tried adding console.log calls in various places in the script (bin/tex2svg). As a result I can confirm that it runs the script from start to finish, but does not run the callback that is supposed to happen when typesetting finishes.
I also have a Linux VM where I also installed MathJax-node the same way and this does work fine, returning SVG code.
Basically wondering if this is just my setup, or if it's known to not work in Windows for some reason. Our production servers are Linux but for development it is sometimes convenient if we can run stuff on Windows also.
Currently, speech output is part of the SVG generation but we need it in MathML and PNG output as well. We should keep it separated for re-use.
The problem: there's important module-scoped variables in mj-page, making it a singleton. This makes it awkward to have multiple configurations going in the same program. And actually, because of #36, there's no clear workaround. Conversely, changing this would basically remove the need for restarting MathJax, which is what 36 is about.
Two use cases for why it would be good to have the API be "instanceable":
I'm advocating for something like:
var mathjaxnode = require('MathJax-node');
var api1 = mathjaxnode(config1);
var api2 = mathjaxnode(config2);
Where config1
and config2
are configuration objects in the form currently expected by config()
.
Happy to work up a PR for this if the maintainers are in support.
Let's try to fix #30 and make it configurable.
Sample via Benetech
<math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>x</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>θ</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mo>=</mml:mo>
<mml:mfrac>
<mml:mi>β</mml:mi>
<mml:mrow>
<mml:msup>
<mml:mo form="prefix">cos</mml:mo>
<mml:mn>2</mml:mn>
</mml:msup>
<mml:mi>θ</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:math>
Sample Rendering:
Since this doesn't happen on in core MathJax, it seems like a mathjax-node bug.
It would be nice to have an API for processing content fragments.
Some potential features
Besides keeping the page itself cleaner, this allows for more efficient delivery, especially when processing multiple files (e.g., a statically re-generated site, ebooks) and also improves processing of non-HTML such as markdown files (in particular with YAML front matter).
I hava some trouble in my vps about java environment configuration, and i find the node package "svg2png" and modify some code, i'll submit a pull request about this for a review.
sorry for my poor english.
I want to convert a set of file to some output
for example
file1.tex
file2.tex
fileN.tex
to
file1.svg
file1.png
file2.svg
file2.png
fileN.svg
fileN.png
Right now, i run this:
tex2svg 'file1.tex content' > file1.svg
tex2png 'file1.tex content' > file1.png
...
...
But it is not very efficient, because they are many inputs and MathJax is loaded into each execution
Is there any way to do it more efficient?
We need to add speech output to PNG (in mj-page).
Depends on #49
Once MathJax v2.5 is finalized, we should
There should be an option to set the font (for SVG output).
This is more of a MathJax-core issue but I wasn't sure how to file it so I wanted to discuss this here first.
Converting \liminf
leads to invalid SVG.
(Also, tex2svg
does not produce output if unknown characters are reported.)
\liminf
to SVG will contain<text transform="scale(53.81925) matrix(1 0 0 -1 0 0)" stroke="none" font-weight="" font-style="" font-family="STIXGeneral,'Arial Unicode MS',serif"> </text>
which is invalid since font-weight
and font-style
are empty.IIUC, the problem is that converting TeX input \liminf
to MathML produces u+2006
which is not covered by the MathJax TeX fonts (at least according to the error message of the SVG output) but also (in the output) not converted into characters that are covered. In turn, this unknown characters is causing the text
tag.
I updated Mathoid to use MathJax-node without any phantomjs
You can test (after creating an account) at
http://math-preview.wmflabs.org/wiki/Littlewood%E2%80%93Paley_theory
Please let me know if you find any issues.
MathJax-node currently only adds speech-text to the SVG output, not the MathML.
The following LaTeX input causes problems
\liminf->U+2006 (SVG - Unknown character: U+2006 in MathJax_Main,MathJax_Size1,MathJax_AMS)
\S -> ["SVG - Unknown character: U+A7 in MathJax_Main,MathJax_Size1,MathJax_AMS"]
I want to convert a math to png/svg with linebreak option, width of the math should be 600px . I don't know how to achieve this.
If I want reduce/increase the font size where I've to mention it?
If you could explain all the options in the README file which helps a lot for all.
Commands and output
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.