Preflighting eBooks for Overrides
Since I'm about to be knee deep in the world of ePublishing at the Tools of Change conference, I thought I'd pass on a tip or two that can help you avoid freaky formatting when you create ebooks from InDesign.
The issue: formatting that does not come from styles (aka local overrides). We all know it's a no-no, sloppy, unprofessional, etc. And we all do it from time to time. C'mon, it's OK to admit you command-shift-i (at least on the weekends, after the kids are asleep). But in real work, it can create problems. And that's not going to change in the Brave New World of ebooks.
When you export to EPUB and generate CSS, your ebook formatting is derived from paragraph and character attributes, through the use of styles and local overrides. You can eliminate inconsistencies by ignoring local overrides when you export to EPUB, but that may leave out some formatting you want to keep. So to be sure you get correct and consistent formatting throughout your ebook, it is important to remove or replace local overrides with styled text.
Here are three paragraphs that should be formatted indentically. But the second and third paragraphs have local overrides.
A peek inside the EPUB shows the effects of the local overrides in the code.
The first paragraph has no overrides in InDesign, so its element has a class matching the applied paragraph style name ("pscs5-objective"), and a single span for the run-in head matching the applied character style name ("pscs5-run-in"). Good good.
The second paragraph has a character-level override in InDesign (an italicized word), so its element has a second class ("pscs5-objective-override"). That's not necessary to italicize the word, but it's not hurting anything here. A second span is created around the italicized word to preserve its formatting.
The third paragraph has a paragraph-level override in InDesign (a measly 1 pixel extra space after), so it too has an extra class ("pscs5-objective-override-1"). Plus the span from the character style has an extra class ("pscs5-run-in-override"), and the text after the run-in is wrapped in an extra span with yet another class ("no-style-override-1"). Three extra classes and a span because I accidentally added one extra pixel space after.
Can you imagine how many classes and spans you might get in a long document full of overrides? I don't know about you, but I'm about to close my laptop and go open a falafel stand. It's class warfare! Stop the InSpanity!
OK, seriously, I do understand why it works this way. I asked InDesign to Preserve Local Overrides in my EPUB export, and it's just marking every range of overridden text. Fair enough. Be careful what you wish for, right? And despite the extra classes and spans, these paragraphs do render OK in Adobe Digital Editions and iBooks. But there's certainly the possibility that this kind of inconsistency and complexity will yield unhappy results at some point. And it may make things a lot trickier if you ever have to edit the HTML or CSS.
Fortunately, there's a clear remedy: get rid of all local overrides. Either remove them or replace them with styled text. This may have some real repercussions for your workflow (i.e. it may not be practical to use the same InDesign file for print and EPUB). Anyway, just finding every last override can be a pain. There are a few things you can do to make this task easier. One is to create a preflight profile to flag all overrides as errors.
Then you can use the Preflight panel to go through the document and hunt down all overrides.
One thing to be aware of: the Preflight panel won't display overrides in overset text. But overset text will be included in the EPUB. So you might also want your profile to flag overset text as an error.
If you need a faster, more automated solution, check out Blatner Tools Plug-ins for InDesign. Among its many features, Blatner Tools gives you the ability to convert all overrides to actual, factual styled text.
Also check out Anne-Marie's post on scripts that convert overrides to styled text.
You could also make use of a script called ShowHideLocalFormatting by Marc Autret, author of the blog Indiscripts. It works in both CS4 and CS5. Cari blogged about the script on her site last year, but it didn't occur to me what a nice tool it is for an EPUB workflow till now.
The script displays red strikethroughs on text with character-level overrides, and red bars to the left of lines with paragraph-level overrides.
You've heard of Overprint Preview. Well, this is Override Preview. And for EPUB workflow, it's Span and Class Preview. In your EPUB, all the text marked with red will be wrapped in span elements with "override" classes. Like the preflight profile approach, the script won't help you find local overrides in overset text.
Before you export to EPUB, whether you use a preflight profile, a plug-in, or a script, take the time to deal with overrides, so you can be sure they aren't lurking in your code, waiting to foul your formatting or crimp your cascading style.