3 ms·
Next, someone should put that in LaTeX to automatically fix it rather than just detect it. (Or some sort of HTML/JS plugin, since using LaTeX again is somewhat
by mcav 14y ago
Next, someone should put that in LaTeX to automatically fix it rather than just detect it. (Or some sort of HTML/JS plugin, since using LaTeX again is somewhat disconnected from my immediate life goals).
- fusiongyro 14y agoI wouldn't hold my breath. This sounds like a huge, messy, heuristic coding effort to solve a rare, über cosmetic problem. TeX and typography in general seem to attract really obsessive folks, but this doesn't strike me as harboring a hidden ideal that's computationally well-defined and feasible the way other parts of TeX turned out to be. I guess we'll find out if somebody does it.
- jamesjporter 14y agoI like the idea that mistercow proposes above: use an algorithm to sample the space of possible typsettings and find one with less that some minimum amount of rivers or river length.
- fusiongyro 14y agoI get that, but here's the problem: there's no guarantee that any perturbation isn't going to produce more rivers. It's guess-and-check. For simulated annealing to work, you have to believe that large perturbations are more likely to produce large differences and small ones produce small differences. I am not convinced that property holds here, because a river is an optical phenomenon that doesn't directly relate to the spacing size, which is the one variable you're interested in manipulating. A small change in space might have a small effect on the river you noticed, but create an entirely new and worse one. Another problem with simulated annealing is that you want to start with large changes and work your way to small changes, but TeX has already optimized the spacing, so you would really rather start with small changes. Your next problem is that TeX doesn't know what glyphs look like, just how much space they take up. If the "riverbanks" are made up of As and Vs, the river will be extremely pronounced. But it may not be noticeable at all if they're made up of Ms and Xs. Worse, it will also depend on the font in play. But TeX doesn't know what the glyphs look like while it's adjusting the whitespace, so you now need to introduce a feedback loop between the eject-page phase and the paragraph layout phase. I'm under the impression you'd be jumping over three or four phases to do that, because TeX lays out lines first, then paragraphs, then emits pages. This is a huge amount of work. How big a problem are rivers?