Thanks for coming to InDesignSecrets.com, the world's #1 resource for all things InDesign!

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.

Tags
Related Articles
Comments

9 Comments on “Preflighting eBooks for Overrides

  1. If I export from ID CS5 to EPUB and select to preserve local overrides, which would be for character attributes like italic and bold, why would I have to search and replace those with a character style? I just exported some text that had some of the italics as character styles and some as locally styled attributes and there’s not all that much difference between the two in the xml (and they both appear properly italicized when viewed with ADE). Here’s a snippet showing the coding differences:

    ———–
    The air was still, which was odd on the vast lake where they lay anchored. No sound of birds either, no early morning chatter, and that, too, was strange. He walked down the hallway, past the room where his sister-in-law and her husband slept, past the rooms of his two daughters, onto the stern deck with its swim platform. He stood at the railing, looking across water as black as engine grease.
    ———–

    The only difference is that “no-style-override-1″ is longer than “ital”, but they work the same.

  2. Oops! Coding fell out. Here’s what it should look like (angle brackets shown here as parentheses):

    The air was still, which was odd on the vast lake where they lay anchored. (span class=”no-style-override-1″)No sound of birds either,(/span) no early morning chatter, and that, too, was strange. He walked down the hallway, past the room where his sister-in-law and her husband slept, past the rooms of his two daughters, onto the stern deck with its swim platform. (span class=”ital”)He stood at the railing,(/span) looking across water as black as engine grease.

  3. Richard-

    You’re right that you don’t have to clean up your styles or code in those instances to get the formatting you want. On the other hand, I have seen ADE get confused pretty easily when there are local overrides at both the character and paragraph level to the same text. In the example in this blog post, ADE made the entire last paragraph bold.

    http://indesignsecrets.com/wp-content/uploads/2011/02/Picture-52.png

    In order to have the most predictable outcomes (and to save yourself some confusion if you ever have to edit the EPUB), it’s wise to always stick with styled text.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>