Monday, September 10, 2012

pop-up footnotes in iBooks with Sigil

Liz Castro describes the basics of getting pop-up footnotes to work in iBooks but lacking an epub3 editor this feature is hard to explore. As a workaround, the current (epub2) versions of Sigil can produce epubs with pop-up footnotes that work in iBooks if the appropriate (epub) namespace is declared. e.g. here is the complete xhtml.

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>Book</title>
</head>

<body>
<p>worthy of a footnote <a epub:type="noteref" href="#ref">[ref]</a></p>

<p epub:type="footnote" id="ref">the footnote</p>
</body>
</html>

Sigil doesn't honor the <aside> tag, but styling <p> or <div> with "display:none" gives the same effect.

The resulting epub doesn't pass epubcheck but does work ok in iBooks.

7 comments:

  1. Great!! I was stuck with the aside problem since Liz didn't explain that!

    Thanks a lot Bill!!

    ReplyDelete
    Replies
    1. Glad it was helpful, and thanks for the feedback! btw, as you probably know, it seems that the current Sigil is ok with aside.

      Delete
  2. Thank you Bill, your post helped me a lot.

    ReplyDelete
  3. excuse-me, i want to create a pop-up footnotes, but can I create an another xhtml to insert text of the footnote ? I want to do a pop-up in the name by example : enterprise.
    Can I create an another xhtml to insert the corresponding text or not ?

    In Calibre, I don't see the pop-up but I see the text which describ the name enterprise, is it normal ?

    ReplyDelete
    Replies
    1. Charlene - it *ought* to work if you put (for example)
      href="../Section0002.xhtml#ref" in the anchor tag instead of href'="#ref",
      but the only program I found where this actually did work was Marvin (an iOS app). But not in iBooks or Calibre, so apparently the answer is no.

      And with Calibre, it looks like the page scrolls to the pop-up text (as does Sigil), but doesn't actually pop-up as it does in iBooks.

      Delete
  4. awesome awesome awesome. Thank you for this post!

    ReplyDelete
    Replies
    1. Yow! I'm surprised technology hasn't made this obsolete by now.

      Delete