Remove verso and list of tables from DocBook document

狂风中的少年 提交于 2019-12-07 04:37:31

问题


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.


回答1:


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>


来源:https://stackoverflow.com/questions/6128883/remove-verso-and-list-of-tables-from-docbook-document

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!