texlive[62934] Master/texmf-dist: lua-widow-control (29mar22)

commits+karl at tug.org commits+karl at tug.org
Wed Apr 6 00:05:49 CEST 2022


Revision: 62934
          http://tug.org/svn/texlive?view=revision&revision=62934
Author:   karl
Date:     2022-04-06 00:05:48 +0200 (Wed, 06 Apr 2022)
Log Message:
-----------
lua-widow-control (29mar22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/luatex/lua-widow-control/README.md
    trunk/Master/texmf-dist/doc/luatex/lua-widow-control/lua-widow-control.pdf
    trunk/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex
    trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkiv
    trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl
    trunk/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty
    trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.lua
    trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.tex
    trunk/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm

Modified: trunk/Master/texmf-dist/doc/luatex/lua-widow-control/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/lua-widow-control/README.md	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/doc/luatex/lua-widow-control/README.md	2022-04-05 22:05:48 UTC (rev 62934)
@@ -48,4 +48,4 @@
 Please note that a compiled document is absolutely **not** considered to be an "Executable Form" as defined by the MPL. The use of lua-widow-control in a document does not place **any** obligations on the document's author or distributors. The MPL and CC-BY-SA licenses **only** apply to you if you distribute the lua-widow-control source code or documentation.
 
 ---
-_v2.0.2 (2022-03-20)_ <!--%%version %%dashdate-->
+_v2.0.3 (2022-03-28)_ <!--%%version %%dashdate-->

Modified: trunk/Master/texmf-dist/doc/luatex/lua-widow-control/lua-widow-control.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex
===================================================================
--- trunk/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex	2022-04-05 22:05:48 UTC (rev 62934)
@@ -37,7 +37,7 @@
 \startdocument[
     title=lua-widow-control,
     author=Max Chernoff,
-    version=2.0.2, %%version
+    version=2.0.3, %%version
     github=https://github.com/gucci-on-fleek/lua-widow-control,
     ctan=https://www.ctan.org/pkg/lua-widow-control,
 ]
@@ -310,7 +310,7 @@
 
 You could just disable then reenable \lwc/ every time that you use the command; however, \lwc/ provides a convenience macro that will do this automatically for you.
 
-\Lwc/ automatically patches the default \LaTeX{}, \ConTeXt{}, and Plain~\TeX{} section commands, so you shouldn't need to patch these yourself; however, \lwc/ does \bold{not} patch the non-standard section commands provided by \sans{memoir}, \sans{\acronym{KOMA}-script}, \sans{titlesec}, Op\TeX{}, and others. You'll need to add these yourself.
+\Lwc/ automatically patches the default \LaTeX{}, \ConTeXt{}, and Plain~\TeX{} section commands, so you shouldn't need to patch these yourself. \Lwc/ also patches the commands provided by \sans{memoir}, \sans{\acronym{KOMA}-script}, and \sans{titlesec}. You'll need to patch any other section commands yourself.
 
 \startTABLE
     \NC Plain \TeX{}
@@ -317,7 +317,7 @@
     \NC \inlineTEX{\lwcdisablecmd{$\meta{\backslash macro}$}}
     \NC\NR
     \NC \LaTeX{}
-    \NC \inlineTEX{\lwcsetup{disablecmds = {$\meta{\backslash macroone}$, $\meta{\backslash macrotwo}$}}}
+    \NC \inlineTEX{\lwcsetup{disablecmds = {$\meta{macronameone}$, $\meta{macronametwo}$}}}
     \NC\NR
     \NC \ConTeXt{}
     \NC \inlineTEX{\prependtoks\lwc$\hskip-0.5em\relax$@patch at pre\to\everybefore$\hskip-0.5em\relax\meta{hook}$}

Modified: trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkiv
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkiv	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkiv	2022-04-05 22:05:48 UTC (rev 62934)
@@ -1,10 +1,10 @@
 %D \module
 %D   [     file=t-lua-widow-control,
-%D      version=2.0.2, %%version
+%D      version=2.0.3, %%version
 %D        title=lua-widow-control,
 %D     subtitle=\ConTeXt module for lua-widow-control,
 %D       author=Max Chernoff,
-%D         date=2022-03-20, %%dashdate
+%D         date=2022-03-28, %%dashdate
 %D    copyright=Max Chernoff,
 %D      license=MPL-2.0+,
 %D          url=https://github.com/gucci-on-fleek/lua-widow-control]

Modified: trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl	2022-04-05 22:05:48 UTC (rev 62934)
@@ -1,10 +1,10 @@
 %D \module
 %D   [     file=t-lua-widow-control,
-%D      version=2.0.2, %%version
+%D      version=2.0.3, %%version
 %D        title=lua-widow-control,
 %D     subtitle=\ConTeXt module for lua-widow-control,
 %D       author=Max Chernoff,
-%D         date=2022-03-20, %%dashdate
+%D         date=2022-03-28, %%dashdate
 %D    copyright=Max Chernoff,
 %D      license=MPL-2.0+,
 %D          url=https://github.com/gucci-on-fleek/lua-widow-control]

Modified: trunk/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty	2022-04-05 22:05:48 UTC (rev 62934)
@@ -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.0.2}{2022-03-20} %%version %%dashdate
+\DeclareCurrentRelease{v2.0.3}{2022-03-28} %%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/03/20} %%slashdate
-    {v2.0.2} %%version
+    {2022/03/28} %%slashdate
+    {v2.0.3} %%version
     {Use Lua to remove widows and orphans}
 
 % Unconditional Package Loads
@@ -102,7 +102,13 @@
 
     disablecmds .clist_gset:N     = \g__lwc_disablecmds_cl,
     disablecmds .value_required:n = false,
-    disablecmds .initial:n        = { \@sect },
+    disablecmds .initial:n        = { \@sect,           % LaTeX default
+                                      \M at sect,          % Memoir
+                                      \@mem at old@ssect,  % Memoir Starred
+                                      \ttl at straight@ii, % titlesec normal
+                                      \ttl at top@ii,      % titlesec top
+                                      \ttl at part@ii,     % titlesec part
+                                    },
     disablecmds .usage:n          = preamble,
 
     nobreak .choice:,
@@ -150,21 +156,29 @@
 % undesirable, so we'll disable \lwc/ for certain commands.
 \bool_new:N \g__lwc_should_reenable_bool
 
+\cs_new:Npn \__lwc_patch_pre: {
+    % We should only reenable \lwc/ at the end if it was already enabled.
+    \__lwc_if_enabled:TF {
+        \bool_gset_true:N \g__lwc_should_reenable_bool
+        \__lwc_disable:
+    } {
+        \bool_gset_false:N \g__lwc_should_reenable_bool
+    }
+}
+
+\cs_new:Npn \__lwc_patch_post: {
+    \bool_if:NT { \g__lwc_should_reenable_bool } {
+        \__lwc_enable:
+    }
+}
+
 \cs_new:Npn \__lwc_patch_cmd:c #1 {
     \IfFormatAtLeastTF {2021/06/01 } {
         \hook_gput_code:nnn { cmd / #1 / before } { \c__lwc_name_str } {
-            % We should only reenable \lwc/ at the end if it was already enabled.
-            \__lwc_if_enabled:TF {
-                \bool_gset_true:N \g__lwc_should_reenable_bool
-                \__lwc_disable:
-            } {
-                \bool_gset_false:N \g__lwc_should_reenable_bool
-            }
+            \__lwc_patch_pre:
         }
         \hook_gput_code:nnn { cmd / #1 / after } { \c__lwc_name_str } {
-            \bool_if:NT { \g__lwc_should_reenable_bool } {
-                \__lwc_enable:
-            }
+            \__lwc_patch_post:
         }
     } {
         \msg_warning:nn
@@ -177,10 +191,26 @@
     \__lwc_patch_cmd:c { \cs_to_str:N #1 }
 }
 
+\cs_new:Npn \__lwc_patch_cmd:n #1 {
+    % If the item provided is a single token, we'll assume that it's a \macro.
+    % If it is multiple tokens, we'll assume that it's a `csname`.
+    \tl_if_single:nTF { #1 } {
+        \__lwc_patch_cmd:c { \cs_to_str:N #1 }
+    } {
+        \__lwc_patch_cmd:c { #1 }
+    }
+}
+
 \hook_gput_code:nnn { begindocument / before } { \c__lwc_name_str } {
-    \clist_map_function:NN \g__lwc_disablecmds_cl \__lwc_patch_cmd:N
+    \clist_map_function:NN \g__lwc_disablecmds_cl \__lwc_patch_cmd:n
 }
 
+% KOMA-Script
+\cs_if_exist:NT \AddtoDoHook {
+    \AddtoDoHook { heading / begingroup } { \__lwc_patch_pre:  \use_none:n }
+    \AddtoDoHook { heading / endgroup   } { \__lwc_patch_post: \use_none:n }
+}
+
 % Define some final keys
 \keys_define:nn { \c__lwc_name_str } {
     enable .choice:,

Modified: trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.lua	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.lua	2022-04-05 22:05:48 UTC (rev 62934)
@@ -107,8 +107,8 @@
         debug_print("Plain/LaTeX")
         luatexbase.provides_module {
             name = lwc.name,
-            date = "2022/03/20", --%%slashdate
-            version = "2.0.2", --%%version
+            date = "2022/03/28", --%%slashdate
+            version = "2.0.3", --%%version
             description = [[
 
 This module provides a LuaTeX-based solution to prevent

Modified: trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.tex
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.tex	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.tex	2022-04-05 22:05:48 UTC (rev 62934)
@@ -3,7 +3,7 @@
 % SPDX-License-Identifier: MPL-2.0+
 % SPDX-FileCopyrightText: 2022 Max Chernoff
 
-\wlog{lua-widow-control v2.0.2} %%version
+\wlog{lua-widow-control v2.0.3} %%version
 
 \ifx\directlua\undefined
     \errmessage{%

Modified: trunk/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm
===================================================================
--- trunk/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm	2022-04-05 22:05:05 UTC (rev 62933)
+++ trunk/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm	2022-04-05 22:05:48 UTC (rev 62934)
@@ -3,7 +3,7 @@
 % SPDX-License-Identifier: MPL-2.0+
 % SPDX-FileCopyrightText: 2022 Max Chernoff
 
-\_codedecl\lwcenable{lua-widow-control <v2.0.2>} %%version
+\_codedecl\lwcenable{lua-widow-control <v2.0.3>} %%version
 
 \_clubpenalty=1
 \_widowpenalty=1



More information about the tex-live-commits mailing list.