mcolumn

Description

mcolumn is typically used to layout numbers that are aligned on each digit.  Because each digit  is aligned, mcolumn has a width that is determined by the maximum number of digits in each child.  If a child of mcolumn is note one of the token elements mi, mn, mo, or  mtext, then that element is considered to be a single digit.  The exceptions to this are mstyle and mrow. The width rule should be applied (recursively) to the child of mstyle.  For mrow, width is the sum of the widths of each child.

Issue:  should mphantom also act as a wrapper for computing digits?  If so, people might be encouraged to use it to play alignment games that make the result not very accessible.

Attributes

In addition to the attributes listed below, this element permits id, xref, class and style attributes, as described in Section 2.4.5 Attributes Shared by all MathML Elements.

Name values default
align (left | right | . | ,) right
shift {int)+ 0

The align attribute specifies whether the column is to be left aligned or right aligned or aligned on a decimal point ("." or "," depending upon the country).

The shift attribute specifies the number of "digits" to shift each line to the right (positive value) or to the left (negative value).  The computation of the left or right edge for alignment is made prior to computing the shift for each line.

Issue:  it might be better to make up a new element whose sole purpose is to specify a shift amount.

 

Examples

    123
  x 321
  -----
    123
   246
  369
  -----
  

 <mcolumn shift='0 0 0 0 1 2'>
   <mn>123</mn>
   <mrow> <mo>&times;</mo> <mn>321</mn> </mrow>
   <mline/>
   <mn>123</mn>
   <mn>246</mn>
   <mn>369</mn>
   <mline/>
</mcolumn>
 

Here is an example of subtraction where there is a borrow with multiple digits in a single column and a cross out. The borrowed amount is underlined (the example is from a Swedish source):

Here is how it can be done with mcolumn:

 <mcolumn>
   <mstyle mathsize='71%'>
     <menclose notation='bottom'> <mn>10</mn> </menclose>
   </mstyle>
   <mrow>
     <menclose notation='updiagonalstrike'> <mn>5</mn> </menclose>
     <mn>2</mn>
   </mrow>
   <mrow> <mo>&minus;</mo> <mn>7</mn> </mrow>
   <mline/>
   <mn>45</mn>
</mcolumn>
 

mline

Description

mline draws a horizontal line inside of a mcolumn element.  mline is only valid a child of mcolumn.  The length of the line is specified as an attribute.

Attributes

In addition to the attributes listed below, this element permits id, xref, class and style attributes, as described in Section 2.4.5 Attributes Shared by all MathML Elements.

Name values default
linethickness number [ v-unit ] | thin | medium | thick 1 (rule thickness)
width int 0

The linethickness attribute specifies how thick the line should be drawn.

The width attribute specifies the number of "digits" that the line span.  The value zero means that the width should be the width of the entire mcolumn.  Note that mline can be shifted just as can other entries in mcolumn, so parital lines can easily be shifted to match the numbers above or below the line.