To see how you can create a "frontmatter" section in a Leanpub book, copy and paste the following into the first file in your book, at the very top of the file:
It was the best of times.
# Chapter One
It was the worst of times.
Here is an example of what this would look like in our in-browser text editor:
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:
The Foreword will be on a page of its own, like this: