Which configuration option(s) do I need to set to ensure the HTML generated for numbered equations has a width set?
The problem I am running into is that the HTML generated by MathJax is within a DOM element that tries to adjust its size to the content. This works perfectly as long as equations are not numbered. When they are numbered it seems the width of the components (the equation, and the equation number) is zero, so they are displayed overlapping and the parent element can't set its size correctly.
--
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/groups/opt_out.
This is clearer:
http://jsfiddle.net/8Wnxk/36/
Under certain circumstances (mostly when there is an equation tag), MathJax will make its displayed equations inside a DIV with width:100%
and will center the equation using absolute positioning within that DIV. This works as long as the container for the DIV has an actual width, but if it is "shrinkable" as it is with the Mozilla CSS attributes in the jsFiddle example, and in the TD in Fred's example, the container has no fixed width, and so width:100%
can end up being 0 (or the width of whatever other content is in the container). Because of the positioning, the equation's width is essentially 0, and so doesn't cause the container to require any width.
One solution would be to set min-width
for the DIV that has width:100%
so that it will have at least the width of the equation and label. I think that would clear up the problem of having the container shrink too much.
Fred's line-breaking issue is more complicated, since MathJax tries to find out the width of the containing element in order to know where to do its line breaking. For something like a TD with no other content, that doesn't work well, and the line breaking can get the wrong width to break at. I'm not sure what the best solution is there. Personally, I think displayed equations are inappropriate in such situations (though you could use \displaystyle
to get the display layout without the centering and other formatting), but that won't stop people from doing it anyway.
I attach a testcase that gather the problems with MathJax and intrinsic widths.
--
Frédéric Wang
maths-informatique-jeux.com/blog/frederic
--
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/groups/opt_out.
<testcase-intrinsic-width.html>