oXygen XML Editor

Line break

Line Break

Tony Graham

To force a newline in a paragraph with the same spacing as if the text had wrapped at the end of the line, use the paragraph-break flow object class.

A paragraph-break flow object is allowed only in paragraph flow objects, and, unfortunately for its use in making a “line break”, all the characteristics of the containing paragraph flow object, including the otherwise non-inherited space-before and space-after characteristics, are inherited by a paragraph-break flow object.

Using a paragraph-break flow object to implement a line break therefore requires that the enclosing paragraph flow object has no specification for its space-before and space-after characteristics. A technique that allows a chunk of formatted text to still have space before and after it is to enclose the paragraph flow object within a display-group flow object and specify the space-before and space-after characteristics on the display-group so they're not “inherited” from the paragraph by the paragraph-break.

For the markup:

<chapter>
<title>Watch me<lb>split</title>

the following element construction rules will format the chapter title as:


Watch me
 split

;; Chapter title
(element (CHAPTER TITLE)
	 (make display-group
               quadding: 'center
	       keep-with-next?: #t
	       min-leading: 16pt
	       space-before: 0pt
	       space-after: 12pt
	       (make paragraph)))

;; Line break
(element LB
	 (make paragraph-break))