Knuth-Plass Line Breaking With River Penalties
Baseline paragraph breaking uses classic box/glue/penalty scoring. Extension adds vertical space-alignment penalties so justified lines can avoid visible rivers while still preserving Knuth-Plass style badness and fitness evaluation.
explicit spacing per line
post-hoc detected river overlay
beam search keeps search tractable
Paragraph Input
Display Mode
Controls
Toggles
Detector-Guided Reranking
Generate a small set of candidate layouts with different river-penalty settings,
score each on classical demerits + river severity, and pick the
best. River severity is a geometry surrogate — it uses the same chain
features the neural detector was trained on, but does not run the U-Net live.
See docs/detector-guided-reranking.md.