<keepNext> (Keep Paragraph With Next Paragraph)

This element specifies that when rendering this document in a paginated view, the contents of this paragraph are at least partly rendered on the same page as the following paragraph whenever possible.

This means that if the contents of the current paragraph would normally be completely rendered on a different page than the following paragraph (because only one of the two paragraphs would fit on the remaining space on the first page), then both paragraphs shall be rendered on a single page. This property can be chained between multiple paragraphs to ensure that all paragraphs are rendered on a single page without any intervening page boundaries. If this is not possible the entire set of paragraphs that are grouped together using this property would exceed a single page in any case, then the set of "keep with next" paragraphs shall start on a new page, with page breaks as needed afterwards.

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 this property shall not be applied.

example:

As shown above, the second paragraph and third paragraph are being rendered on two separate pages. However, a producer can specify that the second paragraph should not be displayed without any part of the third by setting the <keepNext> element as follows:

<w:pPr>
  <w:keepNext/>
  ...
</w:pPr>

This would ensure that the second paragraph is displayed on the same page as the third paragraph:

However, if the first paragraph was also set to <keepNext>, then this set of grouped paragraphs would exceed a page, therefore the set of paragraphs would be grouped and start on the first page, resulting in the second paragraph reappearing on page one:

Since the paragraphs cannot all be put on one page, they all start on page one and flow as needed. ]

Parent Elements

<pPr>2.7.4.2); <pPr>2.9.24); <pPr>2.3.1.25); <pPr>2.7.5.1); <pPr>2.3.1.26); <pPr>2.7.7.2)

Attributes

Description

<val> (On/Off Value)

Specifies a binary value for the property defined by the parent XML element.

A value of on, 1, or true specifies that the property shall be explicitly applied. This is the default value for this attribute, and is implied when the parent element is present, but this attribute is omitted.

A value of off, 0, or false specifies that the property shall be explicitly turned off.

<w:… w:val="off"/>

The @val attribute explicitly declares that the property is turned off. ]

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

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

<complexType name="CT_OnOff">
	<attribute name="val" type="ST_OnOff"/>
</complexType>