diff options
Diffstat (limited to 'macros/luatex/generic/lua-widow-control/lua-widow-control.sty')
-rw-r--r-- | macros/luatex/generic/lua-widow-control/lua-widow-control.sty | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/macros/luatex/generic/lua-widow-control/lua-widow-control.sty b/macros/luatex/generic/lua-widow-control/lua-widow-control.sty index f5db525ab4..ad3e95a28a 100644 --- a/macros/luatex/generic/lua-widow-control/lua-widow-control.sty +++ b/macros/luatex/generic/lua-widow-control/lua-widow-control.sty @@ -13,7 +13,7 @@ \DeclareRelease{}{0000-00-00}{lua-widow-control-2022-02-22.sty} \DeclareRelease{v1.1.6}{2022-02-22}{lua-widow-control-2022-02-22.sty} -\DeclareCurrentRelease{v2.2.2}{2022-08-23} %%version %%dashdate +\DeclareCurrentRelease{v3.0.0}{2022-11-22} %%version %%dashdate % If this version of LaTeX doesn't support command hooks, then we load % the last v1.1.X version of the package. @@ -23,8 +23,8 @@ \ProvidesExplPackage {lua-widow-control} - {2022/08/23} %%slashdate - {v2.2.2} %%version + {2022/11/22} %%slashdate + {v3.0.0} %%version {Use Lua to remove widows and orphans} % Message and String Constants @@ -76,6 +76,10 @@ emergencystretch .value_required:n = true, emergencystretch .initial:x = \dim_max:nn { 3em } { 30pt }, + draftoffset .dim_gset:N = \g__lwc_draftoffset_dim, + draftoffset .value_required:n = true, + draftoffset .initial:x = 1in, + max-cost .int_gset:N = \g__lwc_maxcost_int, max-cost .value_required:n = true, max-cost .initial:x = \c_max_int, @@ -145,6 +149,14 @@ \fi } +\prg_new_conditional:Nnn \__lwc_if_lmtx: { T, F, TF } { + \int_compare:nNnTF { \tex_luatexversion:D } > { 200 } { + \prg_return_true: + } { + \prg_return_false: + } +} + % Expansion of some parts of the document, such as section headings, is quite % undesirable, so we'll disable \lwc/ for certain commands. \int_new:N \g__lwc_disable_int @@ -197,6 +209,12 @@ \clist_map_function:NN \g__lwc_disablecmds_cl \__lwc_patch_cmd:n } +\__lwc_if_lmtx:T { + \int_gset:Nn \normalizelinemode { + \numexpression\normalizelinemode bor 2\relax + } +} + %%% Class and package-specifc patches % KOMA-Script @@ -226,9 +244,22 @@ debug .default:n = true, debug .value_required:n = false, - draft .choice:, - draft / true .code:n = \__lwc_draft:n { true }, - draft / false .code:n = \__lwc_draft:n { false }, + showcolours .choice:, + showcolours / true .code:n = \__lwc_show_colours:n { true }, + showcolours / false .code:n = \__lwc_show_colours:n { false }, + showcolours .default:n = true, + showcolours .value_required:n = false, + + showcosts .choice:, + showcosts / true .code:n = \__lwc_show_costs:n { true }, + showcosts / false .code:n = \__lwc_show_costs:n { false }, + showcosts .default:n = true, + showcosts .value_required:n = false, + + draft .meta:n = { + showcolours = { #1 }, + showcosts = { #1 }, + }, draft .default:n = true, draft .value_required:n = false, |