Defines the ContextualSpacing Class. When the object is serialized out as xml, its qualified name is w:contextualSpacing.
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
[ISO/IEC 29500-1 1st Edition]
contextualSpacing (Ignore Spacing Above and Below When Using Identical Styles)
This element specifies that any space specified before or after this paragraph, specified using the spacing element (§18.104.22.168), should not be applied when the preceding and following paragraphs are of the same paragraph style, affecting the top and bottom spacing respectively. [Example: This value is typically used for paragraphs in lists, in which any space between subsequent list items, even if inherited from another style, is not desirable. end example]
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 spacing is not ignored. If it is present, then the spacing above or below on this paragraph is subtracted from the spacing which would have been present if contextual spacing was off, never going below zero.
[Example: Consider two paragraphs defined as follows:
<w:p> <w:pPr> <w:pStyle w:val="TestParagraphStyle" /> <w:spacing w:after="200"/> <w:contextualSpacing/> </w:pPr> … </w:p> <w:p> <w:pPr> <w:pStyle w:val="TestParagraphStyle" /> <w:spacing w:before="240"/> </w:pPr> … </w:p>
The first paragraph specifies a spacing after of 10 points, and the second paragraph specifies a spacing before of 12 points, therefore according to the rules on the spacing element, the net paragraph spacing should be 12 points. However, since the first paragraph specifies that its spacing should be omitted between paragraphs of the same style, and the two paragraphs use the same TestParagraphStyle, that value is subtracted from the total, therefore the paragraphs are spaced by 2 points. end example]
pPr (§22.214.171.124); pPr (§126.96.36.199); pPr (§188.8.131.52); pPr (§184.108.40.206); pPr (§17.9.23); pPr (§220.127.116.11)
This element’s content model is defined by the common boolean property definition in §17.17.4.
© ISO/IEC29500: 2008.