Contents | Start | End | Previous: Chapter 6: Editing Content | Next: Chapter 8: Editing Your Book’s Metadata


CHAPTER 7: FORMATTING LIKE A PRO


 

In the previous chapter, we dived into Jutoh’s editing facilities, and saw how to do simple formatting adjustments using the Paragraph and Character commands on the Format menu. In this chapter, we go beyond that and show how named styles are an essential tool for creating high-quality formatting.

Common formatting habits versus good formatting habits

The way most people format their documents is absolutely fine for most tasks – such as writing letters and emails, printing drafts, and creating reports. These common habits include:

Unfortunately, these techniques are not great when it comes to professionally formatting books – whether print or ebook. You might get away with some of this kind of formatting – and if self-publishing, no-one’s going to tell you off for it – but the result will be flawed, and it will be hard to maintain consistency within the project or take advantage of some Jutoh features.

So, if we revisit the above list of poor habits, the equivalent good habits would be:

Some direct formatting is fine, such as bold and italic for small amounts of text (not a whole heading or paragraph), so this rule is not entirely written in stone.

At this point, you may still be sceptical. If the formatting looks OK, why should you change it? Here are some reasons:

Other problems that can occur with direct formatting include accidental use of black or white colour (hard-coding this will interfere with certain reading modes), and specification of line spacing (this can mess up formatting in ereaders).

The trouble is, word processors such as Microsoft Word don’t really encourage good habits. Plus, all kinds of formatting can accidentally creep into your word processor document without it being apparent: this can include colour, unnecessary direct formatting, and line breaks.

The good news is that Jutoh will warn you about many such problems, plus Jutoh makes it much clearer what’s going on – direct formatting is indicated in Jutoh by the inclusion of a ‘+’ within the style name, so if you see ‘Normal + Centre Alignment’, you know that direct formatting has been used. Microsoft Word and similar software will often just hide this. When compiling, Jutoh will also tell you what percentage of your book uses direct formatting.

When Jutoh gives you warnings, remember this is good – it means that you have more insight into your book project and have the opportunity to fix things before publication. Plus, Jutoh gives you lots of tools to fix formatting issues, including the Formatting Cleanup command, which we’ll look at shortly.

While you can change things in Jutoh and perfect your book’s formatting, you can also do it in your favourite word processor by getting into the habit of using styles and not using (much) direct formatting. If you have created styles in Jutoh, you can compile an OpenDocument (ODT) file and open it in your word processor. You can then use that as a template for new documents.

The basics of formatting using named styles

Jutoh maintains a style sheet for each project, containing named style definitions that can be used to change formatting in your project. Each style definition (or just style, for short) specifies visual attributes such as italics, colour, alignment, and so on.

Jutoh supports four kinds of named style:

You can edit these styles, and add new ones, using the Styles page in the Project Properties dialog; or you can use Format | Edit Styles. Style changes will be applied to any open documents as soon as you close the dialog.

Whatever the formatting you apply, Jutoh must always be able to relate it to a named style. So if you use direct formatting, such as applying centred alignment using the toolbar, Jutoh will create a new automatic style (or find a suitable existing one), for example ‘Normal + Centre Alignment’. These automatic styles are maintained within each book section document individually, and you can’t edit or delete them manually.

I cannot emphasize enough how important it is to use named styles, not direct formatting, wherever possible. This will make it far easier to maintain a consistent format for your book, since then when you need to change the presentation you may only need to change the named styles, and not every relevant paragraph. Also, it makes it easier Jutoh to perform tasks such as table of contents creation because it can search for specific paragraph styles. Having said that, it’s probably not worth maintaining and applying separate styles for occasional use of bold or italics.

When Jutoh creates a new project for you, it creates a default style sheet with such styles as ‘Body Text First Indent’, ‘Heading 1’ and ‘TOC Entry 1’. Some of these styles (such as ‘URL’) are used by features in Jutoh, in the case of ‘URL’ for applying a link style in various situations, for example in a generated table of contents or for a page link. So it’s best not to delete the standard styles unless you really know what you’re doing.

The following lists the styles that are added by Jutoh. The asterisked styles should not be deleted, and the other styles can be replaced by custom styles in various dialogs – but you may wish to play it safe and not delete any of them. By default, certain standard styles will be restored when opening a project. You can turn this behaviour off via Options in Project Properties, by clearing Restore missing standard styles.

Since you can have multiple style sheets in a project, the style sheet that’s being used and edited at any given moment is the one that’s specified in the Style sheet property of the currently selected configuration. You don’t need to concern yourself with that if you will only be using the default style sheet, but it’s worth bearing in mind in case the Style sheet property is changed accidentally.

When you’re starting a project, think about what styles you’re likely to need, and if necessary create them. A bit of foresight here will save you time later compared with simply applying direct formatting.

Using the formatting palette to apply styles

The formatting palette provides a convenient way to understand, apply and modify the styles in your project. The palette shows a list of styles to the right of your document, similar to the Styles and Formatting pane in Microsoft Word. In this picture below, the ‘Heading 1’ style is being shown, and there’s a description of the details of the style at the bottom:

The formatting palette and context/‘More’ menu

You can show or hide the formatting palette using the command View | Formatting Palette or Alt+P; then click on the Styles tab. There are four other tabs in the palette. The Tools tab shows all the available tools that are also shown on the horizontal toolbar; Objects lists the objects that can be inserted, such as bookmarks, tag objects and tables; Inspector shows selected kinds of content in the current document, such as bookmarks and images; and Favourites shows any styles, commands or symbols that you may have marked as favourites in the shortcut editor (see the next topic).

The formatting palette will only be presented when a document of the appropriate type is being edited; it will also disappear temporarily if you are using the built-in help window, to reduce clutter.

The style that’s highlighted in the list is either the one where your cursor is currently positioned, or the style you have selected in the list with the mouse or keyboard. You can single-click on the styles without worrying about changing your project accidentally; this lets you browse the styles and read descriptions of them in the pane under the list.

To apply a style to the current paragraph or selection, double-click on the style name, or press Shift+Enter after typing in the search control. In the search control, you can cycle through matching styles by pressing the Enter key or the arrow buttons.

A menu appears when you click on More or right-click/control-click over the style list (or press the context menu button on your keyboard, if there is one). This menu contains commands for editing the current style, clearing default formatting, showing and hiding the style description pane, managing your styles (showing the Project Properties dialog with the Styles page selected), and creating new styles.

You can choose what kind of styles appear in the list, using the drop-down control next to the More button. By default it shows paragraph styles, but you can also show character styles, list styles, box styles, or all styles.

Applying styles using shortcuts and favourites

Especially if you have a lot of reformatting work to do, you’ll appreciate a quick way to apply styles. Press Ctrl+. and then Enter to start editing shortcuts for the styles in your project. Scroll down the list of shortcuts until you get to the styles section; then edit each relevant style and choose a primary shortcut (direct) or secondary shortcut (prefixed with Ctrl+.). You can also check Favourite to have it appear in the Favourites menu, as described above under Special symbols. For more about this, see Appendix B: Configuring Jutoh.

Using fonts

You can apply fonts as per other word processors, but by default, no font name information is included in your ebooks so that the ebook device and user can decide which fonts to use. For more about this and how to change the way fonts are written to your ebooks, please see Chapter 17: Working With Fonts.

Keep your main content, apart from headings, footnotes, captions etc., at 12pt – this is the point size that Jutoh regards as the ‘default’ size, and which can therefore be left unspecified in the generated ebook. The reader software, and user, will choose the best size.

Line and paragraph spacing

Line spacing is the space between lines within a paragraph; paragraph spacing comes in two parts: spacing before a paragraph, and spacing after a paragraph.

To edit spacing for a named style, go to the Styles page in Project Properties (Edit on the main toolbar). Select a style, click Edit and then click on Indents & Spacing.

Paragraph spacing is specified in tenths of a millimetre, which is converted to ‘ems’ for Epub and HTML (see Options in Project Properties for the scaling value).

Line spacing is specified in multiples of single line spacing, for example 1.2. But in general, you should avoid specifying any line spacing since it can cause display problems or override user settings. You can switch line spacing off for the whole book by clearing the configuration option Generate line spacing.

Don’t be tempted to simply leave a blank paragraph to get inter-paragraph spacing; some reader software may ignore this and it will be very hard to change your project if you decide to use less or no inter-paragraph spacing. The exception to this is the title page and other cases where you need more than the usual spacing; but even here it’s best to use a special style for each kind of vertical space, so you only need one blank paragraph at a time.

Indentation

First and subsequent line indentation for the left margin can be specified in a style, again under Indents & Spacing in the style editor. So a hanging indent can be achieved by specifying, say, 0 for the first-line indent, and 60 for the normal indent, where the values are in tenths of a millimetre.

You can also specify the right indent, though it’s rare to need to do that. Again, the value is specified in tenths of a millimetre.

Don’t use tabs for indentation! Tabs are ignored in HTML-based formats.

Alignment

Paragraph alignment (left, right, centred, justified) can be specified in the Indents & Spacing tab in the style editor, or via the Format menu and toolbar commands. You can choose left alignment or justification for the majority of your content, but note that Kindle is the only major platform that respects the alignment as specified in the book; other ereaders have a global justification setting that affects all books.

For list items, it can be better to force left-alignment since a short list item looks terrible when justified.

Note that if you justify text, it won’t show as justified in the Jutoh editor. However it will be justified when viewed in an ebook reader where supported.

Drop caps

You can specify drop caps in a paragraph style, or directly in a paragraph’s properties, via the Drop Caps tab of the formatting dialog. You can also use the command Format | Text | Drop Caps or the relevant toolbar button to show a dialog before applying drop caps to the current paragraph(s). This latter method creates an automatic style (direct formatting); you may wish instead to create a special paragraph style that you can apply to all the first paragraphs of your chapters.

Drop caps is supported when importing from DOCX and ODT files.

Note that drop caps may not be formatted consistently on all ebook viewers, because of the relationship between CSS, fonts and the different ebook viewer implementations and customisations. Most ebook viewers allow the user to change the font face, which can cause drop caps sizing and positioning to change.

Jutoh emits different CSS according to target format (Kindle or Epub/HTML). You can further customise drop caps CSS in several ways:

  1. per paragraph or style, by specifying CSS properties in the Drop Caps formatting page, overriding the generated CSS;

  2. per paragraph or style, by specifying custom CSS in the character style specified in the Drop Caps formatting page.

  3. per configuration, by editing the Drop caps CSS configuration option;

If you edit the Drop caps CSS option, you will see this template:

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

Jutoh replaces the variables with appropriate CSS for the target format and drop caps height. You can replace certain variables with actual values, and add extra CSS properties if you wish. Any further formatting (not custom CSS) in the specified character style, if any, will be merged with these properties, with the template’s properties taking precedence. If a variable has no value, the property will be omitted.

If you find drop caps isn’t your cup of tea, or isn’t consistent enough between devices, you can try setting the Display mode option in the Drop Caps dialog to Small Caps. This will format the first few characters or words of the paragraph in bold and small caps.

For more information, please see KB0004: How to format drop caps in the Jutoh Knowledge Base.

Small caps

Small capitals can be applied to a named style or directly to text via the Font tab of the style editor. For convenience, you could add a character style called ‘Small Caps’ that just has this attribute defined.

If you wish to add small caps to the first few words of your chapters, there’s a handy option in the Formatting Cleanup dialog (accessed from the Format | Book submenu) to do just that. Before using it, you’ll need to create a ‘Small Caps’ character style.

