RTF –> EPUB with a layover in InDesign
I worked on a large conversion project recently, creating EPUB files out of almost 200 RTF files. I needed to move them out very quickly so I invested a little time in figure out the most efficient means to a finished product that was possible. I am sharing my process here with the caveat that it was specific for this project, and this publisher. That said, it has some universal efficiencies which some of you might find useful.
The InDesign Layout
The one thing that made this conversion project stand out from other bespoke conversions, is that this specific publisher want a very plain vanilla ebook with as little design intervention as possible. I fact, I wrote a basic CSS that worked for every title in the bunch. The key, then, to making one CSS file work for a variety of content was to go into the source file to make certain that they were all structured in precisely the same way.
One quirk: importing the RTF files directly into InDesign (using the CC version) often meant that I would lose italics and other formatting. I never did figure out why. As RTF was my only source file for these conversions, I would open them in Word and resave as a “.doc”.
Importing the doc into an InDesign template would bring in unwanted style sheets so I was careful to tiptoe around those. One of the first steps after import, was to do a global search for any styles applied at the character level — italics, bold, superscript, for example — that I wanted retained after I stripped out the Word style sheets. As the vast majority of the titles in this project were fiction, it was mostly just italics that I was searching out, applying an “italic” character style that was mapped to export as a simple
<em> tag, without a class. I would then apply the paragraph style “normal” to the entire document and delete the unwanted Word styles, if any. Styles that tagged along from Word will be marked in the paragraph style sheets window.
In the simplest title, the stylesheet selection looked like this:
I have set them up, as you can see, with keyboard shortcuts for hyper-efficiency. One of my developers or I would whizz through a long 500-page novel in about 30 minutes applying paragraph styles to the chapter number and title, removing indents form the paragraphs directly after a header with the “noIndent” style. The idea at this stage was to impose a clear structure onto a loose, amorphous document.
(Some titles had poetry that required a hanging indents, block quotes with varying space before and after needs. More complex titles went in to a template with a fuller set of styles. For the purposes of this piece, I have chosen to keep it simple.)
Part of the InDesign template also included some clear, simple style sheet mapping. From the above set you can see in this screenshot how I have mapped everything to straightforward HTML tags.
A note: the title of the book is an
<h1> tag as is the chapter number. This is how I prefer to structure for EPUB. Also, the emit CSS toggle is switched on but later in the export process, I will opt to attached a homemade CSS and won’t bother at all with the CSS that comes from InDesign.
Structure is now clearly applied, character styles are where I want them, indents are doing what they are supposed to. As this client wants EPUB 2 (because they work with retailers that aren’t EPUB3 ready yet), and MOBI, the next step is to generate a table of contents. I am careful to make sure that the TOC is exported as a standalone HTML file so that I can point to it in the
<guide> in order that my Kindle ebook is created with an navigation document in place.
An aside: I could export without an inline TOC and would counsel EPUB only clients to do that. Because an EPUB comes with built-in navigation (from the NCX or NAV document), an inline TOC is repetitive. But in the interest of creating one file that will push to EPUB retailers and to Amazon, we have opted to include the inline TOC in this set of conversions.
I generate a TOC from a very simple table of contents style that I opt to call “epub”.
Putting an <h1> styled header before the auto-generated content will ensure that I have a standalone HTML file because I opted to break the HTML at the <h1> in that style sheets definitions.
Exporting to EPUB
Command-E, opt for reflowable EPUB will get you a powerful set of controls. In this first screen, I have opted for EPUB2 code, to attach a JPEG cover (RGB, sized at just south of 3.2 million pixels), and have pointed to the TOC style that I already set up. The other important piece on this screen is to toggle on the split document based on paragraph style export tags – so that the HTML will split at the <h1> level.
Under text, I leave most of the fields at defaults as below:
If there were images in my ID files, I would opt to keep those relative to the page width in the object menu. As it is I leave the items on the Object and Conversion Settings tabs set to default.
Under the CSS tab, I will opt not to emit CSS and ask InDesign to swap in my custom-built CSS file.
Because I have already been careful to fill in as many fields as possible in the File –> File Info panel . . .
much of the book’s metadata field will already be filled in in this export window.
And that’s it!
Each title gets a full QA sweep to check for quirks in the process. I also open up the EPUB to add a guide to the OPF, and some marketing material to the back of the book. When the QA is done, the EPUB is converted to MOBI via Kindle Previewer and a second QA sweep is performed.
I am always interested in efficiencies. If you have any ideas about how to smooth out this process, please do leave a comment.
About the Author
Laura Brady is principal at Brady Type, a full-service book design studio specializing in ebook development, custom training, and general publishing problem solving. Laura also teaches and develops custom training programs for publishers. Laura is one of the founding planners behind the annual ebookcraft conference. You can connect with Laura in any of these places: