From d1d30aef56e5df7bbe7ee55e9fecf7d72514b6bf Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 8 Apr 2022 03:01:49 +0000 Subject: CTAN sync 202204080301 --- macros/luatex/generic/lua-widow-control/README.md | 2 +- .../lua-widow-control/lua-widow-control.lua | 23 +++++++++++++-------- .../lua-widow-control/lua-widow-control.opm | 2 +- .../lua-widow-control/lua-widow-control.pdf | Bin 379185 -> 380127 bytes .../lua-widow-control/lua-widow-control.sty | 6 +++--- .../lua-widow-control/lua-widow-control.tex | 2 +- .../lua-widow-control/lwc-documentation.tex | 4 +++- .../lua-widow-control/t-lua-widow-control.mkiv | 4 ++-- .../lua-widow-control/t-lua-widow-control.mkxl | 4 ++-- 9 files changed, 27 insertions(+), 20 deletions(-) (limited to 'macros/luatex') diff --git a/macros/luatex/generic/lua-widow-control/README.md b/macros/luatex/generic/lua-widow-control/README.md index 219a1f5eb1..850f034f8e 100644 --- a/macros/luatex/generic/lua-widow-control/README.md +++ b/macros/luatex/generic/lua-widow-control/README.md @@ -48,4 +48,4 @@ Lua-widow-control is licensed under the [_Mozilla Public License_, version 2.0]( 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.3 (2022-03-28)_ +_v2.0.4 (2022-04-07)_ diff --git a/macros/luatex/generic/lua-widow-control/lua-widow-control.lua b/macros/luatex/generic/lua-widow-control/lua-widow-control.lua index cd1c6adb93..2e374ac6e1 100644 --- a/macros/luatex/generic/lua-widow-control/lua-widow-control.lua +++ b/macros/luatex/generic/lua-widow-control/lua-widow-control.lua @@ -107,8 +107,8 @@ elseif plain or latex or optex then debug_print("Plain/LaTeX") luatexbase.provides_module { name = lwc.name, - date = "2022/03/28", --%%slashdate - version = "2.0.3", --%%version + date = "2022/04/07", --%%slashdate + version = "2.0.4", --%%version description = [[ This module provides a LuaTeX-based solution to prevent @@ -231,6 +231,13 @@ end --- Saves each paragraph, but lengthened by 1 line function lwc.save_paragraphs(head) + -- Ensure that we were actually given a par (only under \ConTeXt{} for some reason) + if (head.id ~= par_id and context) or + status.output_active -- Don't run during the output routine + then + return head + end + -- Prevent the "underfull hbox" warnings when we store a potential paragraph local renable_box_warnings if (context or optex) or @@ -240,10 +247,6 @@ function lwc.save_paragraphs(head) lwc.callbacks.disable_box_warnings.enable() end - -- Ensure that we were actually given a par (only under \ConTeXt{} for some reason) - if head.id ~= par_id and context then - return head - end -- We need to return the unmodified head at the end, so we make a copy here local new_head = copy(head) @@ -307,9 +310,11 @@ local last_paragraph = 0 --- some arbitrary number for \lwc/, and the value corresponds to the --- paragraphs index, which is negated for the end of the paragraph. function lwc.mark_paragraphs(head) - set_attribute(head, attribute, #paragraphs + (100 * pagenum())) - set_attribute(last(head), attribute, -1 * (#paragraphs + (100 * pagenum()))) - last_paragraph = #paragraphs + if not status.output_active then + set_attribute(head, attribute, #paragraphs + (100 * pagenum())) + set_attribute(last(head), attribute, -1 * (#paragraphs + (100 * pagenum()))) + last_paragraph = #paragraphs + end return head end diff --git a/macros/luatex/generic/lua-widow-control/lua-widow-control.opm b/macros/luatex/generic/lua-widow-control/lua-widow-control.opm index cfe2ddf248..6ff6281583 100644 --- a/macros/luatex/generic/lua-widow-control/lua-widow-control.opm +++ b/macros/luatex/generic/lua-widow-control/lua-widow-control.opm @@ -3,7 +3,7 @@ % SPDX-License-Identifier: MPL-2.0+ % SPDX-FileCopyrightText: 2022 Max Chernoff -\_codedecl\lwcenable{lua-widow-control } %%version +\_codedecl\lwcenable{lua-widow-control } %%version \_clubpenalty=1 \_widowpenalty=1 diff --git a/macros/luatex/generic/lua-widow-control/lua-widow-control.pdf b/macros/luatex/generic/lua-widow-control/lua-widow-control.pdf index fff2fc72bf..007b3136f0 100644 Binary files a/macros/luatex/generic/lua-widow-control/lua-widow-control.pdf and b/macros/luatex/generic/lua-widow-control/lua-widow-control.pdf differ 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 367c73adfe..0690a23208 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.0.3}{2022-03-28} %%version %%dashdate +\DeclareCurrentRelease{v2.0.4}{2022-04-07} %%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/28} %%slashdate - {v2.0.3} %%version + {2022/04/07} %%slashdate + {v2.0.4} %%version {Use Lua to remove widows and orphans} % Unconditional Package Loads diff --git a/macros/luatex/generic/lua-widow-control/lua-widow-control.tex b/macros/luatex/generic/lua-widow-control/lua-widow-control.tex index 29bfdc15f1..4ff5bd993b 100644 --- a/macros/luatex/generic/lua-widow-control/lua-widow-control.tex +++ b/macros/luatex/generic/lua-widow-control/lua-widow-control.tex @@ -3,7 +3,7 @@ % SPDX-License-Identifier: MPL-2.0+ % SPDX-FileCopyrightText: 2022 Max Chernoff -\wlog{lua-widow-control v2.0.3} %%version +\wlog{lua-widow-control v2.0.4} %%version \ifx\directlua\undefined \errmessage{% diff --git a/macros/luatex/generic/lua-widow-control/lwc-documentation.tex b/macros/luatex/generic/lua-widow-control/lwc-documentation.tex index 7bec7a0a33..8d59b2a735 100644 --- a/macros/luatex/generic/lua-widow-control/lwc-documentation.tex +++ b/macros/luatex/generic/lua-widow-control/lwc-documentation.tex @@ -37,7 +37,7 @@ \startdocument[ title=lua-widow-control, author=Max Chernoff, - version=2.0.3, %%version + version=2.0.4, %%version github=https://github.com/gucci-on-fleek/lua-widow-control, ctan=https://www.ctan.org/pkg/lua-widow-control, ] @@ -312,6 +312,8 @@ You could just disable then reenable \lwc/ every time that you use the command; \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. +Note that the \LaTeX{} option does not \emph{append} commands to the disable list; rather, it \emph{sets} the list from scratch. This means that you can set an empty list to disable any command patching; however, this also means that if you want to disable one command on top of the defaults, you'll also need to manually include the default list. + \startTABLE \NC Plain \TeX{} \NC \inlineTEX{\lwcdisablecmd{$\meta{\backslash macro}$}} 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 74f61d941e..83f72b3905 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,10 +1,10 @@ %D \module %D [ file=t-lua-widow-control, -%D version=2.0.3, %%version +%D version=2.0.4, %%version %D title=lua-widow-control, %D subtitle=\ConTeXt module for lua-widow-control, %D author=Max Chernoff, -%D date=2022-03-28, %%dashdate +%D date=2022-04-07, %%dashdate %D copyright=Max Chernoff, %D license=MPL-2.0+, %D url=https://github.com/gucci-on-fleek/lua-widow-control] diff --git a/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkxl b/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkxl index 74f61d941e..83f72b3905 100644 --- a/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkxl +++ b/macros/luatex/generic/lua-widow-control/t-lua-widow-control.mkxl @@ -1,10 +1,10 @@ %D \module %D [ file=t-lua-widow-control, -%D version=2.0.3, %%version +%D version=2.0.4, %%version %D title=lua-widow-control, %D subtitle=\ConTeXt module for lua-widow-control, %D author=Max Chernoff, -%D date=2022-03-28, %%dashdate +%D date=2022-04-07, %%dashdate %D copyright=Max Chernoff, %D license=MPL-2.0+, %D url=https://github.com/gucci-on-fleek/lua-widow-control] -- cgit v1.2.3