Preparing RTL InDesign files for EPUB
Electronic Publication, also known as EPUB is an e-book file format with the extension: .epub, that can be downloaded and read on devices like smartphones, tablets, computers, or e-readers. It is a technical standard and published by the International Digital Publishing Forum (IDPF).
EPUB defines a means of representing, packaging, and encoding structured and semantically enhanced web content — including XHTML, CSS, SVG, images, and other resources, for distribution in a single-file format.
EPUB 2 was initially standardized in 2007 as a successor to the Open eBook Publication Structure or “OEB”, which was originally developed in 1999. In October 2011, EPUB 3 superseded EPUB 2 when EPUB 3.0 was approved as a final recommended specification.
Preparing RTL InDesign file, to be exported as EPUB
Before you can export a high-quality ePUB file from InDesign you must prepare the files for export.
Organized Content Flow
Organize your content into a one text flow, if possible, remember to set the story direction to be from right to left like below:
Set the Language Setting For the Document
Set the language for all the documents by assigning the language to all the paragraphs and character styles like below:
Use Latin Numbers Only
For the right to left documents, do not use Hindi or Farsi numbers, as only English and Arabic numbers (1, 2, 3, ..) will appear correctly in EPUB files.
Be Careful With Diacritic
Always give extra attention to the diacritic position and view especially if it is related to the right to left documents. You must adjust the diacritic setting and review it carefully before you publish.
To set the diacritic setting, see below:
There is no recommended combination of settings, just choose the best for your publication. Below you can see the most common setting, but you may need to change it depending on the publication nature.
Divide Long Documents Into Separate Files if Needed
If the document is too long or contains a lot of footnotes and/or any other items that make the file slow, then it is recommended to split the document into many files based on logical order and then combine all the documents together in an InDesign book file (File > New > Book).
To split the document at a certain level, you need to set the below option on the Paragraph Style Options – see below:
To complete the action, you need to select the below when exporting to EPUB.
Anchor Graphics and Design Elements
Images and other document elements, such as sidebars and callouts, need to be anchored within the main body of the text, so they are incorporated with the text when it reflows.
An anchored object is part of a paragraph, and will always appears in line with the specific paragraph when viewed in an eBook reader.
Apply Paragraph and Character Styles
The most reliable way to ensure that your formatted text is preserved in the exported EPUB file is to apply the paragraph and character styles to all the text in your document.
When doing this please make sure to:
- Set the direction of the paragraph, character, and table style to match the right to left direction
- There must be NO overrides
- Style naming is particularly important, do not use Arabic letters as style names
Create a table of contents
A table of contents (TOC) is an essential element of any eBook because it allows a reader to quickly jump to specific sections. Two kinds of TOCs can be included in an eBook: a TOC located at the beginning of the eBook and one that functions as a navigation menu in an eBook reader.
Creating an automatic TOC in InDesign depends on using styles to allow InDesign to recall to the TOC page. InDesign allows you to add the styles you want to include in the TOC, assign certain styles to each entry, add page numbers or exclude them, and many other options.
To create a TOC that functions as a navigation menu, you must set up a TOC style by choosing Layout > Table of Contents Styles. You can then specify the TOC style when you export the EPUB file, then InDesign uses it as the basis for generating the TOC.
How to export to EPUB
After the file has been correctly formatted, it is time to export it to EPUB. To export a document, choose: File > Export > EPUB (Reflowable).
Below a list of options that are included in this window:
- Version – Choose either EPUB 2.0.1 or EPUB 3.0.
- Cover – On the cover, you have three options:
- None: it is recommended to use this option and create the cover page at the start of your document
- Rasterize the first Page: this will outline the first page of your document. It is OK if you are sure 100% that you will not need to change anything in your image because it will not be editable if you used any of the EPUB editors
- Choose Image: this allows you to choose the image from any location on your device. This is like “None”, except that you must be sure about the size of the image you choose
- Navigation TOC —you have two options:
- File Name: this will show the file name only in the TOC Navigation Tab on the EPUB viewer
- Multi-Level: (TOC Style): this means that you will have complete TOC of the document contents. Please refer to the “Create a table of contents” section for more details
There are 3 options in the ‘Content’:
- Split Document —you have two options:
- Single Paragraph Style: For this option, you can choose the specific paragraph style from its drop-down, however, in this case, only one paragraph style can be chosen.
- Based on Paragraph Style export tags: using this option you can choose more than one style to split the document into the required sections.
Remove Forced Line Breaks —forced line breaks can cause problems when a document is converted to EPUB. Problems can occur when we leave the line breaks in the document, but also when we simply remove them to understand the issue clearly.
After exporting to EPUB there is still some work to be done in the CSS and HTML files to set the fonts, unicode, direction to match the RTL language needs.
For Unicode use: <?xml version=”1.0″ encoding=”utf-8″?>
For direction use: <div id=”_idContainer009″ class=”Basic-Text-Frame” dir=”rtl”>
For Language use: <dc:language>ar</dc:language>
ePUB is the preferred format for a broad range of publications. It is considered essential for creating documents adhering to the best practices regarding accessibility. Today, ePub formats are embedded in many systems and workflows for document authoring and publishing and it is not just a distribution file format.