In a Leanpub book, you can distinguish between "frontmatter" text files, which will appear with Roman numerals in the Table of Contents, and "mainmatter" text files, which will appear with ordinary numbers in the Table of Contents.

To indicate the beginning of a sequence of files that you want to be "frontmatter", type this on a line by itself at the top of the first file in the sequence:

{frontmatter}

Then, to indicate the beginning of a sequence of files that you want to be "mainmatter", type this on a line by itself at the top of the first file in the sequence:

{mainmatter}

For example, you would do this at the top of the first file you wanted to appear in the Table of Contents with Roman numerals, at the beginning of a book:

{frontmatter}

# Foreword

It was the best of times

Then, you would do this at the top of the first file that you wanted to appear in the Table of Contents with ordinary numbers:

{mainmatter}

# Chapter One

It was the worst of times.

The next time you create a preview, you will see how this looks in the book. Here's the table of contents from the example book we created for this article:

To be clear, {frontmatter} and {mainmatter} do not go in the Book.txt file (or the Sample.txt file, if you're using Leanpub-Flavored Markdown instead of Markua).

So, you should not do this in the Book.txt file:

{frontmatter}
Foreword.txt
{mainmatter}
chapter1.txt
chapter2.txt
chapter3.txt
Did this answer your question?