XML-Technologien / MathML / Presentation markup / General layout elements / Padding expressions

(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:

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:

ℝ

<mi>&#x211D;</mi>

Alternatively, you could use the named entity reference for this character, &Ropf;. 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:

<mrow>
  <mpadded width="0"> <mi>R</mi> </mpadded>
  <mspace width="0.3em"/>
  <mtext>|</mtext>
</mrow>

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.

   

 

 

 

 

nach oben