Lobo
Lobo

Reputation: 4157

Sub-chapters in ePub file

The NCX file an ePub file can specify the chapters that have the book in ePub format.

It uses the following XML syntax:

<navPoint class="chapter" id="chapter1" playOrder="1">
      <navLabel><text>Chapter 1</text></navLabel>
      <content src="file1.xhtml"/>
</navPoint>

My question is, can we create sub-chapters? If so, how?

I have searched Google and all I've found are very specific tools to perform these tasks. I do not want a tool, I want to know how to make sub-chapters in the NCX file.

Upvotes: 3

Views: 1419

Answers (1)

macjohn
macjohn

Reputation: 1803

Change the depth to the number of levels

<meta content="2" name="dtb:depth"/>

Put a navPoint inside the navPoint that must contain the sublevel. Remember to close the navPoint!

<navPoint class="chapter" id="chapter1" playOrder="1">
      <navLabel><text>Chapter 1</text></navLabel>
      <content src="file1.xhtml"/>

  <navPoint class="subchapter" id="sub1" playOrder="2">
    <navLabel><text>Subchapter 1</text></navLabel>
    <content src="file2.xhtml"/>
  </navPoint>

</navPoint>

Upvotes: 3

Related Questions