Comments (10)
Thanks for reporting this. Could you share the MathML source?
from mathjax-node.
Sorry! Mathml code inserted below.
<math altimg="si28.gif"><mrow><mfrac><mrow><mo linebreak="goodbreak">∂</mo><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><mi>t</mi></mrow></mfrac><mo linebreak="goodbreak">=</mo><msub><mover accent="true"><mi>F</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>10</mn></mrow></msub><mfrac><mrow><mo linebreak="goodbreak">∂</mo><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msub><mi>A</mi><mrow><mn>10</mn></mrow></msub></mrow></mfrac><mo linebreak="goodbreak">+</mo><msub><mover accent="true"><mi>F</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>20</mn></mrow></msub><mfrac><mrow><mo linebreak="goodbreak">∂</mo><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msub><mi>A</mi><mrow><mn>20</mn></mrow></msub></mrow></mfrac><mo linebreak="goodbreak">+</mo><msub><mover accent="true"><mi>G</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>10</mn></mrow></msub><mfrac><mrow><mo linebreak="goodbreak">∂</mo><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msub><mi>Γ</mi><mrow><mn>10</mn></mrow></msub></mrow></mfrac><mo linebreak="goodbreak">+</mo><msub><mover accent="true"><mi>G</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>20</mn></mrow></msub><mfrac><mrow><mo linebreak="goodbreak">∂</mo><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msub><mi>Γ</mi><mrow><mn>20</mn></mrow></msub></mrow></mfrac><mo linebreak="goodbreak">+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mover accent="true"><mi>B</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>110</mn></mrow></msub><mfrac><mrow><msup><mo linebreak="goodbreak">∂</mo><mn>2</mn></msup><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msubsup><mi>A</mi><mrow><mn>10</mn></mrow><mn>2</mn></msubsup></mrow></mfrac><mo linebreak="goodbreak">+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mover accent="true"><mi>B</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>220</mn></mrow></msub><mfrac><mrow><msup><mo linebreak="goodbreak">∂</mo><mn>2</mn></msup><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msubsup><mi>A</mi><mrow><mn>20</mn></mrow><mn>2</mn></msubsup></mrow></mfrac><mo linebreak="goodbreak">+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mover accent="true"><mi>K</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>110</mn></mrow></msub><mfrac><mrow><msup><mo linebreak="goodbreak">∂</mo><mn>2</mn></msup><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msubsup><mi>Γ</mi><mrow><mn>10</mn></mrow><mn>2</mn></msubsup></mrow></mfrac><mo linebreak="goodbreak">+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mover accent="true"><mi>K</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>220</mn></mrow></msub><mfrac><mrow><msup><mo linebreak="goodbreak">∂</mo><mn>2</mn></msup><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msubsup><mi>Γ</mi><mrow><mn>20</mn></mrow><mn>2</mn></msubsup></mrow></mfrac><mo linebreak="goodbreak">+</mo><msub><mover accent="true"><mi>K</mi><mo linebreak="goodbreak">¯</mo></mover><mrow><mn>120</mn></mrow></msub><mfrac><mrow><msup><mo linebreak="goodbreak">∂</mo><mn>2</mn></msup><mi>R</mi></mrow><mrow><mo linebreak="goodbreak">∂</mo><msub><mi>Γ</mi><mrow><mn>10</mn></mrow></msub><mo linebreak="goodbreak">∂</mo><msub><mi>Γ</mi><mrow><mn>20</mn></mrow></msub></mrow></mfrac></mrow></math>
from mathjax-node.
Thanks again. I can reproduce this; it looks like a bug in Mathjax-node.
You're specifying the width correctly. It seems like Mathjax-node is unable to provide the line-broken equaton with enough height, so everything collapses.
We'll investigate.
from mathjax-node.
This problem seems to have shifted with MathJax v2.5-final. The overlap issue seems to have been solved but linebreaking fails. Will investigate further.
from mathjax-node.
There are several things going on, here. One is a bug in MathJax-node where the line breaking width was not being passed to MathJax properly. (The SVG output jax computes sizes in units of 1/1000 em, but MathJax-node was passing pixels instead.)
The other issue is that the --width
parameter is given in units of ex not px, so --width=6000
means 6000ex, so no line breaking would be needed in that case (but the missing factor of 1000 internally messed that up).
A value of --ex=2
means that the ex-hight is 2 pixels, which is probably not a very good idea, and it is the reason why the fractions and subscripts are so large. That is because there is a minimum size used when the font size changes (for scripts and fractions), but it is larger than your original 2px ex-height, and so the subscripts get larger.
I'm not certain that you posted the correct picture for your second example, as it is the same as your first, but it should be the same as the fourth. But it doesn't really matter, as I have a fix for the line breaking width problem in the issue62
branch of MathJax-node.
Since --ex
is the ex-height in pixels, and --width
is the line-breaking with in ex, in order to get a 600px image, you would need the value of --ex
times the value of --width
to be 600. The default values are --ex=6
and --width=100
, so that is already 600px, so you should be able to go with the default.
If you want the actual size of a pixel in the image to be a pixel in the MathML, then you need to use --dpi
set to 16 times the --ex
value. The issue62
branch changes the default of --dpi
from 144 to 0, where 0 means to calculate the dpi value to be the ex-height times 16. So in that branch, you should be able to leave off all three parameters.
from mathjax-node.
Fixed in 0.3
from mathjax-node.
Works fine thank you very much!!!!!
from mathjax-node.
mml2png works fine but mml2svg font size not rendering as per the ex value. Attached sample html, png and svg files.
https://drive.google.com/file/d/0ByIDsiVMQVJRallLSHp3cnhMV1k/view?usp=sharing
from mathjax-node.
The size of the SVG file is given in units of ex
, so its rendering will depend on the font size of the page in which it appears. The ex
value you give is supposed to tell MathJax-node what that size is going to be (MathJax doesn't force that size). The ex
value is used to determine the dpi for png output, and to convert measurements given in units of px
, mm
, in
and other such units to the proper internal SVG units. But it is not used to force an absolute size for the final SVG element. That size is determined by the font size of the surrounding text.
So in your example, I would expect all the SVG files to be the same size (because the surrounding text is the same throughout). That is what I see.
Also, in the future, you should open a new issue if you are reporting a new problem (which this is).
from mathjax-node.
Thanks for the reply.
from mathjax-node.
Related Issues (20)
- is there any methd to modify render result's style? HOT 3
- Config options don't change appearance of SVG output HOT 1
- 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
- MathJax node does not work with HTML HOT 4
- Cannot read properties of null (reading 'childNodes') HOT 4
- how to fix “missing open brace on subscript”? HOT 6
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.