Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove verso and list of tables from DocBook document

I have problem with customization layer of DocBook XSL. I use Apache FOP to transform document from DocBook XML to PDF. But the book contains second page (so called verso) and page List of Tables. I just have erased the content of verso, but second page remains empty now. I don't now how to remove second empty page.

(I have found one solution only. It is easy - just add <xsl:template name="book.titlepage.verso"/> to your templates, but after this element has been added, second page remains as empty page.)

I'm likewise unable to find any solution how to remove page List of Tables.

like image 785
Theodor Keinstein Avatar asked May 25 '11 18:05

Theodor Keinstein


1 Answers

It was easy. I found this in titlepage.templates.xsl:

<xsl:template name="book.titlepage.before.verso">
   <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" break-after="page"/>
</xsl:template>
Aha! It is the template including page break, isn't? What happens when I turn it into an empty template? Et voilà, solution found:
<!-- clear verso -->
<xsl:template name="book.titlepage.verso"/>
<!-- clear page break after verso -->
<xsl:template name="book.titlepage.before.verso"/>
And how to remove annoying List of Tables? Copy basic TOC (table of content) settings into your template:
<xsl:param name="generate.toc">
    appendix  toc,title
    article/appendix  nop
    article   toc,title
    book      toc,title,figure,table,example,equation
    chapter   toc,title
    part      toc,title
    preface   toc,title
    qandadiv  toc
    qandaset  toc
    reference toc,title
    sect1     toc
    sect2     toc
    sect3     toc
    sect4     toc
    sect5     toc
    section   toc
    set       toc,title
</xsl:param>

In the list is everything that is to be collected in TOC in certain parts of the document. If you remove figure,table,example,equation, you get standard table of content.

Note: The list says, in which blocks should be table of content and in which blocks should not. If you need to reduce depth of TOC, you must add into your template e.g.:

<xsl:param name="toc.max.depth">2</xsl:param>
like image 51
Theodor Keinstein Avatar answered Nov 03 '22 18:11

Theodor Keinstein