Is there any option of equation wrap in math jax ?

52 views
Skip to first unread message

Saadi

unread,
Jun 20, 2017, 7:03:38 AM6/20/17
to MathJax Users
Hi All , 

I have a equation which is long. Is there any option that math jax automatically wrap the equation based on the height and width of the div tag ?

Regards 

Davide Cervone

unread,
Jun 20, 2017, 3:20:56 PM6/20/17
to mathja...@googlegroups.com
> I have a equation which is long. Is there any option that math jax automatically wrap the equation based on the height and width of the div tag ?

See

http://docs.mathjax.org/en/latest/search.html?q=linebreaks&check_keywords=yes&area=default

for links to the options for each of the output jax that control the automatic wrapping.

Davide
Message has been deleted

Saadi

unread,
Jun 21, 2017, 9:23:13 AM6/21/17
to MathJax Users
Thanks David .

I am using MathML and used the following code

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  CommonHTML: { linebreaks: { automatic: true } },
  "HTML-CSS": { linebreaks: { automatic: true } },
         SVG: { linebreaks: { automatic: true } }
});
</script>
When i run the html file, it get stuck at Typesetting math:0% and did not move forward(i waited for 2-3 mins).  Is there any way to fast the MathML rendering along with line break option ?

Davide Cervone

unread,
Jun 21, 2017, 9:46:01 AM6/21/17
to mathja...@googlegroups.com
Can you give a link to a sample page that exhibits the problem.  It is hard to diagnose without seeing it in action.

How many mathematical expressions are on the page?  I would not expect the type of delay without there being at least several thousand expressions on the page.

Also, are you adding the math to the page dynamically, or is it all there initially.  If the page is being built dynamically, then the issue may be in how you are calling MathJax during that process.

Which output processor are you using (you can correct configured all three, but haven't said which you are actually using).  The HTML-CSS output will be the slowed, followed by the SVG output, with the CHTML output being the fastest in general.

You might disable the fast preview and see if that helps:

MathJax.Hub.Config({
  "fast-preview": {disabled: true}
});

Finally, what browser and OS are you working on?

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.
For more options, visit https://groups.google.com/d/optout.

Saadi

unread,
Jun 22, 2017, 10:10:10 AM6/22/17
to MathJax Users
Hi David !

I have attached the file (1.html), which contains the math ml and the url of math jax.  Please review it.

I am using chrome browser and windows 2008 r2 64bit OS.

Regards 
Saad
1.html

Davide Cervone

unread,
Jun 29, 2017, 9:25:53 AM6/29/17
to mathja...@googlegroups.com
Saad:

Thanks for the file.  Note that MathJax's line-breaking algorithm is based on the MathML model.  It allows line breaks at <mo> and <mspace> elements (and within token elements, but MathJax hasn't implemented that yet).  So line breaks will only occur at the equal signs in your equation (the only <mo> elements there).  Your example, does produce a line break at one of these.

In particular, MathJax will not break the <mtext> elements, which is what I expect you are looking for.  This text is really should not be part of the mathematics, but should be regular text within the page.  That is, I would expect things like "In this equation c and a are relatively prime" to be regular text in the HTML page (with the "c" and "a" in math mode), not <mtext> elements within a larger math expression.  Semantically, these are not part of the math, and should not be included in the <math> tag.  That is one of the reasons you are having the problems you are experiencing.

Also, MathJax's line breaking within tables is not optimal.  A cell is broken based on the width of the container without taking the other columns into account, so that may also be a factor here.  It is not clear to me why this needs to be in a table; I would expect <mspace linebreak="newline" /> would be a better way to obtain the forced line breaking that your StarMath source suggests you want, rather than using an <mtable>.

So the upshot is that you probably aren't going to get the results you want from MathJax's line breaking mechanism.  Restructuring to use a mix of plain HTML text and individual math expressions (rather than one big one with internal text) would help.

Davide


<1.html>

Reply all
Reply to author
Forward
0 new messages