[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: AW: [docbook-apps] Re:[docbook-apps] adminitions - notes - line break after "Note"
Thanks a lot, this worked like a charm. I now have a note like that: ---------------------------------- (line) Note text text text text text text text text text text text text text text text text text ---------------------------------- Looks very cool. Code is: <xsl:template name="nongraphical.admonition"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:choose> <xsl:when test="child::*[1]/self::para"> <fo:block space-before.minimum="0.6em" space-before.optimum="0.8em" space-before.maximum="1.0em" start-indent="0.25in" end-indent="0.25in" border-top="0.5pt solid black" border-bottom="0.5pt solid black" padding-top="4pt" padding-bottom="4pt" id="{$id}" xsl:use-attribute-sets="nongraphical.admonition.properties"> <fo:block> <fo:inline font-size = "10pt" font-weight = "bold" font-family = "sans-serif" hyphenate = "false" keep-with-next.within-line='always' xsl:use-attribute-sets="admonition.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> <xsl:text>: </xsl:text> </fo:inline> <xsl:apply-templates select="para[1]/node()"/> </fo:block> <xsl:apply-templates select="*[not(self::para[1])]"/> </fo:block> </xsl:when> <xsl:otherwise> <xsl:apply-imports/> </xsl:otherwise> </xsl:choose> </xsl:template> Hinrich -----Ursprüngliche Nachricht----- Von: Bob Stayton [mailto:bobs@sagehill.net] Gesendet: Montag, 18. Dezember 2006 18:27 An: Hinrich Aue; 'Sean Wheller' Cc: docbook-apps@lists.oasis-open.org Betreff: [docbook-apps] Re:[docbook-apps] adminitions - notes - line break after "Note" The object.title.markup mode does not generate an fo:block or a line break. I think what you are seeing is the following: the note element opens an fo:block, the object.title.markup template generates the title text, and then the para template is processed. The para template generates an fo:block for its content, and so you have a nested fo:block which breaks the line before the para. My impression is that you want to use the nongraphical.admonition template, which looks like this initially: <xsl:template name="nongraphical.admonition"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <fo:block id="{$id}" xsl:use-attribute-sets="nongraphical.admonition.properties"> <xsl:if test="$admon.textlabel != 0 or title"> <fo:block keep-with-next.within-column='always' xsl:use-attribute-sets="admonition.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> </fo:block> </xsl:if> <fo:block xsl:use-attribute-sets="admonition.properties"> <xsl:apply-templates/> </fo:block> </fo:block> </xsl:template> Here is a modified version that should do what you want: <xsl:template name="nongraphical.admonition"> <xsl:variable name="id"> <xsl:call-template name="object.id"/> </xsl:variable> <xsl:choose> <xsl:when test="child::*[1]/self::para"> <fo:block id="{$id}" xsl:use-attribute-sets="nongraphical.admonition.properties"> <fo:block> <fo:inline keep-with-next.within-line='always' xsl:use-attribute-sets="admonition.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> <xsl:text>: </xsl:text> </fo:inline> <xsl:apply-templates select="para[1]/node()"/> </fo:block> <xsl:apply-templates select="*[not(self::para[1])]"/> </fo:block> </xsl:when> <xsl:otherwise> <xsl:apply-imports/> </xsl:otherwise> </xsl:choose> </xsl:template> The xsl:choose statement determines if the first child of the note is a para, which is a good candidate for run-in text. If it is not a para (xsl:otherwise), it reverts to the original behavior using xsl:apply-imports. If it is a para, it generates the title using object.title.markup, in the fo:inline to apply the font change from the attribute-set, then processes all the *content* of the first para element "para[1]/node()", not the para element itself. That prevents the para fo:block that was breaking the line. So now the title and the para content are in the same fo:block. Then it does apply-templates on everything in the note after the first para. Bob Stayton Sagehill Enterprises DocBook Consulting bobs@sagehill.net ----- Original Message ----- From: "Hinrich Aue" <hinrich.aue@lci-software.com> To: "'Sean Wheller'" <sean@inwords.co.za> Cc: <docbook-apps@lists.oasis-open.org> Sent: Monday, December 18, 2006 6:51 AM Subject: AW: AW: [docbook-apps] adminitions - notes - line break after "Note" I forgot the line break.... Note some text some text some text some text some text some text some text some text some text some text some text some text some text with "Note" bold and in a different font. I believe the problem is the "object.title.markup" in: <xsl:if test="$admon.textlabel != 0 or title"> <fo:block keep-with-next.within-column='always' xsl:use-attribute-sets="admonition.title.properties"> <xsl:apply-templates select="." mode="object.title.markup"/> </fo:block> </xsl:if> But I cannot find the definition in the stylesheets. So I guess it is a FO-defined makro or something. I there a reference documentation for this? I've been googling for a while but haven't found anything. Hinrich -----Ursprüngliche Nachricht----- Von: Sean Wheller [mailto:sean@inwords.co.za] Gesendet: Montag, 18. Dezember 2006 15:12 An: Hinrich Aue Cc: docbook-apps@lists.oasis-open.org Betreff: Re: AW: [docbook-apps] adminitions - notes - line break after "Note" On Monday 18 December 2006 16:01, Hinrich Aue wrote: > I already changed the note to show a line before and after. > But what I'm looking for is the line break after "Note". > Where does it come from? Not sure I am understanding, but I suspect you want the Note to be left of the text. Like such Note Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. In which case you can take the fo:list-block out and arrange the layout of the admonition as you like. The line break is being generated because the admon text label is part of the fo:list-block structures. If you can figure the XSL:FO you can do nice things with admons in FO output. Hope this helps. -- Ask me about the Monkey. Sean Wheller Technical Author sean@inwords.co.za +27-84-854-9408 http://www.inwords.co.za --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]