[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Replacing recto titlepage
Hi Mona,Many people manually override the first page by rewriting the template named "book.titlepage.recto", as Peter suggests. However, the context for that template is already within an fo:page-sequence, using the 'titlepage' page-master. Since you cannot nest page-sequences, you would not be able to redefine the margins to zero as in your user pagemaster. Some people instead use an fo:block-container with absolute placement to override the titlepage master's margins when they want a full-page graphic, something like this:
<xsl:template name="book.titlepage.recto"> <fo:block-container absolute-position="absolute" width="{$page.width}" height="{$page.height}" top="-({$page.margin.top} + {$body.margin.top})" left="-({$page.margin.inner})"> <fo:block containing the image element ...The advantage of this approach is that it retains the pagination. Turning off the book.titlepage.recto would like cause the verso titlepage to be numbered 1, I think.
The reason your attempt did not work is that page-masters are declared separately in a prolog of the FO file, and then referenced by an fo:page-sequence when needed. The user.pagemasters template is automatically called in that prolog to add your new declarations, so you should not call it yourself in book.titlepage.recto. Once it is declared, referencing it as you did is all that is needed:
<xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference">front-cover</xsl:with-param> Bob Stayton Sagehill Enterprises bobs@sagehill.net -------------------------------------------------- From: "Peter Desjardins" <peter.desjardins.us@gmail.com> Sent: Tuesday, September 10, 2013 7:25 AM To: "Mona Qi" <qizilan.scutech@gmail.com> Cc: "DocBook Apps" <docbook-apps@lists.oasis-open.org> Subject: Re: [docbook-apps] Replacing recto titlepage
Hi. Are you using the book element for your content? If so, try overriding the book.titlepage.recto template. There should be an article.titlepage.recto template also, I haven't looked for it. <xsl:template name="book.titlepage.recto"> [insert-your-cover-page-here] </xsl:template> I've never worked with the front.cover template before. It does have a tempting name but it's empty by default and I do not think it will do what you are hoping. Good luck! PeterOn Tue, Sep 10, 2013 at 5:52 AM, Mona Qi <qizilan.scutech@gmail.com> wrote:Hi all,I'm a beginner, I've added a image as my first page of the fo output, but ican't delete the recto title page which was auto generated by the titlepage.templates.xsl. As far as i know, the docbook1.78.1 will generate two consecutive titlepages, one shows the title in recto and the subtitle and copyright shows in verso. Refer to http://www.sagehill.net/docbookxsl/ReplaceTemplate.htmlI've been trying to replace the titlepage.templates.xsl by call-template inmy frontcover.xsl, but i failed.Here is the codes in my frontcover.xsl, and part of it are definitely wrong:<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="C:/docbook/docbook-xsl-ns-1.78.1/fo/docbook.xsl"/> <xsl:template name="front.cover"> <xsl:call-template name="page.sequence"> <xsl:with-param name="master-reference">front-cover</xsl:with-param> <xsl:with-param name="content"> <fo:block alignment-adjust="auto"> <fo:external-graphic src="images/DB.jpg" content-width="{$page.width}" content-height="{$page.height}" display-align="center"/> </fo:block> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template name="user.pagemasters"> <fo:simple-page-master master-name="front-cover" page-width="{$page.width}" page-height="{$page.height}" margin-top="0pt" margin-bottom="0pt" margin-left="0pt" margin-right="0pt"> <fo:region-body margin-top="0pt" margin-bottom="0pt" margin-left="-0pt" margin-right="0pt"/> </fo:simple-page-master> </xsl:template> <xsl:template name="book.titlepage.recto"> <xsl:call-template name="user.pagemasters"/> </xsl:template> </xsl:stylesheet>And all i want is to delete the recto page and keep the verso one - replacethe recto page by the image cover. Can anyone give me some advice? Thanks in advance. Mona Qi--------------------------------------------------------------------- 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]