Open-Advice/Open-Advice

Proper E-Reader / Kindle Version

Opened this issue · 8 comments

The PDF although it loads well will work better if a proper E-Reader / E-Pub / Kindle(mobi) version would be available for reading. Main issue with the PDF is that the letters are to small on a 6 or 7 inch reader.

Also a proper front cover would be nice!

Amending the e-paper with the original cover is no problem if Lydia puts it into Git. The e-paper version is a bit trickier, we probably need to do a new main tex file with less fancy stuff (not needed for HTML output anyway), so the pdf2html tools no longer fail. I've tried a couple, none of them worked out of the box with satisfying results.

Being a bit more precise, e-paper means epub and mobi, so basically what's needed is a clean html conversion.

The mobi and epub files compile great for me in versions 1.0-23 to current (1.0-26). Nice work. I have copies of them at: http://staff.washington.edu/high/doc/open-advice/ Also, I have updated my documentation and patch for the 5" pdf. --Brian

I just tried Brian High's mobi version on my 6" kindle and it works and looks great.

Great news, @JeroenSchaftenaar . I had only tested in Calibre. By the way, I see now that the main difference between the MOBI and EPUB versions are that the EPUB is not "justified" as the MOBI version is. This can be fixed with the --change-justification justify option to ebook-convert. It is much nicer to read "justified".

*** Makefile.orig   2012-02-07 13:10:23.000000000 -0800
--- Makefile    2012-02-07 13:10:41.000000000 -0800
***************
*** 29,34 ****
--- 29,35 ----
    # requires calibre
    ebook-convert $< $(basename $<).epub \
        --cover $(COVER) \
+       --change-justification justify \
        --authors $(AUTHORS) 

  %.mobi:   %.html

Another fix... while the PDF has a TOC with two levels (Part and Chapter), the MOBI and EPUB versions do not. They just have the Part in a one-level TOC. This can be fixed by using the options --level1-toc '//h:h1' and --level2-toc '//h:h2' with the ebook-convert command.

*** Makefile.orig   2012-02-07 14:43:57.000000000 -0800
--- Makefile    2012-02-07 14:46:04.000000000 -0800
***************
*** 30,42 ****
    ebook-convert $< $(basename $<).epub \
        --cover $(COVER) \
        --authors $(AUTHORS) \
!       --change-justification justify

  %.mobi:   %.html
    # requires calibre
    ebook-convert $< $(basename $<).mobi \
        --cover $(COVER) \
!       --authors $(AUTHORS) 

  clean:
    -rm -rf Open-Advice.pdf Open-Advice.log Open-Advice.toc Open-Advice.aux
--- 30,46 ----
    ebook-convert $< $(basename $<).epub \
        --cover $(COVER) \
        --authors $(AUTHORS) \
!       --change-justification justify \
!       --level1-toc '//h:h1' \
!       --level2-toc '//h:h2'

  %.mobi:   %.html
    # requires calibre
    ebook-convert $< $(basename $<).mobi \
        --cover $(COVER) \
!       --authors $(AUTHORS) \
!       --level1-toc '//h:h1' \
!       --level2-toc '//h:h2'

  clean:
    -rm -rf Open-Advice.pdf Open-Advice.log Open-Advice.toc Open-Advice.aux

The last issue I see with the TOC in the ebook formats is that the roman-numeral Part number runs into the Part name. This is not a problem in the PDF. Although there must certainly be a better way, the following Perl hack fixes the problem:

perl -pi -e \
  's|<span class="titlemark">(Part[^<]*)<br />|<span class="titlemark">$1 <br />|' \
  Open-Advice.html

It simply adds a space after the Part name. (I suppose a &nbsp; might be a little better.) I am hoping this could be more elegantly handled in the source LaTeX document, etc., but I really don't know.

Another way to fix that using ebook-convert options is:

ebook-convert $< $(basename $<).mobi \
   [...] \
   --sr1-search '<span class="titlemark">(Part[^<]*)<br />' \
   --sr1-replace '<span class="titlemark">\1&nbsp;<br />'

It would be nicer to use something like:

--extra-css 'span .titlemark { padding-right: 5px; }'

... but the padding CSS options do not seem to be supported in MOBI.

Anyway, this fix works for both MOBI and EPUB -- without requiring the perl hack.