<u> (Underline)

This element specifies that the contents of this run should be displayed along with an underline appearing directly below the character height (less all spacing above and below the characters on the line).

If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then an underline shall not be applied to the contents of this run.

example:
<w:rPr>
  <w:u w:val="double"/>
</w:rPr>

This run explicitly declares an underline using the <u> property. The @val of that underline is double, so the style of the underline on this run shall be a double line. ]

Parent Elements

<rPr>2.7.8.1); <rPr>2.3.1.29); <rPr>2.5.2.26); <rPr>2.3.2.25); <rPr>2.3.2.26); <rPr>2.7.4.4); <rPr>2.3.1.30); <rPr>2.9.26); <rPr>2.5.2.27); <rPr>2.7.5.2)

Attributes

Description

<color> (Underline Color)

Specifies the color for the underlining on this run.

This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the underline color as appropriate.

If the underline specifies the use of a theme color via the @themeColor attribute, then this value is superseded by the theme color value.

<w:rPr>
  <w:un  w:color="auto" />
</w:rPr>

This color therefore may be automatically be modified by a consumer as appropriate, for example, in order to ensure that the underline can be distinguished against the page's background color. ]

The possible values for this attribute are defined by the ST_HexColor simple type (§2.18.43).

<themeColor> (Underline Theme Color)

Specifies a theme color which should be applied to the current underline.

The specified theme color is a reference to one of the predefined theme colors, located in the document's Theme part,which allows for color information to be set centrally in the document.

If the @themeColor attribute is specified, then the @color attribute is ignored for this underline.

<w:rPr>
  <w:u  w:themeColor=”accent3” />
</w:rPr>

The @themeColor attribute specifies that the underline shall use the accent3 theme color. ]

The possible values for this attribute are defined by the ST_ThemeColor simple type (§2.18.104).

<themeShade> (Underline Theme Color Shade)

Specifies the shade value applied to the supplied theme color (if any) for this underline.

If the @themeShade is supplied, then it is applied to the RGB value of the theme color to determine the final color applied to this underline.

The @themeShade value is stored as a hex encoding of the shade value (from 0 to 255) applied to the current border.

The resulting @themeShade value in the file format would be 66. ]

Given an RGB color defined as three hex values in RRGGBB format, the shade is applied as follows:

  • Convert the color to the HSL color format (values from 0 to 1)

  • Modify the luminance factor as follows:

  • Convert the resultant HSL color to RGB

The equivalent HSL color value would be.

Applying the shade formula with a shade percentage of 75% to the luminance, we get:

Taking the resulting HSL color value of and converting back to RGB, we get 943634.

This transformed value can be seen in the resulting underline's @color attribute:

<w:u w:color="943634" w:themeColor="accent2" w:themeShade="BF" />

The possible values for this attribute are defined by the ST_UcharHexNumber simple type (§2.18.106).

<themeTint> (Underline Theme Color Tint)

Specifies the tint value applied to the supplied theme color (if any) for this underline's contents.

If the @themeTint is supplied, then it is applied to the RGB value of the theme color to determine the final color applied to this run.

The @themeTint value is stored as a hex encoding of the tint value (from 0 to 255) applied to the current border.

The resulting @themeTint value in the file format would be 99. ]

Given an RGB color defined as three hex values in RRGGBB format, the shade is applied as follows:

  • Convert the color to the HSL color format (values from 0 to 1)

  • Modify the luminance factor as follows:

  • Convert the resultant HSL color to RGB

The equivalent HSL color value would be.

Applying the tint formula with a tint percentage of 60% to the luminance, we get:

Taking the resulting HSL color value of and converting back to RGB, we get 95B3D7.

This transformed value can be seen in the resulting underline formatting's WordprocessingML @color attribute:

<w:u  w:color="95B3D7" w:themeColor="accent2" w:themeTint="99" />

The possible values for this attribute are defined by the ST_UcharHexNumber simple type (§2.18.106).

<val> (Underline Style)

Specifies the pattern which shall be used to create the underline applied beneath the text in this run.

Each of these possible patterns are shown in the simple type referenced below.

<w:rPr>
  <w:u w:val="double"/>
</w:rPr>

The @val of the underline on this run is double, so the style of the underline on this run shall be a double line. ]

The possible values for this attribute are defined by the ST_Underline simple type (§2.18.107).

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_Underline">
	<attribute name="val" type="ST_Underline" use="optional"/>
	<attribute name="color" type="ST_HexColor" use="optional"/>
	<attribute name="themeColor" type="ST_ThemeColor" use="optional"/>
	<attribute name="themeTint" type="ST_UcharHexNumber" use="optional"/>
	<attribute name="themeShade" type="ST_UcharHexNumber" use="optional"/>
</complexType>