In this section, page breaks are created.
The only way to force a page break is to 'split' projectx into a bunch of different sequential files. Think of it like a DVD playing different movie chapters in a designated order.
Where one chapter ends, the text will run out. The next page — the start of a new chapter or the start of a new front-matter section or &c — will be the start of a new file.
In this way, page breaks are more 'simulated' than created, really, but this is how the job gets done. And this is what we'll do in this tutorial section; projectx will be split between each piece of front and back matter, plus any projectx partitions like parts or chapters.
We rename each of these new sections to suit its content.
While we're doing so, we'll also tackle things like subheader styling and removing the indent from the first line of the first paragraph of each chapter. I do these splits and styles in tandem because it's more efficient that way. Users may choose to tackle the styling afterward; either way is fine.
Long-form fiction folks whose stories don't have parts or chapters will use navigation anchors inside the story block instead (if the story is long enough to warrant navigation markers). This is covered in the supplemental custom navigation page.
ACTION: File Version
In this section, work only in split_projectx.epub.
Here comes the fussiest part of this entire process. Don’t be tired for this, don’t be distracted. Eat something, drink some water, chew gum or take a walk first or something, but make sure you’re alert and able to concentrate else you’ll be starting over ninety times, especially for projects with a lot of headers.
Similar to what we did in the last section, we will move from header to header, splitting the file each time we encounter another header by clicking the Split At Cursor icon, as shown below:
BEFORE clicking Split At Cursor:
AFTER clicking Split At Cursor:
Remember, everywhere we split the file creates a page break. Always split the file just before a header.
The Split creates a new file from the point of the split onward. If your cursor is placed at the start of the line Chapter 2, when the split happens, Chapter 1 becomes its own independent HTML file. In the Scandal example, projectx.html now contains only the title page. The rest of Scandal is now Section0001.html.
Everything from the cursor onward becomes a new section. The license page, the rest of the front matter and Chapter 1 with Chapter 2 and everything else beyond that point.
In Code View mode, scroll all the way up to the start of projectx.
In the Book Browser pane, double-click the projectx.html file to make sure that file is active in the center display pane.
Type <h in the Find: field and click the Find button. This finds the next header where a split is required.
Keep going through the entire file so the file is split into front and back-matter sections, parts and chapters.
If you screw up, go back to postslug_projectx.epub and start over.
If this happens, remember to create a new working copy named split_projectx.epub before making any changes to the file.
Be careful, here. Of all the production steps, splitting is the part where I make the most mistakes and have to back up. Splits cannot be undone, so again, don’t be tired for this part.
Tired = frustration + mistakes.
Scandal’s Book Browser looks like this once the file is all split up:
DISCLOSURE: There is more than one way to break up your projectx file. Sigil also has a special tag it can insert, bookmarking the places where we want to split up a file. (Using these bookmarks, Sigil won't actually break up the file until you you command it to do so.)
These markers can be inserted one of two ways: 1) Place cursor wherever you'd like the break and press ctrl+shift+enter, or 2) Place cursor wherever you'd like a split to happen and tap into Sigil's menus: Insert > Split Marker.
Later, when you're ready to split the file at those markers, click F6, or use the menus again: Edit > Split At Markers
Personally, I use the split-at-cursor menu. As tedious as it can be, it's more precise, and if something should -- God forbid -- go wrong, I find it's much less daunting to diagnose and correct.
Now we need to rename all those sections so we can tell which is which. To rename those files, right click on a file, like so:
Go through each HTML file in the text folder, starting with Title, License, &etc. Change each filename to suit its content.
Caveats:
Check the contents of a section carefully before renaming.
Remember, these section names are actually filenames, not header text. These file names absolutely cannot be sloppy or elaborate.
Letters and numbers only.
No spaces and no punctuation or the files will break.
These filenames are not the actual table-of-contents entries. Abbreviations are allowed.
The long-form fiction folks who do not have parts or chapters to split up, leave the story block alone for now. Split up projectx into the front- and back-matter sections, make sure the story is its own section, and we’ll hit the rest in a bit.
Example of Scandal, chopped and renamed:
It's up to the user whether these steps are taken now or later. I just find it to be more efficient if I handle these issues while double-checking the content of each HTML file at the renaming step to save me having to go back and frouf things up later.
Some things I commonly do at this point that users can decide for or against: (All of these things, with the exception of custom chapter-number graphics, are accounted for in the CSS file provided for this tutorial.)
No step-by-step images included for these; by now I'm sure you get the gist (and are dead sick and tired of the leave-no-man-behind tactics).
Apply "safe" class to every h1 element. (This has been added as a safety net for Nook and its apps. Everything labeled h1 MUST have a class assigned or no CSS will stick to those elements. Very annoying, but there it is.)
Apply subheader class to chapter subheaders. <p class="subheader">, same way we did <p class="center"> in the scene break examples.
Apply flush class to the first line of each chapter <p class="flush">, same way we did <p class="center"> in the scene break examples.
Apply copy class and in-line italic tags (and capitalized text) to things like sub-chapter headers, time or location stamps at the start of a chapter or sub-chapter. <p class="flush"><i>TIMESTAMP</i> (see below)</p>
Insert custom chapter-number graphics or other foofaraw, if applicable.
In traditional print books, this special-text type is typically flush with the margin, italicized in small-caps font, something like this:
Small-caps being a problematic in CSS, these can be mimicked using the "copy" paragraph class, like so:
"Copy" reduces the text size to .8 of the user's normal font size.
Italics are applied with in-line italics tags.
Timestamp text shown here is typed in all caps. 'small-cap' font is notoriously unreliable, so it's way safer to mimic it instead.
Optional Style Changes
This section has been moved to its own supplemental page. First-time users might want to give these changes a miss.
Once all the splits and styling are complete:
Plain-old save split_projectx.epub.
Use SaveAs to create addtoc_projectx.epub.
Previous << Slug Hunt | Next >> Add Table Of Contents