Live data from Hacker News

Pagination widows, or, why I'm embarrassed about my eBook (2023)

clagnut.com

111–120 of 137 posts

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#111
post #20

Not to mention the ugly/unusable rendering of mathematical formulate in ebooks on my Kindle, which is gatherig dust. Layouting is an art and a craft, and the fact that it's automated by people who lack the specialized knowledge, or for whom it is not a priority (quarter century old bug reports, really?) suggests that in 2025, you should still avoid ebooks if you care about quality and aesthetics. This is a shame beca…

If this is is still a problem thirty years after the invention of the web, then I say: So much the worse for mathematical notation. In the future, mathematical ideas will be expressed in other ways.

You severely underestimate mathematicians' ability to cling to older more convenient forms of expression.

I imagine blackboards and chalk will be used in advanced mathematics for a few centuries yet.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#112
post #20

Not to mention the ugly/unusable rendering of mathematical formulate in ebooks on my Kindle, which is gatherig dust. Layouting is an art and a craft, and the fact that it's automated by people who lack the specialized knowledge, or for whom it is not a priority (quarter century old bug reports, really?) suggests that in 2025, you should still avoid ebooks if you care about quality and aesthetics. This is a shame beca…

Blame the (metal) compositor unions which back in the day bargained for sinecures where all their members were guaranteed perpetual employment rather than choosing to participate in the digital revolution.

