Skip to content

Docbook chapter title overwrites book title #11300

@nicorikken

Description

@nicorikken

Explain the problem.

When creating a file from a DocBook file, Pandoc doesn't distinguish between the title of a chapter (or similar like appendix, colophon, etc.) and the title of the main book.

Failing

Docbook modeled as is typical, with the title in the main info element on the top level. This info element is at the top of the file.

failing.dbk

<?xml version="1.0"?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0" dir="ltr">
  <info>
    <title>Book title</title>
    <subtitle>Book subtitle</subtitle>
  </info>
  <chapter>
    <info>
      <title>Chapter title</title>
    </info>
    <para>My sentence</para>
  </chapter>
</book>

Command

pandoc -f docbook -o failing.odt failing.dbk

Output

Image

Succesful

Reordering info works (tested for ODT).

succeeding.dbk

<?xml version="1.0"?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0" dir="ltr">
  <chapter>
    <info>
      <title>Chapter title</title>
    </info>
    <para>My sentence</para>
  </chapter>
  <info>
    <title>Book title</title>
    <subtitle>Book subtitle</subtitle>
  </info>
</book>

Command

pandoc -f docbook -o succeeding.odt succeeding.dbk

Output

Image

Pandoc version?

Verified this occurs with the lastest version of Pandoc 3.8.2.1, installed from the .deb file from GitHub.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions