michal-h21 / linebreaker

Some excersises with luatex's line breaking callback
15 stars 1 forks source link

Question: How does this differ from \sloppy #1

Closed poetaman closed 2 years ago

poetaman commented 3 years ago

In past I had observed that using \sloppy would make words not stick out. How does using this package differ from that?

michal-h21 commented 3 years ago

When you use \sloppy, you must apply it to a problematic paragraph. This package can detect the overflowing paragraphs and fix them automatically. It applies the same parameters as \sloppy (tolerance and emergencystretch), but it increases their values from defaults in smaller steps, and it stops once the paragraph doesn't overflow. In most cases, it should stop on much smaller emergencystretch and tolerance than \sloppy. In the worst case, the values are the same as in \sloppy. But there is still the advantage that you don't need to edit your document.

This package is still experimental, I haven't tested it with math, footnotes or anything more advanced. It is also possible that it don't set correctly some node properties. So more testing is needed.

I plan to add keyval interface to the LaTeX package, so the values of maximal tolerance, emergencystretch and number of steps that are tried could be adjusted.