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,184 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 ·
2 Oct 1973868879261938086

Image for twitter card

The magic of AI is giving way to complaints about workslop

A team from Better Up Labs and the Stanford Social Media Lab define workslop as ‘AI generated work content tha...

www.theglobeandmail.com

Reply on Twitter 1973868879261938086 Retweet on Twitter 1973868879261938086 0 Like on Twitter 1973868879261938086 0 Twitter 1973868879261938086
robert_desprez avatar; Robert Desprez @robert_desprez ·
2 Oct 1973599012268941339

What a great website to book a BC ferry, if they are reserved. I just bought Vedran B a coffee on @buymeacoffee! 🎉

You can support them here —

Image for twitter card

Vedran B

I created https://nextsailing.ca as a free tool to help locals from the Lower Mainland and Vancouver Island book t...

buymeacoffee.com

Reply on Twitter 1973599012268941339 Retweet on Twitter 1973599012268941339 0 Like on Twitter 1973599012268941339 0 Twitter 1973599012268941339
robert_desprez avatar; Robert Desprez @robert_desprez ·
27 Sep 1972079492962439576

Image for twitter card

Opinion: Big Tech’s flattery of Trump is getting them nowhere

With the new price tag on H-1B visas, tech companies are learning that currying favour with Trump is a losing game

www.theglobeandmail.com

Reply on Twitter 1972079492962439576 Retweet on Twitter 1972079492962439576 0 Like on Twitter 1972079492962439576 0 Twitter 1972079492962439576
robert_desprez avatar; Robert Desprez @robert_desprez ·
23 Sep 1970576226126541085

Image for twitter card

Is AI the learning tool of the future, or should we be worried about its use in higher education?

Many students are already using AI to conduct research, summarize readings and write essays. On Machines Like Us, ...

www.theglobeandmail.com

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

Recent Blog Posts

  • Using ChatGPT to read smarter
  • ChatGPT: The AI-powered proofreader
  • Four ways Confluence could be better
  • First impressions of MadCap’s purchase of IXIASOFT

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.