Re: Getting a NewLine

Subject: Re: Getting a NewLine
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Wed, 22 Apr 1998 18:09:05 -0400 (EDT)
 > And in this case...much better.  I used the procedure to specify the
 > processing of paragraphs (<P></P>) and it solved the problem of too much
 > space between lines when trying my line break.  I can't say I'mm 100%
 > sure what it's doing, but thanks very much!!

You're the second person who has said that they didn't understand it.
I hope the following does more than muddy the waters.

For the document:
------------------------------------------------------------
<!DOCTYPE book [
<!--                    BOOK                                       -->
<!ELEMENT  book         - - (para+)                                  >


<!--                    PARAGRAPH                                  -->
<!ELEMENT  para         - - (#PCDATA | lb)*                          >


<!--                    LINE BREAK                                 -->
<!ELEMENT  lb           - o EMPTY                                    >
]>
<book>
<para>Really long sentence just to prove that we can wrap to another
line and see what the first line start indent does for us and what</para>
<para>the effect is of inserting a line break.</para>
<para>Really long sentence just to prove that we can wrap to another
line and see what the first line start indent does for us and
what<lb>the effect is of inserting a line break.</para>
</book>
------------------------------------------------------------

the following stylesheet produces the same results for the first and
second paragraphs in combination as it does for the third paragraph
containing the <lb> element.

------------------------------------------------------------
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

;; Picas
(define-unit pi (/ 1in 6))

;; Points
(define-unit pt (/ 1in 72))

;; Paragraph
(element PARA
	 (make paragraph
	       min-leading: 16pt
	       first-line-start-indent: 2pi
	       space-before: 6pt
	       space-after: 12pt))

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

The paragraph-break flow object made the third <para> functionally
equivalent to two paragraphs, down to the space-before, space-after,
and first-line-start-indent characteristics.

This works well if you want to represent a sequence of paragraphs, but
not so well when you want to implement a line break.  The following
stylesheet allows <lb> to function as a line break:

------------------------------------------------------------
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

;; Picas
(define-unit pi (/ 1in 6))

;; Points
(define-unit pt (/ 1in 72))

;; Paragraph
(element PARA
	 (make display-group
	       min-leading: 16pt
	       first-line-start-indent: 2pi
	       space-before: 6pt
	       space-after: 12pt
	       (make paragraph)))

;; Line break
(element LB
	 (make paragraph-break
	       first-line-start-indent: (actual-start-indent)))
------------------------------------------------------------

The space-before and space-after characteristics are specified for the
display-group enclosing the paragraph flow object, and the
space-before and space-after characteristics of the paragraph flow
object default to no space before and no space after, respectively.
The paragraph-break flow object inherits these values, and the <lb>
element doesn't add any unwanted vertical space.

The specification for the first-line-start-indent characteristic of
the paragraph-break flow object overrides what would have been
inherited from the enclosing display-group flow object.

The following stylesheet would appear to have the same effect but
doesn't because the 12pt space-after of the first part of the
paragraph wins out over the 0pt space-before of the second part of the
paragraph.

------------------------------------------------------------
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

;; Picas
(define-unit pi (/ 1in 6))

;; Points
(define-unit pt (/ 1in 72))

;; Paragraph
(element PARA
	 (make paragraph
	       min-leading: 16pt
	       first-line-start-indent: 2pi
	       space-before: 6pt
	       space-after: 12pt))

;; Line break
(element LB
	 (make paragraph-break
	       first-line-start-indent: (actual-start-indent)
	       space-before: 0pt
	       space-after: 0pt))
------------------------------------------------------------

Regards,


Tony Graham
=======================================================================
Tony Graham
Mulberry Technologies, Inc.                         Phone: 301-315-9632
17 West Jefferson Street, Suite 207                 Fax:   301-315-8285
Rockville, MD USA 20850                 email: tgraham@xxxxxxxxxxxxxxxx
=======================================================================


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Re: Getting a NewLine, (continued)
      • Tom Boudreau - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA11076Wed, 22 Apr 1998 10:38:36 -0400 (EDT)
        • Tom Boudreau - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA11300Wed, 22 Apr 1998 10:52:28 -0400 (EDT)
      • Tony Graham - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id LAA11923Wed, 22 Apr 1998 11:27:48 -0400 (EDT)
        • Chuck Darney - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id PAA14754Wed, 22 Apr 1998 15:47:26 -0400 (EDT)
        • Tony Graham - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id SAA16645Wed, 22 Apr 1998 18:13:05 -0400 (EDT) <=