How to use InDesign's Anchored Objects to create quality ebooks

Ron Bilodeau is the Production & Design Specialist for O'Reilly Media, Inc. He's using InDesign to develop seamless workflows for easily exporting print- and web-ready PDFs, as well as EPUB and Mobi digital book formats, from the same source files. In addition to his InDesign work, Ron is also working with the O'Reilly Atlas team where he is developing custom stylesheets for this new and exciting (fully automated) digital publishing platform. He will be at ebookcraft 2017 to give a workshop about Leveraging InDesign for All It's Worth.

Think InDesign can’t provide quality ebook output? Think again. By applying certain rules, you can effectively eliminate the need for a separate workflow and leverage InDesign for all it’s worth. Let's look at how to use Anchored Objects to create great EPUB files.

What are Anchored Objects?

In InDesign, an Anchored Object is a frame (or group of frames) that contains text, images, graphics, or tables (or a combination of two or more of these). There are three types of Anchored Objects in InDesign:

  • Inline

  • Above Line

  • Custom

The reason for anchoring an object in InDesign is to maintain that object’s positioning on the page, relative to the corresponding text. In addition, the anchor also determines the object’s positioning when exported to HTML or EPUB.

Inline Objects

An Inline Object, in InDesign, is any object that is placed directly and visually into the text flow. A common example of this is a small graphic (or icon) that is placed directly into a paragraph. For example:

Another common example of this type of placement is when a larger object is placed inline into an empty paragraph.

In both examples, above, if the text is edited or reflowed in any way, the inline objects will move accordingly.

Above Line Objects

Anchored Objects that are set to above line are placed in a way similar to my second inline example, above. As you can see from the panel options (to the right), Above Line Objects have additional alignment and spacing options that can be applied.

Custom Anchored Objects

Custom Anchored Objects are special because they can be placed anywhere on the page and then anchored accordingly. As you can see in the example (below), the photo is placed in the bottom right corner, but the anchor is placed at the end of the first paragraph (the dashed blue line shows the anchor placement of the image). There are lots of settings in the Custom panel, which can be quite daunting, but most InDesign users will likely never need to manually adjust those. For the most part, all you need to do is click and drag the object in order to change its position.

Grouped Objects

As I mentioned previously, an object can also contain a group comprising different types of frames. A common example of this is an image with a caption. In the below example, you can see that the Inline Anchored Object is an Object Group that contains a photo frame and a text frame. This is a very common way to keep photos and captions together.

What happens to these objects on EPUB export?

Each type of Anchored Object has different default settings for when it's exported to HTML or EPUB. 

Inline Objects will always be rasterized (i.e., converted to pixel-based images). Even when the object contains live text, the text will be rasterized. There is no way to change this setting for Inline Objects.

By default, Above Line and Custom Anchored Objects will retain live text when exported to EPUB. If the desired result is to have the object rasterized, that setting can be changed in the Object Export Settings panel.

Why is this important to know?

In my experience, it is very common to group caption text with images and then anchor them as Inline Objects within the text flow (just like the Grouped Objects example, above). However, since InDesign will always rasterize the caption text in this scenario, it's not ideal. I prefer to keep the caption text “live” when exporting to EPUB.

How to get around this

Fortunately, for this particular scenario, there is an easy solution. Instead of having to change up my entire workflow, I can simply set my Inline Objects to be Above Line Objects. 

For my Grouped Object example (above), in addition to changing it to Above Line, I will also need to adjust the Space Before and Space After settings (right).

In addition, if you are using Object Styles to manage these settings, making this one change there will update your objects globally.

All of the image and caption groups will now export to EPUB with the desired result of keeping the groups together and retaining live text.

For more great InDesign-to-EPUB tips and tricks, come to Ron's workshop, Leveraging InDesign for All It's Worth. You can register for the conference here.