gucci-on-fleek / lua-widow-control

(Lua)TeX package to automatically remove widows and orphans from any document
15 stars 1 forks source link

When removing widows with very narrow `\hsize`s, the last line sometimes isn't moved to the next page #19

Closed gucci-on-fleek closed 2 years ago

gucci-on-fleek commented 2 years ago

https://github.com/gucci-on-fleek/lua-widow-control/blob/caac52551430c8b57b3621c19e4b7cc8a9647596/docs/lwc-documentation.tex#L263

This issue isn't present with \hsize=9cm, but is present with \hsize=5cm.

gucci-on-fleek commented 2 years ago

https://github.com/gucci-on-fleek/lua-widow-control/blob/caac52551430c8b57b3621c19e4b7cc8a9647596/source/lua-widow-control.lua#L39

https://github.com/gucci-on-fleek/lua-widow-control/blob/caac52551430c8b57b3621c19e4b7cc8a9647596/source/lua-widow-control.lua#L175-L180

$ luatex \relax
This is LuaTeX, Version 1.13.2 (TeX Live 2021/W32TeX)
 restricted system commands enabled.

*\showthe\dimexpr25em\relax
> 250.00038pt.
<recently read> \relax

<*> \showthe\dimexpr25em\relax

?

*\showthe\dimexpr9cm\relax
> 256.0748pt.
<recently read> \relax

<*> \showthe\dimexpr9cm\relax

?
gucci-on-fleek commented 2 years ago

This may have been resolved with #28 (a828e94). Not sure…

gucci-on-fleek commented 2 years ago

LuaMetaTeX doesn't correctly add the \parfillskip glue, which meant that the line length calculations could sometimes be wrong.

https://github.com/gucci-on-fleek/lua-widow-control/blob/77d90394c96514ce163893f7ef1f125c6f02a5a7/source/lua-widow-control.lua#L293-L299

https://github.com/gucci-on-fleek/lua-widow-control/blob/77d90394c96514ce163893f7ef1f125c6f02a5a7/source/lua-widow-control.lua#L319-L324

Should be worked around since 592ff829ee9b4666e7842c069baa8e0b146cd2a8.