support for columnspan and rowspan attributes

292 views
Skip to first unread message

Alexander Krutik

unread,
Jan 31, 2012, 3:19:29 PM1/31/12
to MathJax Users
Hi all,

Are there any plans to add support for columnspan and rowspan
attributes in MathJax?

http://www.w3.org/Math/testsuite/build/main/Presentation/TablesAndMatrices/mtable/mtableBspan3-full.xhtml
(This is not a bug report because I think Davide is aware of this. He
is the one who made the tests of MathJax for w3.org.)

But, anyway, since MathJax don't yet support elementary math
functions, all elementary math which shows the addition of numbers (of
equations) in a vertical form have to be set up using mtables. It
would be very useful to have the support for columnspan and rowspan. I
have to resort to nested tables every time I need columnspan or
rowspan.

Alex



leathrum

unread,
Jan 31, 2012, 9:05:05 PM1/31/12
to MathJax Users
If you are talking about tables and arrays in MathJax's TeX/LaTeX
input syntax, MathJax is somewhat constrained by the fact that
standard TeX/LaTeX tables and arrays are described using tab stops and
line breaks, so colspans and rowspans are only possible with nested
tables. The more interesting question, then, is getting colspans and
rowspans when using the MathML input jax (and, say, the HTML/CSS
output jax). I should point out that browser support still isn't very
good for this -- my browser (FF9 in Ubuntu, so native MML) didn't
render the tables in your test page correctly, the column of 2's
didn't span the rows as indicated in the sample rendering but instead
showed as 4 distinct lines in a single table (the second line had a 2
and two blank spaces).

As for rendering elementary math, like aligning digits in vertical
form addition, the W3C mathML WG gave a lot of thought to this kind of
thing in drafting the MML3 spec. I recall an extensive (and
fascinating) discussion of how to lay out long division, for example.
I'm not sure MathJax has brought those new features into its MathML
input jax yet, though.

On Jan 31, 9:19 am, Alexander Krutik <krutik.alexan...@gmail.com>
wrote:
> Hi all,
>
> Are there any plans to add support for columnspan and rowspan
> attributes in MathJax?
>
> http://www.w3.org/Math/testsuite/build/main/Presentation/TablesAndMat...

Davide P. Cervone

unread,
Feb 3, 2012, 3:27:59 PM2/3/12
to mathja...@googlegroups.com
> Are there any plans to add support for columnspan and rowspan
> attributes in MathJax?

It is certainly something that we'd like to support, but there are no
immediate plans to add it to the HTML-CSS output (For NativeMML
output, it is up to the browser whether it is supported or not). Once
v2.0 is out, we will begin prioritizing the next round of features and
enhancements. Finishing the table support is certainly one
possibility there.

> (This is not a bug report because I think Davide is aware of this. He
> is the one who made the tests of MathJax for w3.org.)

Yes, I am aware of the deficiency.

> But, anyway, since MathJax don't yet support elementary math
> functions, all elementary math which shows the addition of numbers (of
> equations) in a vertical form have to be set up using mtables. It
> would be very useful to have the support for columnspan and rowspan. I
> have to resort to nested tables every time I need columnspan or
> rowspan.

Support for the elementary math constructs is also another possibility
for future work. It all depends on what the community and the
supporters are willing to back, either through their own code
contributions, or financial support to have me do the coding.

Davide

leathrum

unread,
Feb 3, 2012, 8:18:21 PM2/3/12
to MathJax Users
Just for fun, here is a link to an image that made the rounds during
the aforementioned MathML WG discussion about laying out long division
-- shows several variants, generally variants taught in different
countries (e.g. one shows the numerals in Arabic).

http://cs.jsu.edu/~leathrum/division.png

Before seeing this image, I was familiar with perhaps 2 of the 10
layouts shown. The headings on the displays are strings the WG used
for "longdivstyle" attribute values to select the different layouts.
See the MathML3 spec, section 3.6.2. TeX has very little support for
this sort of thing, so we shouldn't expect much from the TeX input jax
to MathJax in this regard.

Davide P. Cervone

unread,
Feb 3, 2012, 8:47:58 PM2/3/12
to mathja...@googlegroups.com
I did some examples of some hacks for doing polynomial division at

http://groups.google.com/group/mathjax-users/browse_thread/thread/561b040757e5b722

Something similar could be done for other long division forms. The
code pretty terrible, but it is not impossible to make it work.

Davide

leathrum

unread,
Feb 3, 2012, 9:03:00 PM2/3/12
to MathJax Users
Here is what I usually do for polynomial long division in LaTeX (this
doesn't have everything filled in -- copied from a College Algebra
worksheet):

\[
\begin{array}{cccccc}
&\ x^2&&&&\\
\cline{2-6}
x^2-2x+3&\vline\ x^4&+3x^3&+0x^2&-4x&+5\\
&x^4&-2x^3&+3x^2&&\\
\cline{2-4}
&&5x^3&-3x^2&-4x&\\
&&&&&\\
\cline{3-5}
&&&&&\\
&&&&&\\
\cline{4-6}
&&&&&
\end{array}
\]

The alignment is good, but the division bar isn't quite right. It
would be pretty dicey for long division of numbers unless you could
squash things together.

On Feb 3, 2:47 pm, "Davide P. Cervone" <d...@union.edu> wrote:
> I did some examples of some hacks for doing polynomial division at
>
>        http://groups.google.com/group/mathjax-users/browse_thread/thread/561...

Marc-gmail

unread,
Feb 3, 2012, 9:05:15 PM2/3/12
to mathja...@googlegroups.com
Though it would be handy to have the polynomial division TeX macro functionality ;-)

Davide P. Cervone

unread,
Feb 3, 2012, 9:36:39 PM2/3/12
to mathja...@googlegroups.com
MathJax doesn't have \cline, so this won't work there. I was also
looking for something with more natural spacing of the polynomials.
Otherwise, sure.

Davide

leathrum

unread,
Feb 3, 2012, 10:22:03 PM2/3/12
to MathJax Users
Actually, the \cline macro support issue brings this discussion back
full circle, because implementing \cline would probably require a
combination of horizontal rules and colspans.

Davide P. Cervone

unread,
Feb 3, 2012, 10:23:57 PM2/3/12
to mathja...@googlegroups.com
Excatly. The colspan issue is the one that prevented \cline from
being implemented.

Davide

David Carlisle

unread,
Feb 4, 2012, 4:37:46 PM2/4/12
to mathja...@googlegroups.com
On 31 January 2012 21:05, leathrum <leat...@jsu.edu> wrote:
> If you are talking about tables and arrays in MathJax's TeX/LaTeX
> input syntax, MathJax is somewhat constrained by the fact that
> standard TeX/LaTeX tables and arrays are described using tab stops and
> line breaks, so colspans and rowspans are only possible with nested
> tables.

standard latex tables and arrays support column spanning via
\multicolumn. Row spanning is a bit harder in TeX but the multirow
package provides a de facto standard markup for row spans.

David

Reply all
Reply to author
Forward
0 new messages