0

I went the docbook way for a book I am writing. Many nice things but, after a lot of work, I came to regret it. I am using XMLmind for the rendering part (and Bbedit for the editing). The last drop was when I realized there is no easy way of inserting a page break in a docbook document. That is, unless you study all the XSL documentation and try to use different style sheets than those XMLmind's uses.

From http://www.sagehill.net/docbookxsl/PageBreaking.html I see I should put

<xsl:template match="processing-instruction('hard-pagebreak')">
   <fo:block break-after='page'/>
 </xsl:template>

somewhere, and

<?hard-pagebreak?>

where I need to force a page break. But the point is: being this the header of the xml file processed by XMLmind:

<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">

where should the template be added?

Answering to your question, the original code is:

<?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, 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>
  </chapter>
</book>

I'd like to insert a page break between the first and the second section.

diciotto
  • 69
  • 3
  • 1
    Seems you are confusing print (online) output with the rendering output during writing. These are two (or even three) SEPARATE parts and controlled by separate instances of options/setup. Please, refine, where do you need to get page break: while typing (within XMLMind), after output (i.e. in PDF page) or somewhere else? – Eduard Tibet Jan 08 '21 at 17:09
  • In the PDF page, the final output (for me) – diciotto Jan 08 '21 at 22:28
  • Please, provide a sample block of XML file where you inserted this instruction with . I need to have some sample to reproduce. You can delete all sensitive data and replace it by dummy "Lorem Ipsum" – Eduard Tibet Jan 09 '21 at 09:59
  • Thanks for your answer. I inserted right now the code at the end of the original question. – diciotto Jan 10 '21 at 09:26
  • The template that you included is XSL. The file you are editing is XML. You need to add the template to the XSL stylesheets that XMLmind is using. I've never used the product, so I can't give you specific directions to do so. – eskwayrd Mar 17 '21 at 00:13

0 Answers0