[docbook-apps] epub: how to set linear = 0
Kindle requires that an epub file have itemref idref=cover linear=no/ in order for the Kindle file not to show the cover twice. In my output in content.opf I see the lines spine toc=ncxtoc itemref idref=cover linear=yes/ In the epub/docbook.xsl file I see a parameter at the top which says: xsl:param name=epub.cover.filename select=concat($epub.oebps.dir, 'cover', $html.ext)/ xsl:param name=epub.cover.id select='cover'/ xsl:param name=epub.cover.html select='cover.html' / xsl:param name=epub.cover.image.id select='cover-image'/ xsl:param name=epub.cover.linear select=0 / I would assume that for epub.cover.linear, if the value is 0, then linear is supposed to be no. But by default it seems to show a yes value in my output. If I change the parameter to xsl:param name=epub.cover.linear select=1 / I get the exact same result. Is this a bug? -- Robert Nagle 12777 Ashford Point Dr #1417 Houston, Texas 77082 713 893 3424 http://www.robertnagle.info - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] epub: how to set linear = 0
On Sun, Apr 10, 2011 at 1:39 AM, Robert Nagle idiotprogram...@gmail.com wrote: I would assume that for epub.cover.linear, if the value is 0, then linear is supposed to be no. But by default it seems to show a yes value in my output. If I change the parameter to xsl:param name=epub.cover.linear select=1 / I get the exact same result. Is this a bug? Yes, try xsl:choose xsl:when test=$epub.cover.linear != 0 xsl:textyes/xsl:text /xsl:when xsl:otherwiseno/xsl:otherwise /xsl:choose - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] epub: how to set linear = 0
Thanks. If I copy the whole xsl:template name=opf.spine into customization layer and substitute the code, I get the same result. YES. However, if I changexsl:textyes /xsl:text to xsl:textno /xsl:text (so both options say No) then I see the linear=no in the output content.opf. for some reason that test is not working right. It's being caught at the top without going to the otherwise. Robert On Sun, Apr 10, 2011 at 11:10 AM, Keith Fahlgren abdela...@gmail.com wrote: On Sun, Apr 10, 2011 at 1:39 AM, Robert Nagle idiotprogram...@gmail.com wrote: I would assume that for epub.cover.linear, if the value is 0, then linear is supposed to be no. But by default it seems to show a yes value in my output. If I change the parameter to xsl:param name=epub.cover.linear select=1 / I get the exact same result. Is this a bug? Yes, try xsl:choose xsl:when test=$epub.cover.linear != 0 xsl:textyes/xsl:text /xsl:when xsl:otherwiseno/xsl:otherwise /xsl:choose -- Robert Nagle 12777 Ashford Point Dr #1417 Houston, Texas 77082 713 893 3424 http://www.robertnagle.info - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Incorrect page sequence for TOC/Lot and preface pages withdouble-sided output
Hi Dave, If you are seeing incorrect margins, then the problem is not in the templates you have customized, but in the selection of the page masters as pages are generated. There is one more thing you need to do for eliminating the extra blank pages in page sequences. You need to customize the fo:page-sequence-master to remove the page-position=first item, since the first page master's layout matches the odd page master layout, but that is not appropriate when the first page is even. Here is the original fo:page-sequence-master for lot in the template named setup.pagemasters in fo/pagesetup.xsl: fo:page-sequence-master master-name=lot fo:repeatable-page-master-alternatives fo:conditional-page-master-reference master-reference=blank blank-or-not-blank=blank/ fo:conditional-page-master-reference master-reference=lot-first page-position=first/ fo:conditional-page-master-reference master-reference=lot-odd odd-or-even=odd/ fo:conditional-page-master-reference odd-or-even=even xsl:attribute name=master-reference xsl:choose xsl:when test=$double.sided != 0lot-even/xsl:when xsl:otherwiselot-odd/xsl:otherwise /xsl:choose /xsl:attribute /fo:conditional-page-master-reference /fo:repeatable-page-master-alternatives /fo:page-sequence-master To customize this, your customization layer needs to have a template named user.pagemasters that contains a definition of a new fo:page-sequence-master that is the same as this one except it must have a new master-name and it must remove this element: fo:conditional-page-master-reference master-reference=lot-first page-position=first/ You can also remove the element for blank, but it is not necessary because the no-force option prevents it from being used. With those gone, each page master is selected only by odd or even, so when the first page is even it should get the even page master with those margins. Then your customization layers needs to add a template named select.user.pagemaster to choose your new master-name for lot. See this reference for more details on custom page masters: http://www.sagehill.net/docbookxsl/PageDesign.html Bob Stayton Sagehill Enterprises b...@sagehill.net - Original Message - From: redlettucemail To: docbook-apps@lists.oasis-open.org Sent: Sunday, April 10, 2011 1:42 AM Subject: [docbook-apps] Incorrect page sequence for TOC/Lot and preface pages withdouble-sided output I have used the workaround code below to delete blank pages, and renumber, so that there are no blank pages between the Table of contents and each of the lists of figures, tables and examples. The LOTs (and TOC) all appear on their separate pages, but when I set the document to double-sided output (which has different inner and outer margins) the LOT pages and the following Preface all appear with margins set up for recto (with a larger inner margin), and the page number in the footer is in the same position for all pages (it should alternate between left and right for subsequent pages). The output should alternate between recto and verso margins. The first code below is the workaround to delete blank pages. The second is to specify page numbering on the LOT pages. I think I have narrowed down the problem to the first batch of code in the first example (by iteratively deleting each part of the code – 1 and 2 – and transforming), but I can’t see how the workaround affects the page sequence for LOTs. Thanks very much. = !--Delete blank pages in LOTs and front matter (both 1 and 2 below are required code)-- !--1. don't force pages to end on even-- xsl:template name=force.page.count xsl:param name =element select = local-name(.)/ xsl:param name = master-reference select=''/ xsl:choose xsl:when test = starts-with($master-reference, 'lot') no-force /xsl:when xsl:when test = starts-with($master-reference, 'front') no-force /xsl:when xsl:when test =$element = 'preface' end-on-even/xsl:when !-- double-sided output -- xsl:when test =$double.sided != 0 end-on-even/xsl:when !-- end-on-even -- !-- single-sided output -- xsl:otherwise no-force /xsl:otherwise /xsl:choose /xsl:template !--2. reset initial page number for deleted blank pages-- xsl:template name=initial.page.number xsl:param name =element select = local-name(.)/ xsl:param name = master-reference select=''/ !-- Select the first content that the stylesheet places after the TOC -- xsl:variable name=first.book.content select= ancestor::d:book/*[ not(self::d:title or self::d:subtitle or
Re: [docbook-apps] setting a particular table's column widths with xsl
Hi Matt, The stylesheets call a template named 'generate.colgroup', which recursively passes through the columns and calls a template named 'generate.col' for each column of the table. The 'generate.col' template outputs one fo:table-column element, normally using the width information provided by the XML input. You could customize the 'generate.colgroup' template from fo/table.xsl to first compute the tabstyle using this utility template included in DocBook XSL: xsl:variable name=tabstyle xsl:call-template name=tabstyle/ /xsl:variable Then customize 'generate.colgroup' to add an xsl:when statement for your custom tabstyle value to output the set of four fo:table-column elements for your special tables, instead of calling 'generate.col'. Or you could customize 'generate.col' to handle each column separately based on the tabstyle value it computes. Bob Stayton Sagehill Enterprises b...@sagehill.net - Original Message - From: Matt Dew mar...@osource.org To: docbook-apps@lists.oasis-open.org Sent: Friday, April 08, 2011 11:35 AM Subject: [docbook-apps] setting a particular table's column widths with xsl Hi again all, I've got a particular type of table that I want to set column widths on via xsl rather than having to do it in the xml source. The reason is that I have _lots_ of xml files that will use this type of table and I don't want to have to maintain this if/when we change the table layout. The html is easy with the css. I'm having a problem with the pdf/ps output. I don't want to have to use 'colwidth' like this: informaltable tabstyle='encoding' tgroup cols='4' align='left' colspec colname='c1' colwidth=1.0*/ colspec colname='c2' colwidth=3.0*/ colspec colname='c3' colwidth=2.0*/ colspec colname='c4' colwidth=3.0*/ thead row ... I want to be able to just do: informaltable tabstyle='encoding' tgroup cols='4' align='left' colspec colname='c1'/ colspec colname='c2'/ colspec colname='c3'/ colspec colname='c4'/ thead trow ... I cant' figure out how to do this. I've seen examples on using the table.layout template and such but I'm not having any luck. IE: xsl:template name=table.layout xsl:param name=table.content/ fo:table width=100% table-layout=fixed column-width=1.0 fo:table-column column-width=proportional-column-width(1.0)/ fo:table-column/ fo:table-column column-width=proportional-column-width(1.0)/ fo:table-column/ ... Can someone point me in the right direction? thanks, marcoz - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org