1 year ago

#373113

test-img

match

Remove Title from Table of Contents in Pandoc epub output

I have an html document which I am converting to epub using pandoc as follows:

pandoc -f html -t epub --css pandoc.css --standalone --toc -o book.epub book.html

The generated epub book has a title page added, and this becomes the first item in the table of contents. For example, if the html is as follows:

<title>My Book</title>
<h1>Chapter 1</h1>
<p>One</p>
<h1>Chapter 2</h1>
<p>Two</p>
<h1>Chapter 3</h1>
<p>Three</p>

Then the contents will be:

Contents

1. My Book
2. Chapter 1
3. Chapter 2
4. Chapter 3

I have been able to remove the title page from the document by modifying the default.epub3 template to not include this section - however it creates a blank page and generates an entry for it in the TOC.

Are there any ways to prevent the title being added to the TOC?

pandoc

epub

0 Answers

Your Answer

Accepted video resources