View Single Post
Old 04-20-2013, 03:11 PM   #1
rplantz
Member
rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.
 
Posts: 21
Karma: 493474
Join Date: Mar 2011
Location: Northern California
Device: Acer A500
Program listings in ePub

Has anyone been successful at producing good looking program listings in ePub?

I have self-published (at Lulu) one programming book that has over 100 program listings. I wrote that book in LaTeX, and the ebook version is pdf. It looks great.

I am starting my second programming book. There is not a good workflow from LaTeX to ePub, so I have started with restructuredtext and processed it with Sphinx. The HTML version is very nice. The ePub version is nice in Calibre, but when I load it onto my Andorid tablet, things are pretty bad. For example, the line numbers do not align with their respective code lines. Line wrapping makes it very difficult to read the code.

The equations I use in the book are simple algebra, so I can probably live with the lack of math support in ePub. I converted the vector graphics to svg, and that seems to display nicely.

I hope that ePub3 will solve some of these issues, but there are still many ePub2 devices out there. Is pdf still the format of choice for books that have lots of computer programming code?
rplantz is offline   Reply With Quote