MathML Fundamentals - Stacks of Characters mstack

Mstack is used to lay out rows of numbers that are aligned on each digit. The children of an mstack represent rows, or groups of them, to be stacked each below the previous row; there can be any number of rows. An msrow represents a row; an msgroup groups a set of rows together so that their horizontal alignment can be adjusted together; an mscarries represents a set of carries to be applied to the following row; an msline represents a line separating rows. Any other element is treated as if implicitly surrounded by msrow. MathML Fundamentals

Mstack examples 133 ×321 123 246 369 133EE ×321A 123 246 369 1 12 3 45 2,327 - 1,156 1,171 + 1 12 3 45 2,327 - 1,156 1,171 + 1 12 3 45 2,327 - 1,156 1,171 + 1 12 3 45 2,327 - 1,156 1,171 + 1 12 3 45 2,327 - 1,156 1,171 + 1 12 3 45 2,327 - 1,156 1,171 + 1 1 1 1 2,327 - 1,156 1,171 + 1 1 1 1 2,327 - 1,156 1,171 + 1 1 1 1 2,327 - 1,156 1,171 11 11 1,234 ×4,321 1 1 1 1 1 1,234 24,68 370,2 4,936 5,332,114 0.3333 0.142857 0.142857 . . 0.142857

MathML

<math >
	<mspace linebreak="newline" indentalign="center"></mspace>
	<mtext style="border:1px;" mathsize="50">Mstack examples</mtext>

	<mspace linebreak="newline" indentalign="center"></mspace>
	<mrow style="border:1px;margin:5px"  axis="true" >
		<mstack style="border:1px;margin:3px">
		  <msgroup>
		    <mn>133</mn>
		    <msrow><mo>×</mo><mn>321</mn></msrow>
		  </msgroup>
		  <msline/>
		  <msgroup shift="1">
		    <mn>123</mn>
		    <mn>246</mn>
		    <mn>369</mn>
		  </msgroup>
		  <msline/>
		</mstack>
	</mrow>
	<mrow style="border:1px;margin:5px"  axis="true" >
		<mstack style="border:1px;margin:3px">
		  <msgroup>
		    <mn>133EE</mn>
		    <msrow><mo>×</mo><mn>321A</mn></msrow>
		  </msgroup>
		  <msline/>
		  <msgroup shift="1">
		    <mn>123</mn>
		    <mn>246</mn>
		    <mn>369</mn>
		  </msgroup>
		  <msline/>
		</mstack>
	</mrow>
	
	<mspace linebreak="newline" indentalign="center"></mspace>
	<mrow style="border:1px;margin:5px"  axis="true" >
		<mstack style="border:1px;margin:3px" charspacing="medium">
		  <mscarries crossout='updiagonalstrike'>
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>12</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>3</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>45</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>

		<mo>+</mo>
		<mstack style="border:1px;margin:3px" charspacing="medium">
		  <mscarries crossout='updiagonalstrike' location="n">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>12</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>3</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>45</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	
			
		<mo>+</mo>
		<mstack style="border:1px;margin:3px" charspacing="medium">
		  <mscarries crossout='updiagonalstrike' location="ne">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>12</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>3</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>45</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	

		<mo>+</mo>
		<mstack style="border:1px;margin:3px" charspacing="medium">
		  <mscarries crossout='updiagonalstrike' location="e">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>12</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>3</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>45</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	


		<mo>+</mo>
		<mstack style="border:1px;margin:3px"  charspacing="medium">
		  <mscarries crossout='updiagonalstrike' location="se">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>12</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>3</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>45</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	


		<mo>+</mo>
		<mstack style="border:1px;margin:3px">
		  <mscarries crossout='updiagonalstrike' location="s">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>12</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>3</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>45</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	


		<mo>+</mo>
		<mstack style="border:1px;margin:3px">
		  <mscarries crossout='updiagonalstrike' location="sw">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>1</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>1</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	


		<mo>+</mo>
		<mstack style="border:1px;margin:3px">
		  <mscarries crossout='updiagonalstrike' location="w">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>1</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>1</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	

		<mo>+</mo>
		<mstack style="border:1px;margin:3px">
		  <mscarries crossout='updiagonalstrike' location="nw">
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>1</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mscarries crossout='updiagonalstrike'>
		    <mn>1</mn>  
		    <mscarry crossout='updiagonalstrike downdiagonalstrike verticalstrike horizontalstrike'><mn>1</mn></mscarry>  
		    <mscarry crossout='none'> <none/> </mscarry>
		  </mscarries>
		  <mn>2,327</mn>
		  <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
		  <msline/>
		  <mn>1,171</mn>
		</mstack>	
	</mrow>

	<mspace linebreak="newline" indentalign="center"></mspace>
	<mrow style="border:1px;margin:5px"  axis="true" >
		<mstack style="border:1px;margin:3px">
		  <mscarries><mn>1</mn><mn>1</mn><none/></mscarries>
		  <mscarries><mn>1</mn><mn>1</mn><none/></mscarries>
		  <mn>1,234</mn>
		  <msrow><mo>×</mo><mn>4,321</mn></msrow>
		  <msline/>

		  <mscarries position='2'>
		    <mn>1</mn>
		    <none/>
		    <mn>1</mn>
		    <mn>1</mn>
		    <mn>1</mn>
		    <none/>
		    <mn>1</mn>
		  </mscarries>
		  <msgroup shift="1">
		    <mn>1,234</mn>
		    <mn>24,68</mn>
		    <mn>370,2</mn>
		    <msrow position="1"> <mn>4,936</mn> </msrow>
		  </msgroup>
		  <msline/>

		  <mn>5,332,114</mn>
		</mstack>	
	</mrow>
	
	<mspace linebreak="newline" indentalign="center"></mspace>
	<mrow style="border:1px;padding:5px"  axis="true" >
		<mstack stackalign="right">
		  <msline length="1"/>
		  <mn> 0.3333 </mn>
		</mstack>
	</mrow>
	<mrow style="border:1px;padding:5px"  axis="true" >
		<mstack stackalign="right">
		  <msline length="6"/>
		  <mn> 0.142857 </mn>
		</mstack>
	</mrow>
	<mrow style="border:1px;padding:5px"  axis="true" >
		<mstack stackalign="right">
		  <mn> 0.142857 </mn>
		  <msline length="6"/>
		</mstack>
	</mrow>
	<mrow style="border:1px;padding:5px"  axis="true" >
		<mstack stackalign="right" charalign="center">
		  <msrow> <mo>.</mo> <none/><none/><none/><none/> <mo>.</mo> </msrow>
		  <mn> 0.142857 </mn>
		</mstack>
	</mrow>
	
</math>