Robert Desprez Communications

  • My Services
  • My Blog
  • About Me
  • Contact Me
You are here: Home / Career Development / Controlling alignment and orphans in an EPUB file

Controlling alignment and orphans in an EPUB file

May 24, 2013 by RDesprez 4 Comments

Tweet

This blog entry explains some tips and tricks on how to con­trol align­ment and wid­ows and orphans in an EPUB file.

Some basics

An EPUB doc­u­ment is a zip file with the .epub exten­sion. EPUB files can be read using e‑reader soft­ware on many devices includ­ing the iPad, iPhone, PCs, and smart­phones run­ning on Android.

For tech­ni­cal writ­ers, I believe EPUB files are one of the tech­nolo­gies to watch. The iBooks book­store sells its e‑books in an EPUB file for­mat. With tablets and smart­phones out­selling PCs, users are increas­ing­ly read­ing content—including tech­ni­cal communications—on these devices. Help Author­ing Tools also make it easy to cre­ate EPUB files.

Controlling alignment

In your Help Author­ing Tool, you can spec­i­fy your text align­ment. Most of the time, tech­ni­cal writ­ers left-align their con­tent. But if you are view­ing your EPUB file on an iPad, it over­rides your align­ment set­tings and presents the con­tent as justified.

Here’s an exam­ple of jus­ti­fied align­ment on an iPad:

EPUB file shown on an iPad

For­tu­nate­ly, you can over­ride the iPad settings.

The eas­i­est way to do this is by ask­ing users to make a con­fig­u­ra­tion change on the iPad. As this is a pret­ty straight­for­ward change, I think it’s rea­son­able to ask users to fol­low a few steps.

To change the jus­ti­fi­ca­tion set­tings on your iPad:

  1. Go to Set­tings on your iPad.
  2. Go under your Apps set­tings and click iBooks.

Settings screen on an iPad

  1. Turn off Full Jus­ti­fi­ca­tion to over­ride the settings.
  2. Open an EPUB file in iBooks.

Your con­tent is then aligned the way you designed it.

Controlling widows and orphans

In some e‑readers, you can con­trol wid­ows and orphans. A wid­ow is the last line of a para­graph, marooned on one side of a page break. Here is an example:

Example of widow in an EPUB file

An orphan is a word, part of a word, or very short line that appears by itself at the end of a paragraph.

Using the Cas­cad­ing Style Sheet (CSS) in your EPUB project, you can con­trol wid­ows and orphans in Adobe Dig­i­tal Edi­tions and Nook. As of May 2013, you can­not con­trol wid­ows and orphans in iBooks.

Unzipping an EPUB

Com­plete the fol­low­ing steps to unzip your EPUB file: 

  1. Locate your EPUB file.
  2. Change the .epub exten­sion to .zip.
  3. Unzip the con­tents of the folder.
  4. Dou­ble-click the OEBPS fold­er (“OEBPS” stands for Open eBook Pub­li­ca­tion Structure).

Structure of EPUB

  1. Locate the default.css file. This is your CSS file.

Editing your CSS

Using a text edi­tor, type the fol­low­ing code that spec­i­fies the for­mat­ting for wid­ows and orphans.

widows_orphans_CSS

For the para­graph tag (“p”), the high­light­ed exam­ple ensures that at least two lines of con­tent appear togeth­er at the bot­tom or top of a page so that you don’t have sin­gle-line wid­ows and orphans. Of course, you can change the val­ue to what­ev­er you prefer.

Next steps

After you make changes to the CSS, re-zip the EPUB project, rename so it uses an .epub exten­sion, and test it on all the dif­fer­ent e‑readers that your users may be using. Dif­fer­ent e‑readers may ren­der your EPUB file dif­fer­ent­ly so test­ing is vital.

I am speak­ing about for­mat­ting EPUB files at the Cana­da West Chap­ter of the STC on July 16th, 2013.

Filed Under: Career Development, Help Authoring Tools, Online Writing for Mobile, Robert Desprez | Vancouver technical writer | Blog, Technology

