View Single Post
Old 04-21-2013, 12:24 PM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by rplantz View Post
There is not a good workflow from LaTeX to ePub, [...] 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 format is just not suited for this sort of thing (reflowable text + extremely precise layouts for code sections). You say that the HTML version looks fine, but the EPUB looks horrible (on Android)... Mind giving a sample of the HTML code that looks nice? It could be that the way that the HTML is laid out is something that does not work in EPUB at all.

Also, what reader are you using to read it on Android? There are many of them out there, and it could be rendering errors with the reading program itself.

If the lines of code are not too long, perhaps you could take advantage of some negative indents to help clarify seperate lines of code. (See attached test EPUB + image).

Quote:
Originally Posted by rplantz View Post
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.
There is this thing called Mathjax, which you can use to embed in your books:

http://www.mathjax.org/resources/epub-readers/

Although, doing this will limit the programs the users will actually be able to use to read the EPUB... but you will get beautiful scalable/copy/pastable equations.

There was also this topic a while back, you might get some tips out of it:

https://www.mobileread.com/forums/showthread.php?t=73914

Quote:
Originally Posted by rplantz View Post
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?
Yes. PDF would still be your best bet. EPUB is just not well suited for complex documents such as this... BUT, you might be able to make it look ok.

As a last resort, you would be able to create an image of sections of code, and have those throughout the EPUB (very ugly... but compatible). Text in images though does not scale very well on the tiny devices.
Attached Thumbnails
Click image for larger version

Name:	CodeBlock.png
Views:	344
Size:	27.9 KB
ID:	104684  
Attached Files
File Type: epub CodeBlockExample.epub (2.2 KB, 227 views)
Tex2002ans is offline   Reply With Quote