Chapter 5: Putting It All Together
This chapter is a practical assembly guide for the Trust Scott Works template. Follow the file map, see how the parts connect, and use the worked example when adding your own chapters.
1. See the book in two ways
For readers, this book has front matter, main chapters, and back matter. For an editor, it is a collection of content files, a stylesheet, and files describing how the publication is assembled.
- Front matter: the title and copyright pages, dedication, epigraph, Contents, foreword, preface, acknowledgments, and template guide.
- Main text: Chapters 1–5, including the definitions and this assembly guide.
- Back matter: References, afterword, appendix, endnotes, further reading, index, author information, other works, contact details, credits, and colophon.
Choose sections for their purpose. A novel, research guide, and poetry collection will not need identical opening or closing material.
2. Find your way around the directory
This is the actual file structure of Version 7. The content files are shown in this book’s reading order for convenience; a folder listing itself does not determine that order.
EPUB archive root/
|-- mimetype
|-- META-INF/
| `-- container.xml
`-- OEBPS/
|-- CONTENT.OPF
|-- STYLES/
| `-- SGC-MAIN.css
`-- EPUB/
|-- TITLE.xhtml
|-- COPYRIGHT.xhtml
|-- DEDICATION.xhtml
|-- EPIGRAPH.xhtml
|-- NAV.xhtml
|-- FOREWORD.xhtml
|-- PREFACE.xhtml
|-- ACKNOWLEDGMENTS.xhtml
|-- HOW-TO.xhtml
|-- CHAP-01.xhtml
|-- CHAP-02.xhtml
|-- CHAP-03.xhtml
|-- CHAP-04.xhtml
|-- CHAP-05.xhtml
|-- REFS.xhtml
|-- AFTERWORD.xhtml
|-- APPENDIX.xhtml
|-- ENDNOTES.xhtml
|-- FURTHER-READING.xhtml
|-- INDEX.xhtml
|-- ABOUT-AUTHOR.xhtml
|-- OTHER-WORKS.xhtml
|-- CONTACT.xhtml
|-- CREDITS.xhtml
`-- COLOPHON.xhtml
OEBPS is the content folder name used by this template. EPUB standards do not require that particular name. Keep these names and paths consistent when editing this copy.
This template currently contains no image files or embedded fonts. If your book needs them, you could add OEBPS/IMAGES/ and OEBPS/FONTS/ as optional folders, then register and reference the added files. Those folders are not part of the directory shown above.
3. Understand how the files connect
- mimetype identifies the archive as an EPUB.
- META-INF/container.xml points to OEBPS/CONTENT.OPF.
- CONTENT.OPF contains metadata, the manifest of resources, and the spine defining reading order.
- EPUB/NAV.xhtml provides the linked Contents.
- XHTML files hold the book’s text and links.
- STYLES/SGC-MAIN.css supplies the shared presentation rules.
For example, this chapter lives in EPUB/CHAP-05.xhtml. Its stylesheet link goes up one folder before entering STYLES. Its link to the next section, REFS.xhtml, stays in the same folder.
../STYLES/SGC-MAIN.css
REFS.xhtml
CHAP-04.xhtml#definitions-2
The last example links directly to the headings section of Chapter 4. The text after # matches that section’s id. Use exact spelling and letter case in both filenames and links.
5. Write the content and apply shared styling
Begin with one of the existing chapter files. Keep its document structure and stylesheet link, then replace the title, headings, and paragraphs. Here is a short body-content example:
<h1 class="chapter-title">Chapter 6: Your New Chapter</h1>
<section id="first-steps">
<h2>First Steps</h2>
<p>Write your opening paragraph here.</p>
</section>
The h1 is the chapter heading, h2 introduces a section, and p contains a paragraph. The class name chapter-title connects the heading to a rule in the shared stylesheet. Use the definitions chapter when a markup term is unfamiliar.
Editing a shared CSS rule can change every section that uses it. Keep such changes small, then review an opening page, an ordinary chapter, a table, and the definitions layout. Do not rely on a particular screen size or displayed page number.
6. Add a chapter in all the right places
The following worked example adds a future Chapter 6 before References. CHAP-06.xhtml is an example name only; that file is not included in this version.
- Create the content file. Duplicate a chapter as EPUB/CHAP-06.xhtml. Replace the document title and visible chapter heading, then add your text.
- Register the file. Add this item inside the existing manifest in CONTENT.OPF:
<item id="chap06" href="EPUB/CHAP-06.xhtml"
media-type="application/xhtml+xml"/>
The manifest’s path is relative to CONTENT.OPF, which is why it starts with EPUB/.
- Set the reading position. Insert the new itemref after chap05 and before refs in the existing spine:
<itemref idref="chap05"/>
<itemref idref="chap06"/>
<itemref idref="refs"/>
- Add the Contents entry. Insert this list item after Chapter 5 in NAV.xhtml:
<li><a href="CHAP-06.xhtml">
Chapter 6: Your New Chapter
</a></li>
- Connect the reading links. Change Chapter 5’s next link to Chapter 6. Give Chapter 6 a previous link to Chapter 5, a next link to References, and a Contents link. Change References’ previous link to Chapter 6.
- Update related pages. Add the chapter to the repeated book menus where used. Review the linked index, resource lists, chapter count, and colophon so their descriptions remain accurate.
A file can exist in the archive while being absent from Contents or the intended reading sequence. Check the file, manifest, spine, and navigation together.
7. Add images and supporting material when needed
For an optional illustration, place an actual image at OEBPS/IMAGES/example.jpg. Register it in the manifest and refer to it from your chapter. These are illustrative snippets, not existing resources:
<item id="example-image" href="IMAGES/example.jpg"
media-type="image/jpeg"/>
<img src="../IMAGES/example.jpg"
alt="Replace with a useful description of the image."/>
Use a description suited to the actual image and record its credit where appropriate. An ordinary illustration is not automatically a cover; a cover image also needs the EPUB cover-image property on its manifest entry.
For supporting text, follow the same chapter-assembly pattern. The appendix and endnotes demonstrate a note link and return link. The topic index demonstrates links to named sections.
8. Assemble and check the finished EPUB
Work on a copy of the EPUB and save a new version after a significant change. An EPUB editor can manage packaging; if you package manually, the archive root must contain mimetype and META-INF directly. Do not wrap everything in an extra enclosing folder. The mimetype entry must be first and uncompressed, containing exactly application/epub+zip.
Before sharing, review this sequence:
- Read the text and remove unused samples and author-only instructions.
- Check metadata, headings, credits, and publication details.
- Follow Contents, previous/next links, index links, and note return links.
- Validate the EPUB package and address reported problems.
- Read the saved EPUB in your intended reading apps, including at larger text sizes.
- Keep the editable working files and a dated release copy.
A browser preview helps with layout, but does not establish that the packaged EPUB works correctly in a reading app.
9. Troubleshoot common assembly mistakes
- A chapter is missing
- Check that its file exists, its manifest entry is correct, and its id appears in the spine. Check Contents separately.
- A link opens the wrong place
- Check the relative path, filename case, and any #fragment target.
- A section has no styling
- Compare its stylesheet link with a working chapter’s link.
- The library shows the old title
- Check CONTENT.OPF as well as the title page, and reopen the updated copy in your reader.
- Removing a page breaks navigation
- Remove its manifest, spine, and Contents entries; reconnect its neighbours and update incoming links.
Reference and next step
Packaging requirements are described in the W3C EPUB 3.3 specification. The file map and worked examples above are specific to this template.
For your next edit, choose one section, replace its sample content, and follow its links before moving on to the next section.