Contents | Start | End | Previous: KB0003: How to improve document formatting | Next: KB0005: How to add an ISBN identifier to your books


KB0004: How to format drop caps

See also:
Drop Caps dialog in the Jutoh manual
How do I fix oversized images, tables or boxes?

Introduction | Using paragraph settings | Using CSS in character styles | Using images

Introduction to drop caps

Drop caps displays the first letter, number of letters or word at the start of a paragraph with increased size so that two or more lines wrap around it. This gives a more book-like feel since it is used in traditional typesetting to highlight the start of a chapter or article.

You can add drop caps to your book with Jutoh, by editing the paragraph properties or a paragraph style. Drop caps will be exported to HTML, Epub, Kindle and ODT formats. For older Kindles with only KF7 support, the letter will be formatted in a larger size and in bold, while the full treatment will be applied when viewed with a KF8 reader. If you have the View | Text Highlighting mode switched on, the first letter of the paragraph will be shown in a larger font in the editor to indicate that drop caps is enabled.

Drop caps will be imported from DOCX and ODT.

Although it is a popular effect, results can be varied according to the font currently in use in the ereader, the current text size, and the particular ereader hardware and software. This is a limitation of CSS combined with the variety of options that can be applied to a reflowable ebook. So be warned that consistent drop caps formatting cannot be guaranteed. To help with this problem, Jutoh offers a lot of options for customising the drop caps CSS. Also, to avoid drop caps entirely, you can instead highlight the start of your chapter by setting the drop caps Display mode to Small Caps. This highlights the first few letters or words of your paragraphs in bold and small caps.

Drop caps using paragraph settings

To add drop caps, you can click on the Drop Caps button in the Tools tab of the Formatting Palette, or you can use the menu command Format | Text | Drop Caps. This shows a prompt before adding drop caps formatting.

Or, you can edit paragraph properties with the Paragraph command from the Format menu or the context menu (with right or control click). You will see a Drop Caps tab. Check Display drop caps and set the number of lines for the drop cap, how many letters to use, and whether to use the whole first word.

Or, you can create or edit a named paragraph style, such as "Body Text Drop Char", and use the Drop Caps tab to set drop caps formatting. Then you can apply this to all first paragraphs in your chapters ensuring that the style is always consistent even if you make changes to the "Body Text Drop Char" style.

If you specify a character style in the drop caps properties, its attributes will be merged with the generated drop caps CSS for the letter(s). For example, you might want to use a character style with the "capitals" text effect enabled so that the whole word (or the specified number of letters) are capitalised; or you might want it to be formatted with italics or bold, or a specific font.

If the specified character style has custom CSS associated with it, then Jutoh won't generate its own CSS for the drop caps: it'll use the custom CSS. This allows you to fully customise the CSS.

A second way to specify CSS is to enter it in the Custom CSS properties field in the Drop Caps tab. This CSS will take the place of generated CSS for the drop caps (see below).

A third way to specify the drop caps CSS is via the Drop caps CSS option, per configuration. This is essentially a template used by Jutoh's drop caps CSS code generation. Although by default the template is identical for all configurations, Jutoh supplies different values for the variables according to the configuration, reflecting differences between Kindle and Epub formats. This is what the template looks like:

font-weight: $FONT-WEIGHT$; font-size: $FONT-SIZE$; font-variant: $FONT-VARIANT$; float: $FLOAT$; margin-top: $MARGIN-TOP$; margin-bottom: $MARGIN-BOTTOM$; margin-left: $MARGIN-LEFT$; margin-right: $MARGIN-RIGHT$; line-height: $LINE-HEIGHT$; height: $HEIGHT$;

You can replace some or all of the variables with your own values if your drop caps should all be displayed the same throughout your project. You might, for example, have different size and margin values that work better for an embedded font you are using.

If Jutoh does not need all the values when generating for a particular format, it will replace the variable with a blank value, which will cause the property to be ignored. However, all properties you specify with actual values will be used. In other words, if you don't like Jutoh's implementation of drop caps CSS, you can replace it.

Drop caps using CSS in character styles

You can bypass the paragraph-based drop caps specification if you wish, and use character styles with custom CSS. Given the customisation features mentioned above, you probably won't need to do this, but if gives you ultimate flexibility especially if you need to add media queries to the CSS, for example.

When creating a style sheet in a new project, Jutoh adds a Drop Caps character style with custom CSS. You can then apply this style to the first letter of the relevant text.

If Jutoh has not already created the style, go to Project Properties/Styles, click New Style, Character Style. Enter the name Drop Caps. Press OK. Still in the Styles panel, in the drop-down under the styles list, choose Character styles. Select "Drop Caps", click Edit, go to the Font tab and choose a large font, say 20pt, and choose Bold under Font weight. This is just to show a large bold font in the editor, this exact formatting won't show in the ebook. Press OK to dismiss the Drop Caps editor and now click on Properties to show the Drop Caps property dialog. Check Use custom CSS and paste in this text:

.C_Drop_Caps {
  overflow: hidden;
  line-height: 90%;
  height: 0.75em;
  font-size: 280%;
  margin-right: 0.075em;
  float: left;
}

This should replace the existing text - if you used a different name for the Drop Caps style, make sure it's reflected in the name after the dot in the CSS.

Now press OK, OK again and in the editor, select the first letter of your paragraph and apply Drop Caps to it. You can do this with right-click (or control click on Mac), Styles, scroll to the bottom of the menu, click on Character Styles, choose Drop Caps.

Now when you compile the Epub and show it in e.g. Adobe Digital Editions or Kindle Previewer, you should see something approximating a drop caps. You may need to tweak the CSS to work better with your choice of font sizes.

If you want to use a different style for different configurations, create several styles, for example Drop Caps and Drop Caps Kindle, and use the configuration option Character style substitutions to replace one style with another when the book is compiled.

Drop caps using images

Alternatively, you can use a small image, and set Floating mode to Left in the image properties (Size tab). The text should wrap around the image. If it doesn't wrap properly in the Jutoh editor, use the command View | Preview Floating Objects.

You can try this using the capital letter images that are bundled with Jutoh. Click on the Clips tab of the Formatting Palette, then ensure Collection is showing "Global Clips", and choose "Letters - William Morris" using the Library control.

Position your text cursor at the beginning of a paragraph and double-click on a letter to insert it. Click on the new image to edit its properties, click Size, and choose Left from Floating mode. Also (again in the Size tab), set the image width to, say, 20% if the image is larger than desired.


Contents | Start | End | Previous: KB0003: How to improve document formatting | Next: KB0005: How to add an ISBN identifier to your books