Fortunately, some folks did work to preserve the craft and beauty of books --- Dr. Donald Knuth taking a decade off from writing _The Art of Computer Programming_ to create TeX (though initially he thought he'd do it over a sabbatical) is one shining example.

Robert Bringhurst's authoring _The Elements of Typographic Style_ also made a huge difference (I've lost count of how many copies I've given as gifts to folks).

A further issue is that doing a good page layout over an entire chapter (or book if the pagination is continuous) is an NP-hard problem --- I've had a chapter come out correctly on a first pass exactly once in my career (fastest 40 minutes of my life). The usual work-flow is something like:

- check all characters to ensure that hyphens are properly set, en and em dashes replace them where appropriate, and correct the setting of any instances of what should be special characters such as prime or double primes

- assign all formatting and ensure that all heads and paragraphs have settings which will forbid widows/orphans and verify that the callouts for all figures/photos/tables are correct

- review the entire chapter from beginning to end, page by page, verifying that each ends as it should at the bottom of the page, and that a referenced element shows on that page spread

- for instances where things don't work out, check to see which paragraphs can be adjusted to run longer or shorter by one or more lines, adjusting this until one finds a set of adjustments which results in a proper appearance for the page/spread --- repeat for all future pages --- if a particular spread/figure placement is a problem, back up and see if changing previous pages will fix it --- check the last page to ensure that it is full enough, if not, adjust previous spread, if that doesn't work, see if running the entire chapter long or short by a line will fix it.

- review the entire chapter again to ensure that there are no bad breaks or stacks, add discretionary hyphens or non-breaking spaces or adjust paragraph settings as necessary, ensuring that pages still base-align

If someone wants to write an ePub reader or page formatter which can do that, I'd be glad to see it.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#113
post #18
post #6

Earlier quoted context omitted.

I don't know if it would fix splitting across pages, but that sounds like negative margins. They've been in CSS forever. The basic idea: .heading { margin-bottom: 30px; } .paragraph { margin-top: -30px; } Also: > the heading could instead claim it needs three lines, which would ensure it would never be orphaned It wouldn't prevent being orphaned at this point in your idea. What if there was room for 3 lines at the en…

I'm not sure the proposed approach would work, in particular on ebook readers. But if if does, I believe margins may not be the right way to do it. Padding might be however, because it is actually inside the box (while margins of elements may be "blended" inside the margins of their parents). h2 { padding-bottom: 3em; } h2 + p { margin-top: -3em; } The problem is CSS doesn't support the lh unit yet so what's 3em here…

That worked quite nicely:

https://jsfiddle.net/bqjsu98o/

However the next problem is how do you tell the print renderer that paragraphs must have a minimum of 4 lines of text?

(Edit, hah! https://developer.mozilla.org/en-US/docs/Web/CSS/orphans )

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#114
post #64

Earlier quoted context omitted.

But zooming scales the fonts only. For pixel images you have the pixels that are in it and that's it. Scaling those either up or down does not produce good text. Now I'm just waiting for the inevitable "AI image scaler" that handles text inside images.

> Now I'm just waiting for the inevitable "AI image scaler" that handles text inside images. I'm surprised this isn't a thing already, as it seems doable with what people called "AI" 20 years ago. I mean, unless some unusual/non-default font was used, upscaling text on an image should be almost trivial. Ligatures notwithstanding, "printed letters" have a fixed shape, so: 1. Identify the typeface, size, weight, etc. b…

> I'm hedging here; it feels to me that OCR-ing normal text that never left the digital realm should be 100% reliable, but I'm not a specialist in that subfield so I surely must be missing something...

A string set in a given font at a given size won't always render as a fixed pattern of pixels. The font describes the curves of the letter forms and how that's rasterized depends on lots of factors such as the zoom level, exactly how the font rendering engine is implemented, whether or not anti-aliasing is turned on which is further complicated by the fact that the text can be set in any color with any other color as a background, etc. And there are a LOT of fonts.

Lastly, OCR is not just about recognizing letter shapes but has to contend with how the text flows. It has to understand line-breaks, multi-column layouts, captions, pulled quotes, page-numbers, hyphenation and all the other weird shit that we make text do.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#115

Earlier quoted context omitted.

PDFs are in Letter (rarely A4) format, quite simply, to be printed on Letter paper :) The computer screen view is secondary.

Yes, but today most of them never exit cyberspace. Wouldn't it be more reasonable to consider that instead of printing? Edit: Also, are there any advantages with large papers like A4/Letter for physical prints, except that you can fit more on a single page?

It’s as simple as most consumer printers printing A4/Letter, and most paper being A4/Letter.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#116

Earlier quoted context omitted.

Like you mention, HTML already exists for adaptive text reflow. I assume that people making PDFs want their layouts fixed. But maybe an A5 format would make more sense, even if you're printing it? Also: What did people screw up with HTML in your opinion?

> Also: What did people screw up with HTML in your opinion? The problem with PDFs is that you need to create multiple layouts to make them look good in print and on a variety of commonly used screen sizes; all those layouts is extra work. HTML, by its very nature, doesn't have this problem, and yet somehow today we still have to design multiple layouts to support print and common screen sizes. And in practice, we usu…

If you make your PDFs in A5, you can print two of them on an A4 paper and read the paper in landscape orientation. For the same reasons the size fits well for displaying on a computer screen and on a tablet/e-reader. It's still a bit too big to squeeze down to a cell phone, but at least better than A4/Letter size.

As for responsive HTML, it's the responsibility of the designer to make it work if he/she is worth their salt. Like you say, HTML without CSS is already responsive. If businesses understood that there are a big segment of customers who will always use their computer and never their phone when it's time to make a purchase, perhaps they'd be better at it.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#117

Earlier quoted context omitted.

One question: Why do people make PDFs in A4 format? Wouldn't it make better sense to start making them in A5 or A6, so that they could be better read on e-readers, phones, and on part of a computer screen (which is landscape oriented)?

Surely the only difference between an A4 PDF and an A6 one would be text size?

Probably also column layout. 2-column documents are fine for A4 sizes, but terrible for A6 or most e-reader screen sizes. Scroll down, then up & across, then down, then across, then repeat. Versus just scroll down or just turn pages.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#118

Earlier quoted context omitted.

Yes, but today most of them never exit cyberspace. Wouldn't it be more reasonable to consider that instead of printing? Edit: Also, are there any advantages with large papers like A4/Letter for physical prints, except that you can fit more on a single page?

It’s as simple as most consumer printers printing A4/Letter, and most paper being A4/Letter.

The more I think about it, the more I'm getting convinced that A4/Letter was a mistake. Maybe we'll see something like A5 as a standard in the future, that would be neat.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#119
When I published my first book, I had to learn all about ebook best practices and ended up writing a book about the state of the art in 2012.

Sad to see how little we've moved on in twelve years.

On a semi-related note, Typst had similar issues but the devs are actively working on fixing issues like this.

Re: Pagination widows, or, why I'm embarrassed about my eBook (2023)

#120
post #5

If you think it's bad that `break-*` isn't supported in Firefox or Chrome, wait till you see what your ebook looks like in Kindle, or worse, ADE-based readers, of which there are still many in use! Kindle, the reading device with by far the largest market share, is basically the IE6 of ereaders - too big to ignore, and at the same time dragging down the entire ebook ecosystem with its crappy renderer. Amazon has show…

Is there a caniuse for ebook readers?

I wrote a book a while back that for every feature has a "chapter" using the native rendering and a second version of the chapter with an improved CSS applied.

https://www.amazon.com/Ebook-Formatting-KF8-Mobi-EPUB-ebook/...

Post reply on HN