[Prev][Next][Index][Thread]

Re: indents



[Greg Kostello:]

| Defining the stylist behavior for the first paragraph following a
| headline fulfills a much desired need.

Here's how you would do it in DSSSL:

   (element P
     (make paragraph
       first-line-start-indent: (if (first-sibling?)
				    0pica
				    2pica)))

Notice that this requires no change at all to the document.

| Although, IMHO it doesn't go far enough. Typically, the first and last
| paragraphs in a story may get special treatment, such as different
| indentation on the first paragraph and perhaps a decorative rule (not
| inline) for the last paragraph.

Here you go:

   (element P
     (make paragraph
       first-line-start-indent: (if (first-sibling?)
				    0pica
				    2pica)
       (sosofo-append
	(process-children)
	(if (last-sibling?)
	    (make rule
		  orientation: 'horizontal
		  display-alignment: 'start
		  space-before: 6pt
		  space-after: 6pt
		  line-thickness: 1pt
		  length: 30pica
		  start-indent: (inherited-start-indent))
	   (empty-sosofo)))))

| A different style sheet may produce an altogether different
| look. Still, that may not be sufficient. For example, suppose you want
| to describe every other paragraph as having some special stylistic
| treatment (say a background shade of gray).

How about the "Herb Caen" treatment (every other paragraph in bold)?

   (element P
     (make paragraph
       font-weight: (if (= 0 (modulo (child-number) 2))
			' bold
		      'medium)
   [etc.]

Or did Caen always start with the first paragraph in bold and the
second one in medium?  I can't remember.  Good thing we can change the
treatment around without touching the content, isn't it?

       font-weight: (if (= 1 (modulo (child-number) 2))
			' bold
		      'medium)

| I think we need a way of specifying style as applying to a pattern in
| a sequence of elements. Opinions?

What a great idea.  :-)

Jon


Follow-Ups: References: