How to maintain font size in ePub 3 output?

I posted on this topic last year, and I thought I understood the answer. But now I’m confused again and would like a bit more help.

I have a paragraph that, in Editor, contains two different font sizes. When I compile to ePub 2, the font sizes come out as they appear in Editor, When I compile to ePub 3, however, all text appears in a single font size. Here is an image of how the ePub 2 and ePub 3 files appear in iBooks.

For ePub 3, I think I need to do two things. First, I need to apply a Style in Editor to the appropriate text. And second, I need to do something in the Styles in Compile > Edit Format > Styles tab. But I’m not sure how to set up these entries. If someone has time to look at the attached test file and adjust the Ebook Custom format with the required entries, I would appreciate it. Thank you.

Please note that I removed all Styles from the test document so that I could more easily see what entries are needed.
Test - Font Size.scriv.zip (105 KB)

You’ll need to define a character style that includes the font size for each style that you want to be different from the bulk of the text. In your example you need four styles set up - small blue regular, small blue bold, small blue italic, and small blue bold-italic. I’ve attached your project updated with these styles, and you’ll see it exports fine.

The reason you need four styles is that character styles save italics, bold, colour and so on.

If the small text was confined to its own paragraph (rather than having a mix of text sizes inside a paragraph) and you didn’t need colour, you would only need a single paragraph-only style, not four character styles.

The attached project includes four styles to demonstrate this:

Blue Small Regular, Blue Small Bold, Blue Small Italic, Blue Small Bold-Italic: these are used in the first paragraph to add small, blue and italic/bold etc to the words, as in your example.

Small Text: this is a paragraph-only style and is applied to the third paragraph, which only uses this style and outputs using small text.

All the best,
Keith
Test - Font Size.scriv.zip (96.7 KB)

Thank you Keith. I’ll admit I’m still confused about when I need to use Styles (and when I don’t need to) with ePub 3, so your response helps a lot. I see that all the Styles you created are in Editor. No styles were added in Compile > Edit Format > Styles, so it looks like I can accomplish my goal working in Editor only.

Thanks again!

Yes, you only need to add styles to the Compile format if you want to override them so that they look different in the compiled document from how they do in the editor.

In general, for ePub 3, you should use styles for anything other than simple bold, italics and centring. This is because of how everything is done through CSS.

All the best,
Keith

This thread is an ePub compile manual reduced to a haiku. By paring down, it speaks with such clarity.