2 ms·
AFAIK, TeX only gets really complicated when a document contains pictures (which it can move forwards or backwards relative to the text, if that leads to a bett
by Someone 5y ago
AFAIK, TeX only gets really complicated when a document contains pictures (which it can move forwards or backwards relative to the text, if that leads to a better layout)
For text, https://en.wikipedia.org/wiki/TeX#Hyphenation_and_justification https://en.wikipedia.org/wiki/TeX#Hyphenation_and_justificat... claims O(n²), with n the number of possible breaking points in a paragraph, or even O(nw), with w the width of a line.
As to the algorithm used by MacOS, that’s https://en.wikipedia.org/wiki/Cassowary_(software) https://en.wikipedia.org/wiki/Cassowary_(software) (also used by the scwm window manager)