From fbe3cb5feb55dc6417d9bb95e3c7954a1b0b9ee8 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 21 May 2022 03:00:51 +0000 Subject: CTAN sync 202205210300 --- .../lua-widow-control/t-lua-widow-control.mkiv | 105 +-------------------- 1 file changed, 1 insertion(+), 104 deletions(-) (limited to 'macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkiv') diff --git a/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkiv b/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkiv index 090ff5aa80..5f277c2b14 100644 --- a/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkiv +++ b/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkiv @@ -1,104 +1 @@ -%D \module -%D [ file=t-lua-widow-control, -%D version=2.1.0, %%version -%D title=lua-widow-control, -%D subtitle=\ConTeXt module for lua-widow-control, -%D author=Max Chernoff, -%D date=2022-05-14, %%dashdate -%D copyright=Max Chernoff, -%D license=MPL-2.0+, -%D url=https://github.com/gucci-on-fleek/lua-widow-control] -\startmodule[lua-widow-control] -\unprotect - -\installnamespace{lwc} - -\installcommandhandler \????lwc {lwc} \????lwc - -\newdimen\lwc_emergency_stretch -\newcount\lwc_max_cost -\appendtoks - \lwc_emergency_stretch=\lwcparameter{emergencystretch} - - \doifelse{\lwcparameter{\c!state}}\v!start{ - \lwc_enable - }{ - \lwc_disable - } - - \lwc_debug{\lwcparameter{debug}} - - \lwc_nobreak{\lwcparameter{nobreak}} - - \lwc_max_cost=\lwcparameter{maxcost} - - % We can't just set the penalties because they will be reset automatically - % at \\starttext. - \startsetups[*default] - \directsetup{*reset} - - \clubpenalty=\lwcparameter{orphanpenalty} - \widowpenalty=\lwcparameter{widowpenalty} - \displaywidowpenalty=\lwcparameter{widowpenalty} - \brokenpenalty=\lwcparameter{brokenpenalty} - \stopsetups - - \startsetups[grid][*default] - \directsetup{*reset} - - \clubpenalty=\lwcparameter{orphanpenalty} - \widowpenalty=\lwcparameter{widowpenalty} - \displaywidowpenalty=\lwcparameter{widowpenalty} - \brokenpenalty=\lwcparameter{brokenpenalty} - \stopsetups - - \setups[*default] -\to\everysetuplwc - -\ctxloadluafile{lua-widow-control} - -\setuplwc[ - emergencystretch=3em, - \c!state=\v!start, - debug=\v!stop, - orphanpenalty=1, - widowpenalty=1, - brokenpenalty=1, - nobreak=keep, - maxcost=2147483647, -] - - -% Here, we enable font expansion/contraction. It isn't strictly necessary for -% \lwc/'s functionality; however, it is required for the -% lengthened paragraphs to not have terrible spacing. -\definefontfeature[default][default][expansion=quality] -\setupalign[hz] - -% Expansion of some parts of the document, such as section headings, is quite -% undesirable, so we'll disable \lwc/ for certain commands. -% We should only reenable \lwc/ at the end if it was already enabled. -\newcount\lwc_disable_count - -\define\lwc_patch_pre{% - \lwc_if_enabled% - \advance\lwc_disable_count by 1% - \setuplwc[\c!state=\v!stop]% - \fi% -} - -\define\lwc_patch_post{ - \ifnum\lwc_disable_count>0\relax% - \setuplwc[\c!state=\v!start]% - \advance\lwc_disable_count by -1% - \fi% -} - -\prependtoks\lwc_patch_pre\to\everybeforesectionheadhandle % Sectioning -\prependtoks\lwc_patch_post\to\everyaftersectionheadhandle - -% Make the commands public -\let\iflwc=\lwc_if_enabled - -\protect -\stopmodule +\input t-lua-widow-control.mkxl -- cgit v1.2.3