[Tex/LaTex] Making index in Pandoc generated ebook

ebookindexingpandocpolyglossia

I would like to make the example I have written in this question to work in Pandoc. When run using pandoc input-tex-file -o output-epub-file, pandoc produces a nice ebook using this tex file. However, the ebook lacks the indexes. How can I get the indexes in the output ebook?

Best Answer

You can add index to you Pandoc generated ebook using the two steps:

  1. Adding identifier to your heading, for example the following {#foo} syntax added the identifier for to the heading My heading,
# My heading {#foo}

we assume the file name was chap01.md.

  1. Creating a index type of file as your book index. In this file, you can write book index using markdown link format. eg:
# Index {epub:type=index}

#. [Index to My heading ](#foo)

we assume the file name was index.md.

Finally, your can generate the ebook with index using:

pandoc index.md chap01.md -s -o indexed_ebook.epub
Related Question