Live data from Hacker News

Laying Out a Print Book with CSS

iangmcdowell.com

51–60 of 121 posts

Re: Laying Out a Print Book with CSS

#52
> It’s like Linux: free so long as your time has no value.

A better phrase would be: Free software is "free" as long as you value your free time, more then you value your time at work.

Re: Laying Out a Print Book with CSS

#53

As a former freelance book compositor, I can say there are typically many more details that go into laying out a book. To take this layout up a notch, I would want to create a baseline grid (set the line heights and paragraph margins to align text of different sizes). I would also want to control widows and orphans, which is built into CSS.

Does CSS support baseline grids? Since pagination isn't really a thing in CSS in guessing not?

Re: Laying Out a Print Book with CSS

#54
post #42

Earlier quoted context omitted.

> Proper typesetting is about achieving a consistent appearance starting from ligatures and kerning, then word spacing and hyphenation, up to entire paragraphs and pages. I looked into CSS hyphenation because I was curious about controlling hyphenation in ebooks. CSS hyphenation appears to be based around the principle that you manually insert HTML entities representing potential hyphen locations into every word, whi…

It’s crazy, and that’s why hyphenation doesn’t really work that way. Both TeX and web browsers use Liang’s algorithm to split words. [1] It uses so-called patterns, which are short substrings of words in which numbers indicate how to divide the word. For example, the pattern “s1h” indicates that in the word “fishing”, a divider can be inserted between “s” and “h”. Patterns compete and can override each other, and the…

> The splitting algorithm in CSS is worse than the one in TeX, because it has to work in real time and because (good) splitting patterns are often missing.

Surely that's only the case for real-time renderers like web browsers.

If you're creating a layout engine for printed media that uses CSS as the way for authors/setters to specify style, couldn't it implement a better, slower splitting algorithm? Using an internal (or pluggable?) dictionary of hyphenations?

Re: Laying Out a Print Book with CSS

#56
post #4

Interesting read, I find asciidoctor pdf and its theming guide extremely good to obtain nice results for books and articles, customizing it with CSS, fonts and more

I have written several books. I used Markdown for the first one.

Then someone recommended AsciiDoc and AsciiDoctor. It was a much better experience compared to Markdown. Sure, not for pixel perfect tweaking. Still enough parameters to play with. Easy to create PDFs and EPUBs.

Re: Laying Out a Print Book with CSS

#58
post #11
post #6

If the objective was not spend on design software, why not use latex?

Because conTeXt exists and is really much better at that sort of thing, having full native support for things like color, figures that GO WHERE YOU PUT (glares at latex floats). It can all kinda of fancy sidebars, infoboxes, all that InDesigny sort of stuff. You can tell it was built from the ground up for books, and not scholarly publications. In that respect it’s actually closer to plain TeX. It doesn’t try to be o…

You probably know that but for clarity's sake: OP probably meant why not LaTeX instead of the CSS+Chrome solution used by the author of the blog post.

I agree that ConTeXt would be a better fit than LaTeX.

Re: Laying Out a Print Book with CSS

#59
post #10

Earlier quoted context omitted.

Yeah. I was going to echo this sentiment but it looks like you pre emptively followed me. The article has the air of a hack done just for the fun of it because the author can. This was popular once upon a time but these days, it's mostly stuff written to promote certain things or as marketing copy.

This is marketing, don’t kid yourself.

Marketing that entertains (and informs) is perfectly ok.

Re: Laying Out a Print Book with CSS

#60
I keep thinking that what I'd really like is a substitute of latex that is based on markdown and CSS. This is a hint of what would be possible, although of course it would take decades to get to the power of latex.
Post reply on HN