Making expressions invisible

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

The mphantom element makes its content invisible while preserving the size and position of the bounding box of its contents. This element is useful for aligning parts of an expression.

For example, in the expression below the x in the numerator is aligned with the x in the denominator if you explicitly add a "+ x²" term enclosed in an mphantom element, in the numerator:

Presentation markup: equation 19

<mfrac>
  <mrow>
    <mn>1</mn><mo>+</mo><mi>x</mi>
    <mphantom>
      <mo>+</mo>
      <msup>
        <mi>x</mi>
        <mn>2</mn>
      </msup>
    </mphantom>
  </mrow>
  <mrow>
    <mn>1</mn><mo>+</mo><mi>x</mi><mo>+</mo>
    <msup>
      <mi>x</mi>
      <mn>2</mn>
    </msup>
  </mrow>
</mfrac>

   

<< back next >>

 

 

 


 

Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.


CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America