4 ms·
I 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 r
by jamesjporter 14y ago
I 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?