News for hackers. Stuff that matters.
Re:Get Your Book, Make It Free by AdmiralAsshat on Friday May 17, 2019 @09:28AM (#19939369)
Suggestion: Release your book as an EPUB rather than a PDF. PDF has the reputation of being view-able "everywhere", but it's not exactly pleasant to read on anything other than a computer screen or a large tablet.

EPUB's, however, can dynamically reflow the text and resize the font to be readable on your phone, your Kindle, your PC, etc. And they're far easier to cleanly convert to other formats (even PDF, if that's your only option) than the reverse direction.

Re:Get Your Book, Make It Free by crazygringo on Friday May 17, 2019 @01:51PM (#19941911)
If the book is pure text (like fiction), then sure.

But non-fiction often includes plenty of illustrations, sidebars, images, footnotes, and so on, which while EPUB can handle in theory, often wind up with all sorts of bugs in reality, things being out of order or not making sense or being clipped instead of resized when converting to PDF, etc.

I've found PDF's to be generally more reliable overall, and not too much of a problem on my phone for average-sized book pages -- I just hold my phone in landscape mode and pinch to zoom in enough so the phone doesn't waste space on margins on the sides.

The only PDF's that doesn't work for tend to be full-size textbooks (significantly larger than the average book page), but those are also the ones where layout tends to be the most important and I've had the most disastrous experiences with EPUB. Right now I just don't think it's realistic to read most textbooks on your phone in any format. (Plus you want to highlight, annotate in the margins etc., none of which is great on the phone anyways, but is great with a stylus/pencil on your tablet.)

Re:Get Your Book, Make It Free by ivan_ah on Friday May 17, 2019 @12:47PM (#19941307)
If the book contains lots of equations, ePub is not the best. The best thing I've found is https://github.com/softcover/softcover which can generate pretty decent ePub/mobi with math as images, but still not as good as latex-produced PDF.

The problem is, every single .epub reader renders things slightly differently so when you tweak your ePub to make it look good on device A, it ends up looking bad on device B. The fixed layout of PDF is certainly restrictive, but at least it's consistent.

Context: working for past year on producing a decent quality ePub for some equation-heavy books.

Re:Get Your Book, Make It Free by teekert on Friday May 17, 2019 @09:35AM (#19939433)
This. I recently subscribed specifically to some Google website, including all my work related info, to get an ebook on the state of Kubernetes. I was looking forward to it... And then they send me a PDF which is completely unreadable on my Kindle and I'm not going to read a whole book on my laptop. I really hate it when people call PDFs ebooks. Sorry :)
Re:Get Your Book, Make It Free by ZebZ on Friday May 17, 2019 @11:22AM (#19940429)
Amazon will convert formats for you so that it works on your Kindle.

https://www.amazon.com/gp/sendtokindle/email

Re:Get Your Book, Make It Free by ghaff on Friday May 17, 2019 @09:59AM (#19939653)
It really depends. Kindles are great if you're flowing a bunch of text. They can work fine with more graphics (although you're mostly back to using a tablet again) but the e-version really needs to be properly designed for it--e.g. avoiding sidebars and that sort of thing. Just a low-effort conversion can look pretty awful.
Re:Get Your Book, Make It Free by icxa on Friday May 17, 2019 @10:05AM (#19939704)
I have to disagree that they work fine with graphics, especially in low light conditions. It's downright terrible in my opinion. I have a kindle version of Calculus: Better Explained, and it's unreadable on my Paperwhite. I have to resort to the kindle app on a tablet or PC.
Re:Get Your Book, Make It Free by ghaff on Friday May 17, 2019 @10:56AM (#19940172)
I actually agree with you. I was being sloppy. Kindle format can work fine with photos/graphics on a tablet and even a smartphone. (I've actually come around to mostly liking eguidebooks because they're right on my phone and I don't need to xerox the relevant pages to carry around.) But, much as I like my Paperwhite, it's really just for reading text.
Re:Get Your Book, Make It Free by vram22 on Friday May 17, 2019 @03:23PM (#19942645)
Have you checked if Calibre or pandoc or any other ebook format conversion tool can get you the format you want? Calibre was mentioned on HN recently (probably earlier too) and pandoc keeps getting mentioned. Both have been around for a while.
Re:Get Your Book, Make It Free by UnFleshedOne on Friday May 17, 2019 @05:50PM (#19943909)
PDF is a lossy format, slightly better than an image, it can be really hard to extract legible data from it.
Re:Get Your Book, Make It Free by vram22 on Saturday May 18, 2019 @12:05PM (#19948157)
It's very much possible to extract legible (as you put it) data from PDF. It's just that it does not work 100% accurately 100% of the time. (And different libraries have different levels of accuracy.) But this is due to issues inherent in the PDF format. I know this because I worked on a project to extract text from PDF, for a startup client. They first gave me the work of researching various PDF text extraction libraries, hands-on, and evaluating them, and recommending one of them for use. I did that. Then based on that recommendation and report I gave them, they gave me the further work of using that library (from C), to extract text from a bunch of PDFs of financial data (think SEC data, EDGAR and the like - it was a fintech startup), and also further work of more processing of the extracted text data with Python. As part of all that work, I found that sometimes the text extraction was inaccurate, reported some bugs in the library (xpdf) to the company that makes it (Glyph and Cog), they fixed those bugs, etc. From discussions with one of the technical founders of G&C I got to know of these inherent issues, such as characters sometimes getting transposed, junk characters creeping into the output, etc.

Also, plug: I've available for consulting work on PDF generation (using other libraries or xtopdf, my own toolkit for PDF generation from other formats), and for PDF text extraction work. Contact info in my HN profile.

Re:Get Your Book, Make It Free by memling on Friday May 17, 2019 @11:17AM (#19940390)
> Release your book as an EPUB rather than a PDF. PDF has the reputation of being view-able "everywhere", but it's not exactly pleasant to read on anything other than a computer screen or a large tablet.

One compromise is to target a reasonable screen size in the PDF layout. Set your margins for a 6" viewable (or whatever you like to optimize for) and you should still get a reasonable experience on a tablet.

Re:Get Your Book, Make It Free by ultrafilter on Friday May 17, 2019 @12:18PM (#19940990)
If you're giving the book away, why not release the source (LaTeX, Word, whatever) in addition to your favorite subset of {PDF,EPUB,...}? Then readers who want a different format have a better chance of being able to produce it themselves.
Re:Get Your Book, Make It Free by contravariant on Friday May 17, 2019 @12:23PM (#19941046)
If used well EPUB is suitable as the source (more than Word anyway). It's generally just HTML with some metadata.

I think it is (in theory) even allowed to make an EPUB of LaTeX files, except that EPUB readers aren't required to support LaTeX (you're also allowed to provide both HTML and LaTeX, although the W3C probably expected people to use that part of the standard for audio-books).

Re:Get Your Book, Make It Free by AdmiralAsshat on Friday May 17, 2019 @12:24PM (#19941057)
Outside of dedicated enthusiasts, I don't think the average reader wants to take the time to "compile" their book.

Most commercial services these days (if my HumbleBundle books from O'Reily are any indication) simply provide pre-compiled editions in EPUB/MOBI/PDF format, as this seems to cover 95% of use cases.

Re:Get Your Book, Make It Free by Tyr42 on Friday May 17, 2019 @02:06PM (#19942061)
I did it once. Set the page size to match my kindle and recompiled.

It turns out there's a fair amount of tuning to make math expressions not run off the edge of the page.

Re:Get Your Book, Make It Free by coldtea on Friday May 17, 2019 @10:48AM (#19940084)
>Suggestion: Release your book as an EPUB rather than a PDF. PDF has the reputation of being view-able "everywhere", but it's not exactly pleasant to read on anything other than a computer screen or a large tablet.

On the other hand, it respects positioning, fonts, illustrations, and so on -- and is much better printed.

Re:Get Your Book, Make It Free by pfranz on Friday May 17, 2019 @03:48PM (#19942929)
When I first got into ebooks I tried buying everything in them. It really sucks when you have a reference book at home, but you need it at work. Unfortunately, code formatting is often terrible for ebooks--reflow ruins it. So I tend to prefer the PDF or a hard copy for anything that contains code.

For narrative books I prefer EPUB all the way. Release both if possible!

It also sounds like a lot of books a proofed as a PDF (I hear a surprising amount of publishing is still driven by MS Word). Like the article says, the author may not have a version of the book with proper layout.

Re:Get Your Book, Make It Free by lone_haxx0r on Friday May 17, 2019 @08:11PM (#19944753)
Please, no. A million times: No.

Either all desktop epub readers suck or the format itself is bad, but as an end user, I've never felt pleased with any epub ever. I've tried many readers, configurations, etc (I've even thought about making my own epub reader program that doesn't suck, but I haven't had any time.)

Epubs always look wrong: the formatting is all over the place, fonts look off, I don't even know what font I'm supposed to use. Calibre allows me to use CSS for styling, but I've never managed to do what I need.

I've spent many hours trying to like epub, trying to tweak Calibre so that it doesn't look like complete crap (e.g. setting good margins), but to no avail.

PDFs almost always look fine. I don't have to think about fonts, margins, etc. it just works.

Re:Get Your Book, Make It Free by OJFord on Friday May 17, 2019 @07:38PM (#19944599)
> Will there be an EPUB version?

> EPUB doesn't let us set a minimum length. EPUB also doesn't have line-folding glyphs. We are unlikely to release an EPUB or MOBI until they offer some way to deal with this problem.

> What big tech publishers do to get around this problem is embed low resolution jpegs of the source code in their EPUBs. This is a terrible solution and we will not put something out that does this.

> There's an e-reader formatted PDF which, on the 4 or 5 different Kindle models we've tested or seen it on, works great. No scrolling, no zooming in and out. Just works. Page turn your way through. For now, we're not going to release an EPUB.

http://haskellbook.com/faq.html

Re:Get Your Book, Make It Free by umvi on Friday May 17, 2019 @12:13PM (#19940942)
I write my books in markdown and use pandoc to generate PDF and EPUB.
Re:Get Your Book, Make It Free by alias_neo on Friday May 17, 2019 @12:18PM (#19940998)
How does pandoc compare to grip? I often need to render Markdown to PDF and find Grip is _ok_ but not great, and if I'm not mistaken it renders Github-side, where I'd prefer offline.
Re:Get Your Book, Make It Free by homarp on Friday May 17, 2019 @12:44PM (#19941276)
for those who might wonder, like me: https://github.com/joeyespo/grip a command-line server application written in Python that uses the GitHub markdown API to render a local readme file.
Re:Get Your Book, Make It Free by alias_neo on Sunday May 19, 2019 @05:49AM (#19952427)
Thanks, I should have linked grip!
Re:Get Your Book, Make It Free by umvi on Friday May 17, 2019 @12:30PM (#19941131)
I've never tried grip, but actually my pipeline is this:

markdown -> docx (pandoc)

docx -> kindle (calibre)

I use both pandoc and calibre as offline CLIs, and the resulting kindle book has a nicely formatted table of contents with correct chapter markers, etc.

Re:Get Your Book, Make It Free by trnglina on Saturday May 18, 2019 @04:53AM (#19946406)
I haven't used grip, but pandoc primarily (exclusively?) generates PDFs through LaTeX. It's great for quick, programmable, PDF generation, but personally, I usually prefer using pandoc to go markdown -> ICML -> InDesign.
Re:Get Your Book, Make It Free by decebalus1 on Friday May 17, 2019 @12:28PM (#19941100)
I agree with you on all accounts. I love epub for these exact reasons. However, Amazon doesn't support it. It's one of the reasons I haven't and I won't buy another Kindle when my current one dies (4 year old and the battery barely lasts 3 days). Was looking after the kobo but I heard mixed reviews about it's reliability so I'll end up reading all my stuff on the ipad.. I hope my eyes will not fight back.
Re:Get Your Book, Make It Free by AdmiralAsshat on Friday May 17, 2019 @12:34PM (#19941171)
I've had a Kobo Clara HD for about a month, so I'd be happy to answer any questions you might have about it.

FWIW, most of my eBook collection was purchased on Amazon before I got the Kobo, and it's been easy enough to download them all from Amazon and run them through Calibre to get them converted into an EPUB or KEPUB (special subset of EPUB that's better optimized for the Kobo) and get them onto the device.

You can go in the reverse direction as well. I regularly grab ebooks from wherever, strip away the DRM if I have to, convert to MOBI, and then email it as an attachment to the my email address associated with various family members' Kindles.

Re:Get Your Book, Make It Free by miki123211 on Friday May 17, 2019 @09:05PM (#19944962)
Even better suggestion, If you've used Markdown or similar to write the book, relese the source (and an artifact, i.e. EPUB). I have seen so many books that I wanted to read but couldn't, because EPUB and PDF aren't great when it comes to accessibility, particularly with maths and diagrams. Getting access to the Markdown source usually solved all of my problems.
Re:Get Your Book, Make It Free by la_barba on Friday May 17, 2019 @02:34PM (#19942270)
Can an author typeset their work using the EPUB format?
Re:Get Your Book, Make It Free by mkl on Friday May 17, 2019 @08:48PM (#19944899)
EPUB is an open standard, and many (often free) tools can target it, so yes.
Re:Get Your Book, Make It Free by barbs on Friday May 17, 2019 @10:44PM (#19945270)
Why not both?