Comments

  1. Jennifer White says

    May 30, 2013 at 2:48 pm

    Great post! Depend­ing on the tool that EPUB is gen­er­at­ed from, you can get these set­tings auto­mat­i­cal­ly added to the EPUB file. For exam­ple, you can use CSS in Mad­Cap Flare to do wid­ow and orphan set­tings as well.

    Reply
    • Robert Desprez says

      June 3, 2013 at 4:04 am

      Hi Jen­nifer,

      Thanks for the infor­ma­tion about MadCap!

      Reply
  2. Sandrine LAURENT says

    June 2, 2013 at 2:20 pm

    Thank you Robert. Your arti­cle is infor­ma­tive and interesting.
    EPUB files are definete­ly one of the tech­nolo­gies to watch.
    I won’t be in Cana­da for the Cana­da West Chap­ter of the STC on July 16th. Hope to see you in Europe some day.
    Yours.
    San­drine LAURENT
    00 33 6 60 81 14 61
    sandrine.laurent@maatea.fr
    http://www.maatea.fr
    MAATEA
    Founder & CEO

    Reply
    • Robert Desprez says

      June 3, 2013 at 4:05 am

      Hi San­drine,

      Thank you for your response. Glad you found it helpful.

      Cheers,

      Reply

Leave a Reply Cancel reply

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

About Robert Desprez

I have worked as a Vancouver technical writer for more than 20 years, working at some of British Columbia's largest high-tech firms. I have served in leadership positions for the Society for Technical Communication and have worked as a writing instructor at Vancouver's Simon Fraser University.

Robert Desprez Follow 1,149 239

Vancouver Technical Writer. Former Instructor at Simon Fraser University. Dog Lover. Coffee Drinker. Tennis and Piano Player.

robert_desprez
robert_desprez avatar; Robert Desprez @robert_desprez ·
26 May 1927021047175430324

How to throw a little luck into your career /via @globeandmail

Image for twitter card

How to throw a little luck into your career

What if you could create some of your own luck?

www.theglobeandmail.com

Reply on Twitter 1927021047175430324 Retweet on Twitter 1927021047175430324 0 Like on Twitter 1927021047175430324 0 Twitter 1927021047175430324
robert_desprez avatar; Robert Desprez @robert_desprez ·
20 May 1924848939888738806

Is AI helping workers and improving productivity or just creating more work? /via @globeandmail

Image for twitter card

Is AI helping workers and improving productivity or just creating more work?

To reap the full benefits of AI, companies must be more creative than using it to automate existing tasks, one expert says

www.theglobeandmail.com

Reply on Twitter 1924848939888738806 Retweet on Twitter 1924848939888738806 0 Like on Twitter 1924848939888738806 0 Twitter 1924848939888738806
robert_desprez avatar; Robert Desprez @robert_desprez ·
16 May 1923413647243559161

Image for twitter card

I Regret My Tesla | The Walrus

I wanted to be good. Then the car company fell from grace

thewalrus.ca

Reply on Twitter 1923413647243559161 Retweet on Twitter 1923413647243559161 0 Like on Twitter 1923413647243559161 0 Twitter 1923413647243559161
robert_desprez avatar; Robert Desprez @robert_desprez ·
16 May 1923413050498957392

Image for twitter card

Brian Chesky Lost His Mind One Night—and Now He's Relaunching Airbnb as an Everything App

Airbnb's CEO is spending hundreds of millions to relaunch his travel company as an all-purpose service app. Fitness!...

www.wired.com

Reply on Twitter 1923413050498957392 Retweet on Twitter 1923413050498957392 0 Like on Twitter 1923413050498957392 0 Twitter 1923413050498957392
Load More

Recent Blog Posts

  • ChatGPT: The AI-Powered Proofreader
  • Four Ways Confluence Could Be Better
  • First impressions of MadCap’s purchase of IXIASOFT
  • Online Conferences for Technical Writers in 2023

About Me

Robert Desprez I have worked as a Vancouver technical writer for more than 20 years, working at Kodak, Boeing, Teck Resources, and FortisBC. In addition, I have worked as a writing instructor at Simon Fraser University in Vancouver.

Contact Me

Robert Desprez Com­mu­ni­ca­tions Inc.
North Van­cou­ver, British Columbia
Canada
Phone: 604–836-4290

  • Email
  • LinkedIn
  • Twitter

Copyright © 2025  · Robert Desprez Communications Inc.