6 ms·
This article completely misses the point. Proper typesetting is about achieving a consistent appearance starting from ligatures and kerning, then word spacing a
by DeinFreund 4y ago
This article completely misses the point. Proper typesetting is about achieving a consistent appearance starting from ligatures and kerning, then word spacing and hyphenation, up to entire paragraphs and pages. Each character has to be typeset considering what character came before, how many words are in the same line and other lines in the same paragraph. The choice of font is also questionable, but not the main issue except for capitalized sections.
This example from the article says it all: https://iangmcdowell.com/blog/book_breaks.png https://iangmcdowell.com/blog/book_breaks.png
I understand that LaTeX is convoluted and other software is expensive, but when offering an alternative, there should at least be a comparison based on the quality of typesetting.
- rhn_mk1 4y agoI think the article stated the point clearly: the author wanted to hold some paper carrying the HTML contents. From what I can see, they hit the point completely. Perfect is the enemy of the good, they say.
- thaumasiotes 4y ago> 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, which is obviously insane. hy­phen­ation hy­phen­ation hy­phen­ation hy­phen­ation The TeX way is to provide a set of hyphenation points once, such that, if a word needs to be hyphenated, that list can be consulted and the word can be hyphenated appropriately without each instance of it needing to be entered with several invisible HTML entities. \hyphenation{hy-phen-ation} hyphenation hyphenation hyphenation hyphenation I can't think of any use case where I'd prefer what is apparently the only way to do it in CSS. Do epubs have a bespoke non-CSS way to handle this? (I looked into this in the first place because the Kindle mobile app is godawful at hyphenating words, and I wanted to know what it would take to write an ebook that didn't have obvious howlers. The errors occur in foreign words, but they violate the rules of hyphenating English -- I've seen the app place a hyphen before the first vowel in a word, and I've seen it render "Qis-han", which is exactly equivalent to a hypothetical English "fis-hing" -- so it seems like they must be using a lookup table for all English words and falling back on something completely ridiculous for words that aren't in the table.)
- winety 4y agoIt’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 whole thing is quite complicated. As for your example with Qishan — the “s-h” probably overrides the “i-s” pattern. (There have been a number of articles in TeX journals that explain the algorithm, such as [2].) In CSS, automatic hyphenation must be explicitly turned on, see [3]. In TeX and in CSS, hyphenation points can be marked explicitly: in TeX with the \- macro and in CSS with the ­ or U+00AD character. In TeX you can also override the automatic division with \hyphenation{}. 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. [1]: https://www.tug.org/docs/liang/ https://www.tug.org/docs/liang/ [2]: https://www.fi.muni.cz/usr/sojka/papers/euro01.pdf https://www.fi.muni.cz/usr/sojka/papers/euro01.pdf [3]: https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens
- Karellen 4y ago> 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?
- eat_veggies 4y agoYou could probably write some JS to reimplement the better algorithm and insert the ­ hyphenation hints
- winety 4y agoYou could and that's basically what TeX does, just without the CSS. There are even typesetting systems similar to (La)TeX, that can take XML as input, see Context [1] or Sile [2]. They’re just a step away from using HTML + CSS. Why isn’t there such system? I do not know. [1]: https://wiki.contextgarden.net/XML https://wiki.contextgarden.net/XML [2]: https://sile-typesetter.org/ https://sile-typesetter.org/
- mprovost 4y agoI chose to use InDesign to typeset my self-published book, and I have to say the quality it produces from just placing some imported text with no other changes looks 1000 times better than this. It's easy to go down a rabbit hole and start really tweaking the layout but if all you're doing is applying some CSS anyway then you can produce better output with InDesign's defaults in about 5 minutes. I've been writing the book in Google Docs and printing chapters for review as I go, and it's nice to see a physical copy of your work. But I was blown away when I made my first PDF copy with InDesign how much better the typesetting is. It really does feel like a proper book and not an essay that I printed out for a school assignment.
- edent 4y ago> This example from the article says it all: https://iangmcdowell.com/blog/book_breaks.png https://iangmcdowell.com/blog/book_breaks.png What does it say? I read lots of book and... it looks like every other book. What am I missing?
- mikeryan 4y agoSo properly justifying text for a print layout is hard. For example on the right page, the sentence that starts with “Marcos wondered”. You start to see how in the first line it’s fairly widely spaced but the second line starts to look like the line was crammed in to fit the line. It’s subtle but those are the kinds of things that proper print layout tools help with. It’s weird looking at one page in a vacuum you won’t notice as much but after a few pages it starts getting “harder” to read. I’ve noticed this with some E-books and started to pick up on it.
- Izkata 4y agoThose are just like (almost) all books. "Proper" typesetting like LaTeX does seems to only be a thing in a very small subset.
- lelanthran 4y agoSee the RHS of the page, see the column of space after "detected gunfire" and "counterinsurgents". In fact, the spaces are all over the place.