Stephen
Stephen

Reputation: 113

MathML: Left Adjust Equation Numbers in Table of Equations

I want to have each of the equation numbers in the following code snippet left adjusted while the corresponding equations "X" and "Y" be centered in the browser window. I am at a loss as how to do this.

<mml:math mode="display" display="block">
 <mml:mtable>    
   <mtable side='left'>
     <mlabeledtr>
       <mtd><mtext>(1)</mtext></mtd>            
         <mml:mi>X</mml:mi>                    
     </mlabeledtr>
   </mtable>
     <mml:mtr>            
       <mtable side='left'>
         <mlabeledtr>
           <mtd><mtext>(2)</mtext></mtd>                      
           <mml:mi>Y</mml:mi>
         </mlabeledtr>
       </mtable>                           
     </mml:mtr>
 </mml:mtable>

The image below shows the result of the code above. What I don't want - everything is left aligned. Just the equations "X" and "Y" should be centered.

enter image description here

The MathML code is an edited version of that generated by Export: TeX -> XHTML in Scientific Word. I include a script that calls mathjax to properly render the code in all browsers

Because this is my first visit to this site, let me know if I haven't provided sufficient information for someone to answer by query.

Upvotes: 1

Views: 717

Answers (1)

Peter Krautzberger
Peter Krautzberger

Reputation: 5305

This is the expected result of the input. While you're omitting them, this fragment will be interpreted as a table with two rows, each row having one column containing another table. The outer table cells will cause shrink-wrapping their contents, making the (usually applied) 100% width of the inner tables void.

The following should work with MathJax (though you helped me spot this bug -- thanks.)

<math display="block">
    <mtable side='left'>
        <mlabeledtr>
            <mtd>
                <mtext>(1)</mtext>
            </mtd>
            <mtd>
                <mi>X</mi>
            </mtd>
        </mlabeledtr>
        <mlabeledtr>
            <mtd>
                <mtext>(2)</mtext>
            </mtd>
            <mtd>
                <mi>Y</mi>
            </mtd>
        </mlabeledtr>
    </mtable>
</math>

Upvotes: 3

Related Questions