diff options
author | Karl Berry <karl@freefriends.org> | 2022-04-07 20:32:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-04-07 20:32:04 +0000 |
commit | cfac1eeeae835746b5981896a562e8931b8a520e (patch) | |
tree | a1029f30dd2ae1efe5ea9163cb87d758799e11fb /Master/texmf-dist/tex | |
parent | dfdd0daa90a2e48dbfbe36c452b4f9fcaa6e7755 (diff) |
lua-widow-control (7apr22)
git-svn-id: svn://tug.org/texlive/trunk@62976 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
6 files changed, 23 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkiv b/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkiv index 74f61d941e2..83f72b39054 100644 --- a/Master/texmf-dist/tex/context/third/lua-widow-control/t-lua-widow-control.mkiv +++ b/Master/texmf-dist/tex/context/third/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/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 index 74f61d941e2..83f72b39054 100644 --- 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 @@ -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/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty b/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty index 367c73adfef..0690a232086 100644 --- a/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty +++ b/Master/texmf-dist/tex/lualatex/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/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.lua b/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.lua index cd1c6adb93b..2e374ac6e15 100644 --- a/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.lua +++ b/Master/texmf-dist/tex/luatex/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/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.tex b/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.tex index 29bfdc15f1e..4ff5bd993b4 100644 --- a/Master/texmf-dist/tex/luatex/lua-widow-control/lua-widow-control.tex +++ b/Master/texmf-dist/tex/luatex/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/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm b/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm index cfe2ddf248c..6ff62815835 100644 --- a/Master/texmf-dist/tex/optex/lua-widow-control/lua-widow-control.opm +++ b/Master/texmf-dist/tex/optex/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 <v2.0.3>} %%version +\_codedecl\lwcenable{lua-widow-control <v2.0.4>} %%version \_clubpenalty=1 \_widowpenalty=1 |