Chapter Formatting

This post contains tips on how to make this technique work with Scrivener 3. Firstly it is worth noting that if you intend to use KF8 or ePub 3, then much of the above can be dispensed with, as we’ve added specific features to aid in formatting drop caps (though the formatting is still up to you, given how fluid and evolving this aspect of design remains).

  1. In the Compile overview screen, right-click on the Format in the left sidebar that is being used to style the ebook, and choose to edit it (duplicating if necessary).
  2. In the Section Layouts compile format pane, locate the layout used to style the body text, where drop caps should be added, and click on the “New Pages” tab in the lower half of that pane.
  3. Set the Number of opening words to make uppercase to zero if necessary. This will activate the Add “first-letter” span style to first letter checkbox: tick that.
  4. In the CSS compile format pane, make sure either “Append” or “Use” custom style sheet is chosen, and in the left column, add your drop cap CSS using the “first-letter” selector.

For Mobi and ePub 2, the same basic idea shared before still applies, but there are now better ways to go about getting the HTML around the first letter:

  1. In the main editor, apply whatever formatting you wish to a first letter and use the Format ▸ Style ▸ New Style from Selection... menu command. Save the style as a character style. As with before, the actual formatting is entirely arbitrary, we won’t be using it directly. Using a style simply replaces the Preserve Formatting usage in the v2 example above.

  2. In the Compile overview screen, right-click on the Format in the left sidebar that is being used to style the ebook, and choose to edit it (duplicating if necessary).

  3. Click on the Styles compile format pane and click the + button in the upper right corner to add your drop cap style created above:

    • Tick the Treat as raw markup flag in the right-hand column.
    • Place the <span class=“first-letter”> code into the Prefix field, and <\span> into the Suffix field.

    This step replaces the need to use Replacements. Instead of having to type in hyphens or other characters into the editor, we can now atttach the HTML we need to make this work directly onto styled text itself, leaving the editor clean.

  4. In the Text Layout pane, tick Include scriptwriting CSS and following the instructions provided in step 4 of the prior how-to.

These two methods can be used in the same project; they will not collide with one another so long as you use two different Compile Formats (which you generally should do anyway for these two very different approaches to ebook output). If you need both ePub 2 and ePub 3, the styled first letter in the editor will not conflict with the “first-letter” class Scrivener assigns. Download the example project for three demonstrations of the basic technique:

  • ePub 2 / Kindle Mobi
  • ePub 3 / KF8
  • Pandoc ePub

The “Universal Technique” binder item demonstrates how to format your text if you require other export methods beyond ePub 3 and KF8. The second binder item shows that nothing special is necessary in the text at all, if those are all you need, since Scrivener can add the necessary HTML automatically. Naturally, in testing this project, the second paragraph will not have a dropcap in Pandoc and ePub 2 / Mobi output.