(Excerpt from "The MathML Handbook" by Pavi Sandhu)
The mpadded element provides a way to add extra space or "padding" around its content. It works by modifying the apparent size and position of the bounding box in which its content is rendered. The bounding box of the content is surrounded by an extra bounding box. The attributes of the mpadded element determine the size and position of this extra box.
The mpadded element has four attributes:
- width: determines the horizontal length of the bounding box. The bounding box of the mpadded element is rendered flush left with the bounding box of its contents. Hence, when you increase the width, you add space to the right of the box’s contents.
- lspace: specifies the amount of space between the left edge of the bounding box and the left edge of the bounding box of its contents.
- height: specifies the vertical space between the baseline of the contents (the line along the bottom of most letter glyphs in normal text rendering) and the top of the bounding box of the mpadded element.
- depth: specifies the vertical space between the baseline of the contents and the bottom of the bounding box of the mpadded element.
You can specify each of these attributes in several different ways: as a number followed by a unit, as a percentage, or as a multiple of the default value or a named space. Here are some examples of the mpadded element that show different ways of specifying the attribute values:
<mpadded width="+0em"> ... </mpadded> <mpadded width="+75%"> ... </mpadded> <mpadded width="100%"> ... </mpadded> <mpadded width="1.0 width"> ... </mpadded>
Each attribute value can take positive or negative values. You can use negative values of the attributes to fake the appearance of certain characters. For example, the open-face R character used to represent the set of all real numbers would normally be indicated using the character entity reference, as shown below:
Alternatively, you could use the named entity reference for this character, ℝ. However, on a system where the appropriate font to display the open-face character is not available, you could approximate the appearance of this character using the following markup:
However, this type of markup alters the meaning of the expression and hinders its interpretation by audio renderers and computer algebra systems. Hence, MathML specifically discourages the use of spacing to convey meaning.
|<< 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