Hacker News new | ask | show | jobs
by tcpl 2558 days ago
For those who write eBooks, what is the best output format? I am planning to write a introductory book on deep learning which is going to contain a lot of math and code. I find LaTeX as the best way to author math stuff but I don't know if I can generate .mobi and .epub files from it.

Are the .mobi and .epub formats even worth it?

Would it be simpler to just output an A6 format PDF that can be viewed alike on desktop as well as eReaders?

2 comments

I'm doing a book project now and thought I should try to escape LaTeX and went with HTML/CSS paged media through weasyprint. Don't do it. The technology is not quite there yet. Go with LaTeX.
I use pandoc+xelatex to convert GitHub style markdown to pdf [1] I've also noted down other options in the last section of the blog post, which I think should get you started.

I haven't yet been able to generate a decent looking epub/mobi for technical books with code snippets. And these also depend on which reader user has. I've been asked by a few to support these formats, but majority are happy with pdf.

[1] https://learnbyexample.github.io/tutorial/ebook-generation/c...

Thank you for sharing your insights. Can you share more details about what issues you with epub/mobi for generating technical books? Do you have any experience with machine learning and math content? If generating epub/mobi for technical books is a problem I am guessing it would be even more of a problem to generate good looking epub/mobi with math content.
Issues with epub/mobi: pandoc gives me error which I didn't put much effort to get it resolved. I tried a sample book generation using rstudio and the resulting epub was bland compared to pdf (no syntax highlighting for code, spacing isn't pleasing between code and text, etc) - I searched a bit and found that I'd need to know learn a lot about CSS to get better results. A book from another author on leanpub (the platform allows you to generate all types from single source) was remarkably poor to read on my desktop epub reader compared to pdf (again no syntax highlighting, spacing issues, etc). Do try to compare same book in pdf vs epub/mobi if you get the chance.

No experience with ML. Have read a bit of content for Python+Math, but only as pdf.