A new HTML5/EPUB3 version of the book

From the introduction to Unofficial Texinfo Format:

Things go in spirals. We explored the powers of Texinfo and LaTeX at typesetting the PDF book. Now it’s time to come back to HTML. This year it shall be HTML5. “It can be a dangerous place, but it’s our last, best hope for peace.” (Sinclair, Babylon 5.) Does the peace endure after the browser wars? Anyway, the aim of the project is to approach the quality of LaTeX output by using the HTML5 toolbox. JavaScript, CSS3, SVG, MathJax, MathML, and web fonts are employed here. Due to the experimental nature of this enterprise, there will be glitches and errors in some browsers. Technical and artistic help is appreciated. In the meantime, enjoy the book, and fire up a REPL!

For online reading: web version
For offline reading: epub
Source repository: sicp

There are only a few apps that render the epub3 version fairly, but still not correctly. Readium, Azardi Desktop, and iBooks are almost there. While we wait for the other readers to mature, we can read the HTML5 version in a browser (tested in latest Firefox, Chrome, and Safari).


33 thoughts on “A new HTML5/EPUB3 version of the book

    • You’re welcome! I’m curious, how well does Kindle DX support embedded fonts and such? Can you see small capitals, ligatures, and oldstyle numerals (in References), for example?

      • Oh well. My mistake. I used your latest PDF version, form which I have cut margins and I read that on Kindle DX – it looks flawless.

        I have tried to convert Epub to Mobi and all pretty characters are shown as signs.

      • OK. PDF seems to be a better format in Kindle now, until they start to support math and better CSS typography in KF8. I was just wondering if Kindle DX has a web browser that is capable of displaying HTML5 pages. I was testing a few e-ink readers in the bookstore, none of them could render the embedded fonts in browsers.

      • Browser included into Kindle DX is not very advanced (ie does not support all fancy unicode characters). That is 100%.

  1. The HTML5 version is very impressive, while encountering the EPUB one I have trouble.
    Is there any reader could render it well enough as it should be?

    And one more case for information.
    I tried to upload it to Google play, but it had been rejected.
    For curiosity I ran a epubcheck on it; a lot of error messages just came out.

    By the way, original Kindle system just doesn’t support EPUB format.

    • Thanks! Out of desktop EPUB3 readers, Azardi Desktop 26 and Readium display MathML pretty well, but won’t abide the typography settings in CSS. I’ve yet to see a tablet or mobile app that renders EPUB3 with MathML successfully. How the HTML5 version looks in Firefox and Chrome is pretty much what I wish the future EPUB readers would support. Safari falls a bit short of this by not displaying smallcaps and oldstyle numerals.

      You’re right, epubcheck complains a lot, it doesn’t like the SVG files. Inkscape seems to produce SVGs with nonstandard tags, but Azardi and Readium have no trouble displaying the diagrams anyway. I suspect the EPUB file ought to be spotless before Google Play accepts it. Maybe I can clean up the markup in the future if it’s not too much of a manual work. I think epubcheck is not aware of the whole SVG 1.1 spec — it forbids RDF, which is odd.

      Kindle won’t support epub directly, but I’ve heard there are utilities (like kindlegen) that convert epub3 to Kindle formats. I guess the source epub must be error-free before the conversion succeeds. But I hardly expect any of the math to survive after the process.

      EDIT 2014/02/23: The SVG images are now cleaned up and the epub file passes validation without errors.

  2. Hi.
    Thanks for all your great works!
    I’m trying to translate your PDF(texinfo) version into Japanese. Translation has almost done. I want to publish my translation at github.com as a fork of yours.

    I noticed a one problem. I don’t know from when, but today MIT opens their SICP full text under the license CC-BY NC 3.0, but yours is under the CC-BY SA 3.0. I want to respect both original license and your license. So I’d like to publish my Japanese translation under CC-BY NC SA 3.0. Is that OK to you?

    • Yes, of course you can use the BY NC license. MIT’s license was BY SA when I started to work on my latest version. Looks like they reverted. I’ll keep the SA until challenged.

      I’m glad to hear about your work. Great to see people of such ability and service. Translation is a much bigger effort than a mere redesign and typesetting. Looking forward to see the result!

      • Thank you for your prompt reply and giving me a permission to use CC BY NC-SA.

        I checked the history of MIT SICP site with Internet Archive,

        Here’s the result.
        2001/01/24 Full Text Open started without explicit license.
        2008/04/04 CC-BY NC
        2011/10/07 CC-BY SA
        2013/09/04 CC-BY NC

        It’s interesting that they changed the license two times.
        The link within the site at 2011/10/07 directed to CC-BY SA site correctly, so I believe
        they chose CC-BY SA at the time on purpose, not by accident.
        But they changed their mind and chose back to CC BY NC.

        I believe you can keep CC BY SA cause it was actually released under the license for two years. And maybe, I can inherit CC BY SA from your license, but I’ll choose NC-SA anyway.

        I think I can release my translation next week.

      • Great, thanks for the info. I’m excited to hear that your version is so near completion. I don’t know Japanese, but it would be a delight to see your design and the tools you used.

  3. Hi. I released my Japanese translation at http://github.com/minghai/sicp-pdf/

    The file named jsicp.pdf is Japanese translation of your SICP PDF edition.
    The file named ejsicp.pdf contains both English and Japanese. I used this for debugging.

    When I saw your PDF of SICP in 2011, it was my dream to translate it into Japanese, and finally, my dream comes true.
    Thank you so much for your contributions for UTF and opening the source to public.

    Have a nice day!

  4. Here’s a side-by-side of Calibre and Kobo displaying the same chapter (Dedication) https://imgur.com/8quNI6M — it looks good on the Kobo, and completely skewed in Calibre.

    Of course the fonts are absolutely gorgeous in Calibre 😉

    Some aretefacts, such as `R⁴RS` cannot be displayed on the Kobo, again, dis is probably because of the font it uses, and due to the fact that it appears to lack the capacity to accessing the embedded font.

    • Good to know how it looks on various devices. Thanks for the picture.

      In my version of Calibre (1.43) it renders almost like in a web browser, no skewing. There are minor font issues, like missing ligatures, smallcaps, and oldstyle numerals. In your picture the text column is very narrow, maybe you can adjust the margins?

      How does the Kobo display math and figures? Do the footnote links and other hyperlinks work?

  5. Thank you very much for your work. I find the PDF and the HTML5 versions you have created much easier to read.

  6. Thank you for sharing the book. But due to increased popularity I meet an issue to access the book from GoogleDocs. It says “Sorry, you can’t view or download this file at this time. Too many users have viewed or downloaded this file recently. Please try accessing the file again later.”
    Could you please make any additional place for hosting the book (DropBox or RapidShare for example).
    Best Regards,

  7. I used Calibre to convert the EPUB3 version to MOBI for reading on the Kindle. There are a few symbols don’t show up properly, but the vast majority (I’d say 99%) of the book is completely readable, even on my Kindle Paperwhite (5th generation, released October 2012).

    Here’s link to the MOBI:

    Thanks to all for the hard work and for sharing! 🙂

    • I’m very glad to hear about this. I checked your MOBI in the latest version of Calibre. What I noticed is that the math is missing and figures look peculiarly distorted. Other than that the text looks fine. I wonder whether your Kindle reader fares any better and displays math? Thanks a lot for your effort!

  8. Pingback: A Beautiful On-line Version of SICP | Irreal

  9. Very curious: do you know how the text-based figures/diagrams from the Unofficial Texinfo source file were/are converted to the beautiful SVG in the HTML 5 version? If this was a handcrafted process, it must have been a true labor of love. If there was some tool used to automate the process (Ditaa maybe?) I would love to know more about it.

    • The vector diagrams are handmade with Inkscape. Ditaa is something I haven’t seen before, but looks very interesting. It is converting to bitmap images for now, and the project looks to be in hibernation, but I see a bright future for the idea.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s