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?)

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?)
	(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))

| 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

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

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

What a great idea.  :-)


Follow-Ups: References: