Setting sticky properties

Sticky properties are set by applying font properties to the individual tokens* in an expression.

In order to accomplish this, select the characters you want to set a property on and then choose 'Font Properties' on the 'Properties' menu. This will pull up the Font Properties dialog box.

Font Properties dialog

*Token element

Recall that in MathML, the elements listed below are considered token elements, that is, the smallest units of mathematical notation which carry meaning. According to the MathML spec, "Tokens are roughly analogous to words in text."

  • identifiers: <mi>
  • numbers: <mn>
  • operators: <mo>
  • text: <mtext>
  • strings: <ms>
  • spacing: <mspace>

There are two ways to control font styles, allowing you to define font type, weight and slant. The first way is to use a ''mathvariant'' attribute, choosing from one of the supported values of that attribute. The second way is to create your own. If you create your own, you can choose the font, weight, and slant from the Manage Custom Font Styles dialog:

Manage Custom Styles dialog

This property allows you to select a specific size for the characters. Valid entries are numerical sizes with units, and the keywords 'small', 'normal' and 'big'. The valid units are as follows:

em — em (font-relative unit traditionally used for horizontal lengths)
ex — ex (font-relative unit traditionally used for vertical lengths)
px — pixels, or pixel size of the current display
in — inches (1 inch = 2.54 centimeters)
cm — centimeters
mm — millimeters
pt — points (1 point = 1/72 inch)
pc — picas (1 pica = 12 points)
% — percentage of default value

These two properties take RGB color values, which consist of three pairs of hexadecimal digits (for example #5599dd) which define proportions of red, green and blue on a scale of 00 through ff (not case-sensitive). Certain named color values can also be used (aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow).

The final radio buttons control whether or not the font properties are sticky or non-sticky for the selected expression. To make the font properties sticky, select the first radio button, Apply to each token element in selection. Select Set as defaults for selected expression to store the settings you've made as the defaults for this expression only.

If the descriptions of those radio buttons seem confusing, remember to key in on the phrase token element, recalling our opening sentence on this page: Sticky properties are set by applying font properties to the individual tokens in an expression. Since the first radio button in this dialog mentions token element, that's the one that sets sticky properties.

As mentioned previously, sticky properties are set on the token elements. This means that they cannot be set on any mathematical constructs like <mfrac>, <mroot> and the like. The following images show what happens when the font color is set on an entire expression using sticky properties and non-sticky properties.

Sticky properties (Apply to each token):

<math>
  <mfrac>
    <msqrt>
      <mn mathcolor='red'>2</mn>
    </msqrt>
    <mn mathcolor='red'>2</mn>
  </mfrac>
</math>

An example of sticky properties

Non-sticky properties (Set as defaults…):

<math>
  <mstyle mathcolor='red'>
    <mfrac>
      <msqrt>
        <mn>2</mn>
      </msqrt>
      <mn>2</mn>
    </mfrac>
  </mstyle>
</math>

An example of non-sticky properties