Giter Club home page Giter Club logo

Comments (10)

pkra avatar pkra commented on June 5, 2024

Thanks for reporting this. Could you share the MathML source?

from mathjax-node.

gbala2412 avatar gbala2412 commented on June 5, 2024

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.

pkra avatar pkra commented on June 5, 2024

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.

pkra avatar pkra commented on June 5, 2024

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.

dpvc avatar dpvc commented on June 5, 2024

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.

pkra avatar pkra commented on June 5, 2024

Fixed in 0.3

from mathjax-node.

gbala2412 avatar gbala2412 commented on June 5, 2024

Works fine thank you very much!!!!!

from mathjax-node.

gbala2412 avatar gbala2412 commented on June 5, 2024

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.

dpvc avatar dpvc commented on June 5, 2024

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.

gbala2412 avatar gbala2412 commented on June 5, 2024

Thanks for the reply.

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.