This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [docbook] Clean way to insert a "pause" between blocks of paragraphs?


--- "James J. Ramsey" <jjramsey_6x9eq42 at yahoo dot com>
wrote:
> I created a stylesheet with the following content:
> 
> <?xml version='1.0'?>
> <xsl:stylesheet 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>                 
> xmlns:fo="http://www.w3.org/1999/XSL/Format";
>                  version="1.0">
> 
> <xsl:import
>
href="file:///usr/share/sgml/docbook/xsl-stylesheets/fo/docbook.xsl"/>
> 
> <xsl:template
>
match="processing-instruction('jjfo')[contains(.,'pause')]">
>    <fo:block font-size="12pt"
>        text-align="center"
>        space-before="12pt"
>        keep-with-previous="always">
>    </fo:block>
> </xsl:template>
> 
-- snip ---
> 
> The result looks kind of ugly because the Docbook
> XSL
> stylesheet distiguishes paragraphs with blank lines
> instead of indenting by default, but it's a start.

The following stylesheet looks *much* better, IMHO:

<?xml version='1.0'?>
<xsl:stylesheet 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                
xmlns:fo="http://www.w3.org/1999/XSL/Format";
                 version="1.0">

<xsl:import
href="file:///usr/share/sgml/docbook/xsl-stylesheets/fo/docbook.xsl"/>

<xsl:template
match="processing-instruction('jjfo')[contains(.,'pause')]">
   <fo:block font-size="12pt"
       text-align="center"
       space-before="6pt"
       keep-with-previous="always">
    . . .
   </fo:block>
</xsl:template>

</xsl:stylesheet>

With paragraphs demarked by blank lines instead of
indentation, the three centered periods work better
than just blank space. The tricky part is making sure
the spacing above is about the same as the spacing
below, since the periods obviously have about 12
points of space on top of them. Setting the
"space-before" attribute to 6 points seems to keep the
periods centered between paragraphs, although I'm not
sure of the details of why it works out that way.


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscribe at lists dot oasis-open dot org
For additional commands, e-mail: docbook-help at lists dot oasis-open dot org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]