Sorry, I was thinking of FO output in my previous response.  You'll need 
something similar for the HTML output needed for epub. 

Bob Stayton
Sagehill Enterprises
[email protected]


From: Bob Stayton 
Sent: Friday, November 16, 2012 2:23 PM
To: Robert Nagle ; apps docbook 
Subject: Re: [docbook-apps] epub: does using images instead of chapter titles 
produce a valid epub file?


Hi,
If I understand you correctly, you want a text title in the title element that 
is used in the TOC and xrefs, but you want to replace that with an image only 
on the chapter title page.

One way would be to put the mediaobject with role="graphic.title" in the info 
element of each chapter, and then process that in place of the title for the 
chapter title page.  You can do that by customizing the titlepage spec file for 
chapter to call a custom template, replacing:

   <title t:named-template="component.title"

with something like:

   <title t:named-template="graphic.component.title"

compiling this into a new titlepage XSL module, and then creating a custom 
template something like this (untested):

<xsl:template name="graphic.component.title">
<xsl:param name="node" select="."/>
  <xsl:choose>
    <xsl:when test="$node/d:info/d:mediaobject[@role = graphic.title']">
      <fo:block>
        <xsl:apply-templates select="$node/d:info/d:mediaobject[@role = 
graphic.title']"/>
      </fo:block>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="component.title">
        <xsl:with-param name="node" select="$node"/>       </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
</xsl:template>

This will fall back to the title element by calling 'component.title' if there 
is no mediaobject with that role.

Bob Stayton
Sagehill Enterprises
[email protected]


From: Robert Nagle 
Sent: Friday, November 16, 2012 12:39 PM
To: apps docbook 
Subject: [docbook-apps] epub: does using images instead of chapter titles 
produce a valid epub file?


Hi, there, I was planning a new ebook with my illustrator, and I stumbled upon 
something which I couldn't figure out. 

My illustrator wants to use graphics (i.e., a jpeg file) to serve as the title 
at the beginning of the chapter. 

How do you do that in the docbook way? 

In a previous thread, Bob said that you could use an empty title element to 
suppress the chapter title. 
http://markmail.org/message/gkokzarw6zxo3fiq?q=suppress+chapter+title+list:org.oasis-open.lists.docbook-apps

But I would need to have a way for the chapter title to appear in the TOC (and 
also in the epub navigation document? Does anyone know?) 

How can I use a graphic for a chapter heading and still have a nice looking 
TOC/epub navigation document? 

This is actually a common use case in ebook production; often an illustrator 
will want to embellish a chapter title and maybe integrate it with another 
graphic. So I'd like a robust solution to this kind of problem (hopefully one 
already exists!) 

Robert  





-- 
Robert Nagle
6121 Winsome Ln #56C, Houston TX 77057-5581
(H) 713 893 3424/ (W) 832-251-7522 Carbon Neutral Since Jan 2010
http://www.robertnagle.info

Reply via email to