Next in thread → Next in month →

Re: Titlepage learning curve

From
Kevin Dunn <>
Date
2021-06-23T16:00:44+00:00
ID
Thread
Re: Titlepage learning curve
One more observation: if I manually edit the fo file and change the id on one of the two blocks containing the externa-graphic, then fop, xep, and ahf all process the fo to produce the desired pdf. I could write a sed script to do this automatically, but I'm
 sure I must be making a mistake in my custom xsl that generates two blocks with the same id.

From: Kevin Dunn <>

Sent: Wednesday, June 23, 2021 11:13 AM

To:  <>

Subject: [docbook-apps] 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 <>

Sent: Tuesday, June 22, 2021 4:57 PM

To:  <>

Subject: [docbook-apps] Re: Titlepage learning curve

 

I found this for adding a half title. I worked like a charm:

https://lists.oasis-open.org/archives/docbook/201212/msg00002.html

From: Kevin Dunn

Sent: Friday, June 18, 2021 5:00 PM

To:  <>

Subject: Titlepage learning curve

 

I am working my way through

http://doccookbook.sourceforge.net/html/en/dbc.fo.style-titlepages.html and 

http://www.sagehill.net/docbookxsl/HTMLTitlePage.html

I think I understand the broad outline, but there are a couple of things that I may not understand yet.

 As I understand it, the bit at the top of the first page of a chapter is considered a titlepage, and the template files allow you to customize it. But I don't see any reference to the chapter label, either in the .xml or .xsl template files. For
 example, by default, my chapters begin:

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.

I would also like to control the punctuation at the end of the label, e.g., Chapter 5 (not Chapter 5.), Section 5.2 (not Section 5.2.). I had customized my dsl-jadetex stylesheets to do this, but I can't follow what I did then (years ago) much less translate
 it into xsl-fo.

What is the best way to substitute a graphic for a titlepage element, e.g. the title or corporate logo as separate pdfs or svgs. I'm imagining including a <fo:external-graphic, but I don't see any examples I can mimic.

Finally, I am old fashioned and I like a half-title. The DocCookbook makes reference to this, but doesn't spell it out.

Thanks.
Next in thread → Next in month →