summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm
blob: 992d817a5c8593c064a221261fa08b1d92219c03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% lua-widow-control
% https://github.com/gucci-on-fleek/lua-widow-control
% SPDX-License-Identifier: MPL-2.0+
% SPDX-FileCopyrightText: 2022 Max Chernoff

\_codedecl\lwcenable{lua-widow-control <v2.0.0>} %%version

\_clubpenalty=1
\_widowpenalty=1
\_displaywidowpenalty=1

\_newdimen\lwcemergencystretch
\lwcemergencystretch=3em

\_newcount\lwcmaxcost
\lwcmaxcost=2147483647

\_directlua{require "lua-widow-control"}

% Define \TeX{} wrappers for Lua functions
\_def\lwcenable{\_directlua{lwc.enable_callbacks()}}
\_def\lwcdisable{\_directlua{lwc.disable_callbacks()}}
\_def\iflwc{\_directlua{lwc.if_lwc_enabled()}}

% Enable \lwc/ by default when the package is loaded.
\lwcenable

\_endcode