Free As In Freedom, Second Edition

eBook of Free As In Freedom, Second Edition

Important Notice

Please note that the contents of this page are very old, and therefore some of the techniques explained are quite rudimentary.

I only performed basic automatic text manipulation to obtain the XHTML files from which I compiled the eBook version. Therefore, the resulting XHTML is not really tidy, but it is W3C compliant, and the generated EPUB is valid according to the IDPF validator. If you want to (manually?) clean the XHTML source up, feel free to do so. In case, I would love to receive a copy of the final file(s), thanks!

Short story (for the impatient)

You can get an ebook version of Free as in Freedom (2.0): Richard Stallman and the Free Software Revolution, Second Edition:

Long story (for the expert)

This is a quick guide to generate an ebook version of Free as in Freedom (2.0): Richard Stallman and the Free Software Revolution from its original LaTeX source files.

The tools needed are: a text editor, Bazaar, TeX4ht, Python, Calibre, Sigil.

Comments are welcome, especially if you point out mistakes or you have useful suggestions: just drop me an email.

Step-by-step guide

Go to /tmp/ directory (or a working directory of your choice)

$ cd /tmp/

Create faif2 directory:

$ mkdir faif2

Move to the latter:

$ cd faif2

Grab the LaTeX source:

$ bzr branch http://bzr.savannah.gnu.org/r/books

Keep only the faif2 directory:

$ mv books/free-as-in-freedom-v2/* .
$ rm -r books/

Using your favourite text editor, change line 10 of faif-2.0.tex to:

\documentclass[10pt]{book}

and save it.

Several files contain some \url links to be fixed, for example \url{stallman.org} should be \url{http://stallman.org}. Use the following command to find them:

$ grep url *tex | grep -v http

and correct them with a text editor.

Use TeX4ht to create an HTML file:

$ htlatex faif-2.0.tex "xhtml,mathml" "-cunihtf" "-cvalidate"

Get parseFootnotes.py Python script:

$ wget http://www.albertopettarin.it/faif2/parseFootnotes.py

Run the script to fix the links/backlinks to/from footnotes:

$ python parseFootnotes.py < faif-2.0.html > faif2.xhtml

Convert the fixed HTML file to EPUB (with no cover image) using Calibre:

$ ebook-convert faif2.xhtml .epub --no-default-epub-cover

(OPTIONAL) Open the generated EPUB file with Sigil:

$ sigil faif2.epub

and edit its metadata, "Generate TOC from headings", and save it.

(OPTIONAL) convert to MOBI (or any other format you like) using Calibre:

$ ebook-convert faif2.epub .mobi

Links

Acknowledgments

If you enjoyed reading this eBook with your eReader, you can send me a "thank-you" email.

If you really enjoyed this eBook and you feel really grateful to me for writing this script, I would really love to receive a (reasonably recent) 9-inch e-reader or tablet for testing purposes.

If you really really enjoyed my work on this project and you think my brain can help you, I am always glad to hear about job collaborations!

In all three cases, contact me via email, thanks!