-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add global --include-before option for epub format #7478
Comments
I assume that you're talking about the table of contents encoded in nav.xhtml in the epub container? |
I'm unsure if ibooks is pulling things to the front, but I dont see this behaviour on Calibre or the Kindle reader. I can provide some screenshots showing typical epub layout if that helps, or upload some example .opf manifests and spine snippets, and contrast that to the repeated behaviour of the |
I understand why |
Sure thing. For more motivation, I am trying to set up a compilation pipeline for publishing a novel and have to conform to KDP standards which state here in Step 4 that front matter order is:
Kings of the Wyld layout in the Kindle Viewer: [KingsOfWyld_package.opf.txt](https://github.com/jgm/pandoc/files/6951272/KingsOfWyld_package.opf.txt)Misborn (3 books in one epub): [Misborn_content.opf.txt](https://github.com/jgm/pandoc/files/6951283/Misborn_content.opf.txt)Memory of Light (calibre book viewer showing dedications similar frontmatter): Sword of Kaigen online epub viewer: Let me know if any other parts of any of those epubs might be useful, unsure about the legality of sharing them on an open source platform |
Some of the opfs didnt seem to upload properly. Here are all of them zipped together. |
For easy reference, <spine page-progression-direction="ltr" toc="ncx">
<itemref idref="cover" linear="no"/>
<itemref idref="titlepage" linear="yes"/>
<itemref idref="copyright" linear="yes"/>
<itemref idref="toc" linear="yes"/>
<itemref idref="dedication" linear="yes"/>
<itemref idref="preface001" linear="yes"/>
<itemref idref="chapter001" linear="yes"/>
<itemref idref="chapter002" linear="yes"/>
<itemref idref="chapter003" linear="yes"/> The page-progression-direction and linear attributes aren't used by pandoc; that might be the difference. If we used them, we could introduce a way to mark chapters as pre-toc (and presumably also as not appearing in the toc)? In some writers we are sensitive to |
Being able to label chapters as pre-toc would be useful. The KDP guide doesnt seem to indicate that the pre-toc entires are required in the toc, so leaving them out seems appropriate. They explicitly state the TOCs are required for ebooks to allow users to navigate between book chapters, so all the non-chapter pre-toc content shouldnt need to appear. As to the best way of labelling chapters, I simply have a file |
Sorry, I was being dumb. In my test, I changed the order in the manifest element, not the spine. In the academic publishing I'm most experienced with, the preface and acknowledgements come after the TOC and are listed in it (though numbered differently, with roman-numbered pages). All that comes before the TOC are the title page, half title page (copyright), dedication (if any), and series page. Maybe it's different with (some?) fiction. |
In the PDF you linked to, it says:
So, this suggests that the forward comes after the TOC. You can do this in pandoc using a custom epub template. In fact, the template already includes a
or whatever, then it should appear on the title page automatically even with the default template. |
Oh, does that support more than just text? Links, images and text formatting? Or is that rich content something that could be done with a custom template instead of using the rights metadata? |
Anything you can do in pandoc's markdown will work there. |
Oh, I had no idea it was rich, my apologies then, I believe that would resolve all the issues. Just tested it and the only thing Im not sure how to do is respect their left-hand vs right-hand page rule by explicitly setting a page break or adding a new page to align the TOC. Im guessing |
I think that i got a similar issue and since this one is still open I would try to explain it here. If needed I could open a new one. I tried the proposed solution, but unfortunately some reading devices (i.e. Kobo) does not support page break from CSS. Currently the only way to force a page break is to split pages in different files (see specs for details). Thanks. |
For many epub works, it is common to have sections before the Table of Contents. A foreword, acknowledgements, copyright and dedication are all fairly normal to include.
For other formats, including the
-B
(--include-before-body
) option is normally sufficient to include content before the generated Table of Contents.However, for the
epub
format, each chapter is treated as its own file (even with the-s
standalone option.This means that if you include a file with a foreword (for example) in via the
-B
argument, your epub output will have the foreword at the beginning of every chapter.As far as I can tell (at least, having spent a day or two trying to find a solution), there is no way to add content before the table of contents by itself in the epub export. This would be a great feature to add to pandoc for book publishing.
The text was updated successfully, but these errors were encountered: