[Table of Contents] [docx version]

WordprocessingML Reference Material - Table of Contents

spacing (Spacing Between Lines and Above/Below Paragraph)

This element specifies the inter-line and inter-paragraph spacing which shall be applied to the contents of this paragraph when it is displayed by a consumer.

If this element is omitted on a given paragraph, each of its values is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then the paragraph shall have no spacing applied to its lines, or above and below its contents.

[Example: Consider the following WordprocessingML paragraph:

<w:pPr>

<w:spacing w:after="200" w:line="276" w:lineRule="auto" />

</w:pPr>

This paragraph specifies that it shall have at least 200 twentieths of a point after the last line in each paragraph, and that the spacing in each line should be automatically calculated based on a 1.15 times (276 divided by 240) the normal single spacing calculation. end example]

When determining the spacing between any two paragraphs, a consumer shall use the maximum of the inter-line spacing in each paragraph, the spacing after the first paragraph and the spacing before the second paragraph to determine the net spacing between the paragraphs.

[Example: Consider two consecutive single-spaced paragraphs in a document, the first of which specifies spacing below of 12 points, the second of which specifies spacing above of 4 points. These constraints are expressed using the following WordprocessingML:

<w:p>

<w:pPr>

<w:spacing w:after="240" />

</w:pPr>

</w:p>

<w:p>

<w:pPr>

<w:spacing w:before="80" />

</w:pPr>

</w:p>

The resulting spacing between the first and second paragraph will be 12 points, since that is the largest spacing requested between the two paragraphs. end example]

Parent Elements

pPr2.7.4.2); pPr2.9.24); pPr2.3.1.25); pPr2.7.5.1); pPr2.3.1.26); pPr2.7.7.2)

 

Attributes

Description

after (Spacing Below Paragraph)

Specifies the spacing that should be added after the last line in this paragraph in the document in absolute units.

 

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then the paragraph shall have no spacing applied below its contents.

 

If the afterLines attribute or the afterAutoSpacing attribute is also specified, then this attribute value is ignored.

 

[Example: Consider the following WordprocessingML paragraph:

 

<w:p>

<w:pPr>

<w:spacing w:after="240" />

</w:pPr>

</w:p>

 

This paragraph shall have a minimum spacing below its final lines of 240 twentieths of a point, although the actual spacing may be determined by the inter-line spacing or the spacing above the following paragraph, if either are greater. end example]

 

The possible values for this attribute are defined by the ST_TwipsMeasure simple type2.18.105).

afterAutospacing (Automatically Determine Spacing Below Paragraph)

Specifies whether a consumer shall automatically determine the spacing after this paragraph based on its contents.

 

This automatic spacing shall match the spacing which would be applied to the paragraph in an HTML document where no explicit spacing before/after is specified.

 

If this attribute is specified, then any value in after or afterLines is ignored, and the spacing is automatically determined by the consumer.

 

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then automatic spacing is turned off (not applied).

 

[Example: Consider a paragraph in a document whose spacing below shall automatically be determined by the consumer based on the paragraph's contents. This constraint would be specified by the following WordprocessingML:

 

<w:pPr>

<w:spacing .. w:afterAutospacing="on" />

</w:pPr>

 

The resulting paragraph shall have the spacing below its last line determined automatically by the consumer to match an HTML document as specified. end example]

 

The possible values for this attribute are defined by the ST_OnOff simple type2.18.67).

afterLines (Spacing Below Paragraph in Line Units)

Specifies the spacing that should be added after the last line in this paragraph in the document in line units.

 

The value of this attribute is specified in one hundredths of a line.

 

If the afterAutoSpacing attribute is also specified, then this attribute value is ignored. If this setting is never specified in the style hierarchy, then its value shall be zero (if needed).

 

[Example: Consider the following WordprocessingML paragraph:

 

<w:p>

<w:pPr>

<w:spacing w:afterLines="300" />

</w:pPr>

...

</w:p>

 

This paragraph shall have a minimum spacing below its final lines of 3 lines, although the actual spacing may be determined by the inter-line spacing or the spacing above the following paragraph, if either are greater. end example]

 

The possible values for this attribute are defined by the ST_DecimalNumber simple type2.18.16).

before (Spacing Above Paragraph)

Specifies the spacing that should be added above the first line in this paragraph in the document in absolute units.

 

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then the paragraph shall have no spacing applied above its contents.

 

If the beforeLines attribute or the beforeAutoSpacing attribute is also specified, then this attribute value is ignored.

 

[Example: Consider the following WordprocessingML paragraph:

 

<w:p>

<w:pPr>

<w:spacing w:before="80" />

</w:pPr>

...

</w:p>

 

This paragraph shall have a minimum spacing above its first line of 80 twentieths of a point, although the actual spacing may be determined by the inter-line spacing or the spacing below the last line in the preceding paragraph, if either are greater. end example]

 

The possible values for this attribute are defined by the ST_TwipsMeasure simple type2.18.105).

beforeAutospacing (Automatically Determine Spacing Above Paragraph)

Specifies whether a consumer shall automatically determine the spacing before this paragraph based on its contents.

 

This automatic spacing shall match the spacing which would be applied to the paragraph in an HTML document where no explicit spacing before/after is specified.

 

If this attribute is specified, then any value in before or beforeLines is ignored, and the spacing is automatically determined by the consumer.

 

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then automatic spacing is turned off (not applied).

 

[Example: Consider a paragraph in a document whose spacing above shall automatically be determined by the consumer based on the paragraph's contents. This constraint would be specified by the following WordprocessingML:

 

<w:pPr>

<w:spacing … w:beforeAutospacing="on" />

</w:pPr>

 

The resulting paragraph shall have the spacing above its first line determined automatically by the consumer to match an HTML document as specified. end example]

 

The possible values for this attribute are defined by the ST_OnOff simple type2.18.67).

beforeLines (Spacing Above Paragraph IN Line Units)

Specifies the spacing that should be added before the first line in this paragraph in the document in line units.

 

The value of this attribute is specified in one hundredths of a line.

 

If the beforeAutoSpacing attribute is also specified, then this attribute value is ignored. If this setting is never specified in the style hierarchy, then its value shall be zero (if needed).

 

[Example: Consider the following WordprocessingML paragraph:

 

<w:p>

<w:pPr>

<w:spacing w:beforeLines="100" />

</w:pPr>

...

</w:p>

 

This paragraph shall have a minimum spacing above its first line of 1 line, although the actual spacing may be determined by the inter-line spacing or the spacing below the preceding paragraph, if either are greater. end example]

 

The possible values for this attribute are defined by the ST_DecimalNumber simple type2.18.16).

line (Spacing Between Lines in Paragraph)

This attribute specifies the amount of vertical spacing between lines of text within this paragraph.

 

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then no line spacing shall be applied to lines within this paragraph.

 

If the value of the lineRule attribute is either atLeast or exactly, then the value of this attribute shall be interpreted as twentieths of a point. When the value of the lineRule attribute is either exactly, the text shall be positioned as follows within that line height:

When the line height is too small, the text shall be positioned at the bottom of the line (i.e. clipped from the top down)

When the line height is too large, the text shall be centered in the available space.

 

If the value of the lineRule attribute is auto, then the value of the line attribute shall be interpreted as 240ths of a line, in the manner described by the simple type's values.

 

[Example: Consider the following WordprocessingML paragraph which should have an inter-line spacing of 1.15 times the line height. This constraint would be specified using the following WordprocessingML:

 

<w:pPr>

<w:spacing w:line="276" w:lineRule="auto" />

</w:pPr>

 

The lineRule attribute value of auto specifies that the value of the line attribute is to be interpreted in 240ths of a single line height, which means that the net spacing is 276/240ths of a line or 1.15 lines tall. end example]

 

The possible values for this attribute are defined by the ST_SignedTwipsMeasure simple type2.18.88).

lineRule (Type of Spacing Between Lines)

Specifies how the spacing between lines is calculated as stored in the line attribute.

 

If this attribute is omitted, then it shall be assumed to be of a value auto if a line attribute value is present.

 

If the value of this attribute is either atLeast or exactly, then the value of the line attribute shall be interpreted as twentieths of a point, in the manner described by the simple type's values.

 

If the value of this attribute is auto, then the value of the line attribute shall be interpreted as 240ths of a line, in the manner described by the simple type's values.

 

[Example: Consider the following WordprocessingML paragraph which should have an inter-line spacing of 1.15 times the line height. This constraint would be specified using the following WordprocessingML:

 

<w:pPr>

<w:spacing w:line="276" w:lineRule="auto" />

</w:pPr>

 

The lineRule attribute value of auto specifies that the value of the line attribute is to be interpreted in 240ths of a single line height. end example]

 

The possible values for this attribute are defined by the ST_LineSpacingRule simple type2.18.55).

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

<complexType name="CT_Spacing">

   <attribute name="before" type="ST_TwipsMeasure" use="optional"/>

   <attribute name="beforeLines" type="ST_DecimalNumber" use="optional"/>

   <attribute name="beforeAutospacing" type="ST_OnOff" use="optional"/>

   <attribute name="after" type="ST_TwipsMeasure" use="optional"/>

   <attribute name="afterLines" type="ST_DecimalNumber" use="optional"/>

   <attribute name="afterAutospacing" type="ST_OnOff" use="optional"/>

   <attribute name="line" type="ST_SignedTwipsMeasure" use="optional"/>

   <attribute name="lineRule" type="ST_LineSpacingRule" use="optional"/>

</complexType>