Quantcast
Channel: ePUBSecrets » ADE
Viewing all articles
Browse latest Browse all 4

Two Default Styles to Add to Every InDesign to EPUB Conversion

$
0
0

InDesign’s Export to EPUB features are a huge step toward generating EPUB files without needing to hand write all of your code. Its ability to generate a CSS stylesheet from your InDesign styles is one of the major advantages, but it’s by no means perfect.

The good news is that InDesign allows you to add an additional stylesheets to your EPUB files. This allows you the opportunity to add additional styles you need without trying to muddy your print files. I’ll list two that I add to every EPUB file I create out of InDesign and explain each.

How to Add Additional Stylesheets

First, let’s talk about where to add these. While I will go into further detail about the Advanced Pane in a future post, for now Just choose File > Export… then select “File: EPUB” from the pulldown menu. Once the Export Options Pane pops up, choose Advanced from the left hand menu.

Screenshot 2014-05-22 18.02.39

Under the heading “Additional CSS:” click on the “Add Style Sheet…” button and then navigate to the css file you want to add. Once added, InDesign will remember this stylesheet during future exports so you may want to place it in a location that won’t get moved or lost.

You can add multiple stylesheets if you want. One option might be to add a basic stylesheet that contains fixes like below, and another for any fixes specific to the title.

On to the fixes…

A Fix for Nook devices

If you followed my instructions in the basic EPUB export settings and remove margins, you’ll find that Nook and Kobo devices and Adobe Digital Editions end up with zero margins on their pages. Here’s a quick fix to add to your stylesheet to overcome that issue:

@page {
	margin-top: 30px;
	margin-right: 20px;
	margin-bottom: 0px;
	margin-left: 20px;
}

Only Adobe Digital Editions and Kobo/Nook devices (which use a rendering system from Adobe) read the @page syntax. This adds some margin to the page without affecting other ereaders that have margins built into them. (FYI: These values come from Matt Harrison’s excellent Ebook Formatting book.)

Override Paragraph Indentations

If your InDesign title uses indented paragraphs, you may think those values are all you need. Unfortunately that’s not really true. If you set the indentation in points, InDesign will convert these to pixels which will not scale with font size changes and can lead to nearly invisible text indents. Here’s a fix.

p.indented {
	text-indent: 2em !important;
}

The key here is to make sure you apply this to the correct class. InDesign will convert your Paragraph style to a class by removing any spaces and using camelcasing. So if you have a paragraph style called Basic Indent the class will become .basicIndent. In the example above the Paragraph Style is simply called Indented. You also need to include the p tag in front of the class to override any styles InDesign might have applied. I add an !important declaration in there just to be safe. I find 2em to be a pretty good default text indentation setting.

Your Turn

These are the two styles I include initially, but I bet some of you seasoned InDesign to EPUB convertors have more to share.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images