How to customize renderer

24 views
Skip to first unread message

william yan

unread,
Jun 20, 2024, 1:10:13 AMJun 20
to MathJax Users

Hello,

I'm currently designing a paper render engine that uses MathJax 3 to render TeX into SVGs and then paint these SVGs onto a canvas. I've run into a problem with longer TeX expressions: the output SVG is too large to be painted on a single line. To break the output SVG into lines, I've split the SVG into smaller segments and then laid them out using these smaller SVGs. However, the results are not accurate, and lines may be broken at incorrect places. Is there a way that I can hook into MathJax 3 to customize the output SVG or create my own renderer?

Thanks for your help!

Davide Cervone

unread,
Jun 21, 2024, 11:10:57 AMJun 21
to mathja...@googlegroups.com
MathJax v4 (currently in beta release) includes automatic line breaking for display equations, and browser-based line breaking for in-line expressions.  So you may want to try out v4 if you need to break your formulas to a specific size.

Alternatively, you could use a multi-line environment, like \begin{align}...\end{align}, or \displaylines{...} an manually break the formula to the width that you need.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/4ca7d030-36ba-4bff-91aa-51ded0cc7ba7n%40googlegroups.com.

william yan

unread,
Jun 23, 2024, 11:30:55 PMJun 23
to mathja...@googlegroups.com
thanks, I'll try it later

Davide Cervone <dpv...@gmail.com> 于2024年6月21日周五 23:10写道:
Reply all
Reply to author
Forward
0 new messages