mathjax / MathJax-node

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

is there any methd to modify render result's style? #455

Closed NoTalk-ly closed 4 years ago

NoTalk-ly commented 4 years ago

https://github.com/mathjax/MathJax-node/blob/7d74722c466d63b090acb3eb1be79bd8f06df8ca/lib/main.js#L167

i found that you remove the mathjax's style config, is there any other method to modify the render result's style? @pkra @dpvc

NoTalk-ly commented 4 years ago

In addtion, I use the SVG output,so I need a method in this case instead of html output

dpvc commented 4 years ago

These styles never show up in the SVG output itself, so they can't affect the svg element that you obtain from mathjax-node. So there is no point in specifying them in mathjax-node. Instead, you would need to provide your own stylesheet in the HTML page where you are using the svg. If you are not using your svg in an HTML page, then the styles configuration would have no effect anyway.

It is not clear entirely what you are trying to accomplish. If your input format is MathML, you can include style attributes on the elements you want to style. If your input format is TeX/LaTeX, you can use the \style macro to apply styles to sub-expressions. Not all styling can be handled by the SVG output processor, however.

NoTalk-ly commented 4 years ago

@dpvc I want to modify the render process to modify render result - svg's style. I modify some code and it works ! just like below: https://github.com/mathjax/MathJax-node/blob/7d74722c466d63b090acb3eb1be79bd8f06df8ca/lib/main.js#L698

thank you !