[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: Titlepage learning curve
My intention was to add a half-titlepage. I've succeeded in that. I wanted to use a mediaobject in place of the title on both the half-title and titlepage. Iv'e sort of succeeded there, but I don't find it satisfactory.
In my xml, I have:
<book>
<bookinfo>
<mediaobject .../>
<title>My Title</title>
...
</bookinfo>
</chapter>
My titlepage xsl has:
<xsl:template name="book.titlepage.recto">
<xsl:choose>
<xsl:when test="bookinfo/mediaobject">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/mediaobject"/>
</xsl:when>
<xsl:when test="info/mediaobject">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/mediaobject"/>
</xsl:when>
<xsl:when test="bookinfo/title">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/>
</xsl:when>
...
</xsl:template>
This substitutes the mediaobject for the title if it is present in the xml source. Exactly as desired.
I generate similar xsl for cover:
<xsl:template name="front.cover">
<xsl:call-template name="page.sequence">
<xsl:with-param name="master-reference">titlepage</xsl:with-param>
<xsl:with-param name="content">
<xsl:choose>
<xsl:when test="bookinfo/mediaobject">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/mediaobject"/>
</xsl:when>
<xsl:when test="info/title">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/>
</xsl:when>
<xsl:when test="title">
<xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/>
</xsl:when>
</xsl:choose>
<xsl:choose>
...
</xsl:template>
But in the fo, this results in two <fo;block.../> calls with the same id, one for the cover, and the other for the titlepage. This generates an error for both fop and ahf. As a workaround, I can put both <info.../> and <bookinfo.../> into <book...\>.
Including two separate mediaobjects. This works. I get the desired mediaobjects on both the cover and titlepage. BUT only at the expense of mixing DB 4.5 and DB 5 elements, i.e., info and bookinfo in the same document. This seems like a no-no, right?
What am I missing?
From: Kevin Dunn <kdunn@hsc.edu>
Sent: Tuesday, June 22, 2021 4:57 PM To: docbook-apps@lists.oasis-open.org <docbook-apps@lists.oasis-open.org> Subject: [docbook-apps] Re: Titlepage learning curve
I found this for adding a half title. I worked like a charm:
From: Kevin Dunn
Sent: Friday, June 18, 2021 5:00 PM To: docbook-apps@lists.oasis-open.org <docbook-apps@lists.oasis-open.org> Subject: Titlepage learning curve
I am working my way through
I think I understand the broad outline, but there are a couple of things that I may not understand yet.
Chapter 5. A Very Important Chapter
but I would like the option of:
Chapter 5 (centered, smallish font size)
A Very Important Chapter (next line, centered, largish font size)
I don't see any way in the templates to refer to the chapter label.
Thanks.
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]