如何解决docbook 中没有分页符
对于我正在写的书,我采用了 docbook 的方式。很多美好的事情,但是,经过大量的工作,我开始后悔了。我在渲染部分使用 XMLmind(使用 Bbedit 进行编辑)。 最后一滴是当我意识到在 docbook 文档中插入分页符没有简单的方法时。也就是说,除非您研究了所有 XSL 文档并尝试使用与 XMLmind 不同的样式表。
从 http://www.sagehill.net/docbookxsl/PageBreaking.html 我看到我应该放
<xsl:template match="processing-instruction('hard-pagebreak')">
<fo:block break-after='page'/>
</xsl:template>
某处,和
<?hard-pagebreak?>
我需要强制分页的地方。但重点是:这是 XMLmind 处理的 xml 文件的标题:
<book version="5.1" xml:lang="it" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
应该在哪里添加模板?
回答你的问题,原代码为:
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.1" xml:lang="it" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>This is a book</title>
</info>
<chapter xml:id="ch_intro">
<title>Introduction</title>
<section xml:id="first_section">
<title>The first section</title>
<para>Lorem ipsum dolor sit amet,consectetur adipiscing elit,sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam,quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</para>
</section>
<section xml:id="second_section">
<title>The second section</title>
<para>Lorem ipsum dolor sit amet,quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.</para>
</section>
</chapter>
</book>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。