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,144 237

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 ·
2 May 1918126029463536113

This productivity poison is exhausting you /via @globeandmail

This productivity poison is exhausting you

Constantly shifting your attention undermines what is your super power in most knowledge jobs. How you anticipate an...

www.theglobeandmail.com

Reply on Twitter 1918126029463536113 Retweet on Twitter 1918126029463536113 0 Like on Twitter 1918126029463536113 0 Twitter 1918126029463536113
robert_desprez avatar; Robert Desprez @robert_desprez ·
24 Apr 1915491435350253736

Google forcing some remote workers to come back 3 days a week or lose their jobs

Image for twitter card

Google forcing some remote workers to come back 3 days a week or lose their jobs

Several units within Google have told remote staffers that their roles may be at risk if they don't start showin...

cnb.cx

Reply on Twitter 1915491435350253736 Retweet on Twitter 1915491435350253736 0 Like on Twitter 1915491435350253736 0 Twitter 1915491435350253736
robert_desprez avatar; Robert Desprez @robert_desprez ·
16 Apr 1912364221582758283

Image for twitter card

As Canadians cancel trips due to Trump, the U.S. tourism industry could lose billions

The Trump administration's attacks on its northern neighbor have been met with confusion and anger by some Canadians...

www.npr.org

Reply on Twitter 1912364221582758283 Retweet on Twitter 1912364221582758283 0 Like on Twitter 1912364221582758283 0 Twitter 1912364221582758283
robert_desprez avatar; Robert Desprez @robert_desprez ·
13 Apr 1911507080504303659

Image for twitter card

How to awaken Canada’s sleeping economic giant

Recent interviews with industry leaders and experts point toward 10 areas where actionable strategies are needed – ...

www.theglobeandmail.com

Reply on Twitter 1911507080504303659 Retweet on Twitter 1911507080504303659 0 Like on Twitter 1911507080504303659 0 Twitter 1911507080504303659
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.