When generating Epub and Kindle ebooks, Jutoh can generate small caps either by using the official font-variant CSS attribute, or by emulating it by emitting capital letters and shrinking the text. Adobe Digital Editions and some other ereaders do not support font-variant, but all ereaders will do a reasonable job using small caps emulation, so by default emulation is used. To use font-variant instead, clear the Emulate small caps configuration option. For those ereaders that support it (for example, Kindle readers, Apple Books, and the Azardi software), font-variant is a superior method since it renders real capitals larger than the lower case letters. However, if you’re targeting multiple ereaders, emulation is safer.

Headings

If you use heading styles of the form ‘Heading 1’ then Jutoh will output the styles with the HTML heading tag (such as ‘h1’). To use a different prefix, or to stop Jutoh from emitting ‘h...’ tags, edit the Heading style prefix configuration property.

For finer control of how heading styles map to HTML levels, see Chapter 21: Making Your Books Accessible.

Lists

List styles are the only way to achieve bulleted or numbered paragraphs; you shouldn’t try to apply bullets via paragraph properties, although the Bullets page of the paragraph style editor is retained in case you imported a bulleted paragraph and need to reset the attributes.

List styles work on the principle that lists can potentially be nested, with different bullet or numbering styles depending on the level (depth) of the list. When you are editing a list, pressing the Tab or Shift+Tab keys will increase or decrease the level of the current paragraph in the list. It is dependent on the particular ebook reader whether the particular bullet or numbering style will be honoured, so you may see a different style in the ebook than in Jutoh.

The Bulleted List and Numbered List buttons in the toolbar apply the styles called ‘Bullet List 1’ and ‘Numbered List 1’ respectively. To apply a different list style, use the Format | List | Bullets and Numbering menu command, which will give you a choice of list styles to apply, along with the option to renumber the list.

The Bullets and Numbering dialog

You can renumber a list without choosing a style, using the Format | List | Renumber command, and you can remove list styling from one or more paragraphs by clicking on a bullet or numbering toolbar button.

Non-contiguous list numbering is possible by repeated use of Format | List | Renumber, specifying the start number, but not all ereaders support this and it can cause EpubCheck errors, so use with caution and be sure that your ebook distributor doesn’t reject the file due to failing EpubCheck. Or, compile for Epub 3 instead of Epub 2 by changing the configuration option Epub version.

For any given paragraph in a list, both the paragraph style and list style are used. Jutoh will ignore any indentation in the paragraph style and use only the indentation defined by the list style.

You can have multiple paragraphs per list item by placing the editor cursor just behind the bullet or number, and hitting the backspace key. This will turn the item into a ‘continuation’ paragraph without a bullet or number but with the same indentation as a regular list item. Note that for Kindle KF7 output, this is simulated by putting line breaks between list paragraphs since genuine multiple list item paragraphs are not possible in KF7 format. This compatibility formatting can be switched off in your configuration.

Jutoh will make an attempt to convert indented paragraphs in DOCX documents to continuation paragraphs according to the context, but if this is tripped up by complex formatting you will need to correct it within Jutoh by applying a list style and then ‘deleting’ the bullets.

Another way of creating list-like formatting but without using list styles is to use an indented paragraph style with a non-indented heading for the item heading. For example:

Apples

Apples are roundish in shape, and crunchy.

They come in a variety of, well, varieties, with Granny Smith being one of the most popular.

Bananas

Unlike apples, bananas are long, bendy and squishy.

They have their own convenient wrapper utilising a zip-like mechanism, and all too soon they turn black.

For more on list styles, see Chapter 13: Working With Style Sheets.

Summary

Now you’ll have a good idea of what’s possible with content editing and formatting, and how to accelerate your typing and styling using shortcuts and favourites. You can read more about styles in Chapter 13: Working With Style Sheets. It’s worth repeating an essential point: create and use named styles wherever possible, and don’t use direct formatting. When you come to tweak your book formatting, you’ll be glad if took this advice and planned ahead, rather than having to make potentially thousands of changes in your document.

Next, we’ll look at editing the project’s metadata – the information describing the book.


Contents | Start | End | Previous: Chapter 6: Editing Content | Next: Chapter 8: Editing Your Book’s Metadata