diff options
author | Karl Berry <karl@freefriends.org> | 2021-10-10 20:39:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-10-10 20:39:35 +0000 |
commit | fe01eb2aa624eb62e45ea92e03d9b6c898f44820 (patch) | |
tree | bbd3ef4380d0569d77472f14e3307d969552ba3e /Master/texmf-dist/tex/context/third/lua-widow-control | |
parent | ec195fcb5da10972bf17269ba6505f6b173395b3 (diff) |
lua-widow-control (10oct21)
git-svn-id: svn://tug.org/texlive/trunk@60723 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/third/lua-widow-control')
-rw-r--r-- | Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl b/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl new file mode 100644 index 00000000000..66eeadec579 --- /dev/null +++ b/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl @@ -0,0 +1,54 @@ +%D \module +%D [ file=t-lua-widow-control, +%D version=1.0.0, %%version +%D title=lua-widow-control, +%D subtitle=\ConTeXt module for lua-widow-control, +%D author=gucci-on-fleek, +%D date=2021-10-09, %%date +%D copyright=gucci-on-fleek, +%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\lwcemergencystretch +\appendtoks + \lwcemergencystretch=\lwcparameter{emergencystretch} +\to\everysetuplwc + +\appendtoks + \doifelse{\lwcparameter{\c!state}}\v!start{ + \ctxlua{lwc.enable_callbacks()} + }{ + \ctxlua{lwc.disable_callbacks()} + } +\to\everysetuplwc + +\ctxloadluafile{lua-widow-control} + +\setuplwc[emergencystretch=3em, \c!state=\v!start] + +% We can't just set the penalties because they will be reset automatically +% at \\starttext. +\startsetups[*default] + \clubpenalty=1 + \widowpenalty=1 + \displaywidowpenalty=0 + \interlinepenalty=0 + \brokenpenalty=0 +\stopsetups + +\setups[*default] + +% 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] + +\protect +\stopmodule |