[Table of Contents] [docx version]

WordprocessingML Reference Material - Table of Contents

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: Consider a run of text which shall have a double underline explicitly turned on for the contents of the run. This constraint is specified using the following WordprocessingML:

<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. end example]

Parent Elements

rPr2.7.8.1); rPr2.3.1.29); rPr2.5.2.26); rPr2.3.2.25); rPr2.3.2.26); rPr2.7.4.4); rPr2.3.1.30); rPr2.9.26); rPr2.5.2.27); rPr2.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.

 

[Example: Consider a run color with value auto, as follows:

 

<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. end example]

 

The possible values for this attribute are defined by the ST_HexColor simple type2.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.

 

[Example: Consider an underlined run of text whose underline should be displayed using the accent3 theme color from the document’s Theme part. This requirement would be specified as follows in the resulting WordprocessingML:

 

<w:rPr>

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

</w:rPr>

 

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

 

The possible values for this attribute are defined by the ST_ThemeColor simple type2.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.

 

[Example: Consider a shade of 40% applied to a underline in a document. This shade is calculated as follows:

 

 

 

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

 

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

 

[Example: Consider a document with a background using the accent2 theme color, whose RGB value (in RRGGBB hex format) is C0504D.

 

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" />

 

end example]

 

The possible values for this attribute are defined by the ST_UcharHexNumber simple type2.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.

 

[Example: Consider a tint of 60% applied to an underline in a document. This tint is calculated as follows:

 

 

 

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

 

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

 

[Example: Consider a document with a background using the accent2 theme color, whose RGB value (in RRGGBB hex format) is 4F81BD.

 

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" />

 

end example]

 

The possible values for this attribute are defined by the ST_UcharHexNumber simple type2.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.

 

[Example: Consider a run of text which shall have a double underline explicitly turned on for the contents of the run. This constraint is specified using the following WordprocessingML:

 

<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. end example]

 

The possible values for this attribute are defined by the ST_Underline simple type2.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>