texlive[64212] Master/texmf-dist: widows-and-orphans (27aug22)

commits+karl at tug.org commits+karl at tug.org
Sat Aug 27 22:22:44 CEST 2022


Revision: 64212
          http://tug.org/svn/texlive?view=revision&revision=64212
Author:   karl
Date:     2022-08-27 22:22:44 +0200 (Sat, 27 Aug 2022)
Log Message:
-----------
widows-and-orphans (27aug22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/README.md
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf
    trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx
    trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins
    trunk/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty

Modified: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/widows-and-orphans/README.md	2022-08-27 20:22:21 UTC (rev 64211)
+++ trunk/Master/texmf-dist/doc/latex/widows-and-orphans/README.md	2022-08-27 20:22:44 UTC (rev 64212)
@@ -22,7 +22,7 @@
 
 -----
 
-Copyright (C) 2018-2021 Frank Mittelbach<br />
+Copyright (C) 2018-2022 Frank Mittelbach<br />
 <https://latex-project.org/> <br />
 All rights reserved.
 

Modified: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt	2022-08-27 20:22:21 UTC (rev 64211)
+++ trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt	2022-08-27 20:22:44 UTC (rev 64212)
@@ -1,3 +1,9 @@
+2022-08-27  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* widows-and-orphans.dtx (subsection{Checking \outputpenalty}):
+	When testing against the \outputpenalty use \@clubpenalty instead of
+	\clubpenalty to avoid spurious matches in some cases.
+
 2021-03-05  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* widows-and-orphans.dtx:
@@ -10,6 +16,6 @@
 
 2018-11-18    <Frank.Mittelbach at latex-project.org>
 
-	* widows-and-orphans.dtx: Surplus open parenthese in message,
+	* widows-and-orphans.dtx: Surplus open ( in message,
 	spotted by Barbara Beeton's eagle eyes.
 

Modified: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx	2022-08-27 20:22:21 UTC (rev 64211)
+++ trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx	2022-08-27 20:22:44 UTC (rev 64212)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %%
-%% File: widows-and-orphans.dtx (C) Copyright 2017-2021 Frank Mittelbach
+%% File: widows-and-orphans.dtx (C) Copyright 2017-2022 Frank Mittelbach
 %
 % It may be distributed and/or modified under the conditions of the
 % LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -7,7 +7,7 @@
 % license or (at your option) any later version.  The latest version
 % of this license is in the file
 %
-%    http://www.latex-project.org/lppl.txt
+%    https://www.latex-project.org/lppl.txt
 %
 %
 % The development version of the bundle can be found at
@@ -335,7 +335,7 @@
 % \end{figure}
 %
 %    \begin{macrocode}
-\ProvidesExplPackage{widows-and-orphans}{2021/03/06}{v1.0d}
+\ProvidesExplPackage{widows-and-orphans}{2022/08/27}{v1.0e}
                     {Detecting widows and orphans (FMi)}
 %    \end{macrocode}
 %
@@ -436,11 +436,21 @@
         { \@@_problem_identified:nn{widow}{Widow} }
       { \displaywidowpenalty }
         { \@@_problem_identified:nn{widow}{Display~ widow} }
-      { \clubpenalty }
+%    \end{macrocode}
+%    Above we have always talked about testing for \cs{clubpenalty}
+%    because that is the register \TeX{} is using. However, \LaTeX{}
+%    changes its value back and forth between \texttt{10000} (after a
+%    heading) and \cs{@clubpenalty} (the saved value) and sometimes
+%    even \texttt{0}. Thus when the output routine is triggered it
+%    could be any of these values and in case it is zero we would get
+%    spurious matches. So for comparison we always test against
+%    \cs{@clubpenalty}.
+%    \begin{macrocode}
+      { \@clubpenalty }
         { \@@_problem_identified:n{orphan} }
-      { \clubpenalty + \widowpenalty }
+      { \@clubpenalty + \widowpenalty }
         { \@@_problem_identified:nn{orphan-widow}{} }
-      { \clubpenalty + \displaywidowpenalty }
+      { \@clubpenalty + \displaywidowpenalty }
         { \@@_problem_identified:nn{orphan-widow}{display} }
 %    \end{macrocode}
 %
@@ -463,11 +473,11 @@
         { \@@_problem_identified:nn{widow}{Widow} }
       { \brokenpenalty + \displaywidowpenalty }
         { \@@_problem_identified:nn{widow}{Display~ widow} }
-      { \brokenpenalty + \clubpenalty }
+      { \brokenpenalty + \@clubpenalty }
         { \@@_problem_identified:n{orphan} }
-      { \brokenpenalty + \clubpenalty + \widowpenalty }
+      { \brokenpenalty + \@clubpenalty + \widowpenalty }
         { \@@_problem_identified:nn{orphan-widow}{} }
-      { \brokenpenalty + \clubpenalty + \displaywidowpenalty }
+      { \brokenpenalty + \@clubpenalty + \displaywidowpenalty }
         { \@@_problem_identified:nn{orphan-widow}{display} }
 %    \end{macrocode}
 %    Finally there is \cs{predisplaypenalty} that we may as well check also
@@ -701,7 +711,7 @@
 %    from $\cs{widowpenalty}+\cs{interlinepenalty}$, as the key and
 %    this formula as the property list value.
 %
-% \item For the next parameter, say \cs{clubpenalty}, we check if its
+% \item For the next parameter, say \cs{@clubpenalty}, we check if its
 %    value (or more precisely its value plus \cs{interlinepenalty}) is
 %    already a key in the property list. If that is the case, then we
 %    have failed and must modify the parameter value somehow.
@@ -708,7 +718,7 @@
 %
 % \item If not, we also have to check any combination of the current
 %    parameter with any parameter processed earlier. If that
-%    combination is possible, e.g., \cs{clubpenalty} (new) and
+%    combination is possible, e.g., \cs{@clubpenalty} (new) and
 %    \cs{widowpenalty} (already processed) then we also have to check
 %    the sum. If that sum is already a key in the property list then
 %    we have failed as well.
@@ -719,7 +729,7 @@
 %
 % \item We then change the parameter to this value and add all the
 %    combinations we tried before to the property list (that is
-%    $\cs{clubpenalty}+\cs{interlinepenalty}$ both alone and together with
+%    $\cs{@clubpenalty}+\cs{interlinepenalty}$ both alone and together with
 %    \cs{widowpenalty} in our example). Thus from now on those are
 %    also forbidden values.
 %
@@ -727,9 +737,9 @@
 %    parameter as the first argument and the list of different cases
 %    to try as a comma-separated list as a second argument, e.g.,
 %\begin{verbatim}
-%    \__fmwao_decide_penalty:Nn \clubpenalty 
-%             { \clubpenalty + \interlinepenalty ,
-%               \clubpenalty + \widowpenalty + \interlinepenalty }
+%    \__fmwao_decide_penalty:Nn \@clubpenalty 
+%             { \@clubpenalty + \interlinepenalty ,
+%               \@clubpenalty + \widowpenalty + \interlinepenalty }
 %\end{verbatim}
 %
 % \item This way we are adding all relevant parameters to the property
@@ -782,18 +792,18 @@
 %    \end{macrocode}
 %    Then comes the first real parameter for the orphans:
 %    \begin{macrocode}
-  \@@_decide_penalty:Nn \clubpenalty 
-    { \clubpenalty + \interlinepenalty }
+  \@@_decide_penalty:Nn \@clubpenalty 
+    { \@clubpenalty + \interlinepenalty }
 %    \end{macrocode}
 %    followed by the one for the widows and the one for the display widows:
 %    \begin{macrocode}
   \@@_decide_penalty:Nn \widowpenalty 
     { \widowpenalty + \interlinepenalty ,
-      \widowpenalty + \clubpenalty  + \interlinepenalty }
+      \widowpenalty + \@clubpenalty  + \interlinepenalty }
 
   \@@_decide_penalty:Nn \displaywidowpenalty 
     { \displaywidowpenalty + \interlinepenalty ,
-      \displaywidowpenalty + \clubpenalty + \interlinepenalty }
+      \displaywidowpenalty + \@clubpenalty + \interlinepenalty }
 %    \end{macrocode}
 %    \cs{brokenpenalty} can appear on its own, and also with each and
 %    every combination we have seen so far:
@@ -800,10 +810,10 @@
 %    \begin{macrocode}
   \@@_decide_penalty:Nn \brokenpenalty
     { \brokenpenalty + \interlinepenalty ,
-      \brokenpenalty + \clubpenalty + \interlinepenalty ,
+      \brokenpenalty + \@clubpenalty + \interlinepenalty ,
       \brokenpenalty + \widowpenalty + \interlinepenalty , 
-      \brokenpenalty + \widowpenalty + \clubpenalty + \interlinepenalty ,
-      \brokenpenalty + \displaywidowpenalty + \clubpenalty
+      \brokenpenalty + \widowpenalty + \@clubpenalty + \interlinepenalty ,
+      \brokenpenalty + \displaywidowpenalty + \@clubpenalty
                                             + \interlinepenalty }
 %    \end{macrocode}
 %    Finally we have the parameter for lonely displays (again without
@@ -824,16 +834,16 @@
 % >  {51}  =>  {\@lowpenalty }
 % >  {151}  =>  {\@medpenalty }
 % >  {301}  =>  {\@highpenalty }
-% >  {150}  =>  {\clubpenalty +\interlinepenalty }
+% >  {150}  =>  {\@clubpenalty +\interlinepenalty }
 % >  {152}  =>  {\widowpenalty +\interlinepenalty }
-% >  {302}  =>  {\widowpenalty +\clubpenalty +\interlinepenalty }
+% >  {302}  =>  {\widowpenalty +\@clubpenalty +\interlinepenalty }
 % >  {50}  =>  {\displaywidowpenalty +\interlinepenalty }
-% >  {200}  =>  {\displaywidowpenalty +\clubpenalty +\interlinepenalty }
+% >  {200}  =>  {\displaywidowpenalty +\@clubpenalty +\interlinepenalty }
 % >  {100}  =>  {\brokenpenalty +\interlinepenalty }
-% >  {250}  =>  {\brokenpenalty +\clubpenalty +\interlinepenalty }
+% >  {250}  =>  {\brokenpenalty +\@clubpenalty +\interlinepenalty }
 % >  {252}  =>  {\brokenpenalty +\widowpenalty +\interlinepenalty }
-% >  {402}  =>  {\brokenpenalty +\widowpenalty +\clubpenalty +\interlinepenalty }
-% >  {300}  =>  {\brokenpenalty +\displaywidowpenalty +\clubpenalty
+% >  {402}  =>  {\brokenpenalty +\widowpenalty +\@clubpenalty +\interlinepenalty }
+% >  {300}  =>  {\brokenpenalty +\displaywidowpenalty +\@clubpenalty
 %                                                            +\interlinepenalty }
 % >  {10001}  =>  {\predisplaypenalty }.
 %\end{verbatim}

Modified: trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins	2022-08-27 20:22:21 UTC (rev 64211)
+++ trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins	2022-08-27 20:22:44 UTC (rev 64212)
@@ -13,13 +13,16 @@
 %% conditions of the LaTeX Project Public License, either version 1.3c
 %% of this license or (at your option) any later version.
 %% The latest version of this license is in
-%%    http://www.latex-project.org/lppl.txt
+%%    https://www.latex-project.org/lppl.txt
 %% and version 1.3c or later is part of all distributions of LaTeX 
-%% version 2005/12/01 or later.
+%% version 2008 or later.
 %% 
-%% In particular, NO PERMISSION is granted to modify the contents of this
-%% file since it contains the legal notices that are placed in the files
-%% it generates.
+%% As this file contains legal notices, it is NOT PERMITTED to modify
+%% this file in any way that the legal information placed into
+%% generated files is changed (i.e., the files generated when the
+%% original file is executed). This restriction does not apply if
+%% (parts of) the content is reused in a different WORK producing its
+%% own generated files.
 %% 
 %% 
 %%

Modified: trunk/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty	2022-08-27 20:22:21 UTC (rev 64211)
+++ trunk/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty	2022-08-27 20:22:44 UTC (rev 64212)
@@ -27,11 +27,11 @@
 %% without such generated files.
 %% 
 %%
-%% File: widows-and-orphans.dtx (C) Copyright 2017-2021 Frank Mittelbach
+%% File: widows-and-orphans.dtx (C) Copyright 2017-2022 Frank Mittelbach
 
 
 \NeedsTeXFormat{LaTeX2e}    \RequirePackage{l3keys2e}
-\ProvidesExplPackage{widows-and-orphans}{2021/03/06}{v1.0d}
+\ProvidesExplPackage{widows-and-orphans}{2022/08/27}{v1.0e}
                     {Detecting widows and orphans (FMi)}
 \tl_put_left:Nn \@makecol { \__fmwao_test_for_widows_etc: }
 \bool_new:N \g__fmwao_gen_warn_bool
@@ -43,11 +43,11 @@
         { \__fmwao_problem_identified:nn{widow}{Widow} }
       { \displaywidowpenalty }
         { \__fmwao_problem_identified:nn{widow}{Display~ widow} }
-      { \clubpenalty }
+      { \@clubpenalty }
         { \__fmwao_problem_identified:n{orphan} }
-      { \clubpenalty + \widowpenalty }
+      { \@clubpenalty + \widowpenalty }
         { \__fmwao_problem_identified:nn{orphan-widow}{} }
-      { \clubpenalty + \displaywidowpenalty }
+      { \@clubpenalty + \displaywidowpenalty }
         { \__fmwao_problem_identified:nn{orphan-widow}{display} }
       { \brokenpenalty }
         { \__fmwao_problem_identified:n{hyphen} }
@@ -55,11 +55,11 @@
         { \__fmwao_problem_identified:nn{widow}{Widow} }
       { \brokenpenalty + \displaywidowpenalty }
         { \__fmwao_problem_identified:nn{widow}{Display~ widow} }
-      { \brokenpenalty + \clubpenalty }
+      { \brokenpenalty + \@clubpenalty }
         { \__fmwao_problem_identified:n{orphan} }
-      { \brokenpenalty + \clubpenalty + \widowpenalty }
+      { \brokenpenalty + \@clubpenalty + \widowpenalty }
         { \__fmwao_problem_identified:nn{orphan-widow}{} }
-      { \brokenpenalty + \clubpenalty + \displaywidowpenalty }
+      { \brokenpenalty + \@clubpenalty + \displaywidowpenalty }
         { \__fmwao_problem_identified:nn{orphan-widow}{display} }
       { \predisplaypenalty - \interlinepenalty }
         { \__fmwao_problem_identified:nn{widow}{Lonely~ display} }
@@ -146,21 +146,21 @@
   \__fmwao_decide_penalty:Nn \@lowpenalty  { \@lowpenalty}
   \__fmwao_decide_penalty:Nn \@medpenalty  { \@medpenalty}
   \__fmwao_decide_penalty:Nn \@highpenalty { \@highpenalty}
-  \__fmwao_decide_penalty:Nn \clubpenalty
-    { \clubpenalty + \interlinepenalty }
+  \__fmwao_decide_penalty:Nn \@clubpenalty
+    { \@clubpenalty + \interlinepenalty }
   \__fmwao_decide_penalty:Nn \widowpenalty
     { \widowpenalty + \interlinepenalty ,
-      \widowpenalty + \clubpenalty  + \interlinepenalty }
+      \widowpenalty + \@clubpenalty  + \interlinepenalty }
 
   \__fmwao_decide_penalty:Nn \displaywidowpenalty
     { \displaywidowpenalty + \interlinepenalty ,
-      \displaywidowpenalty + \clubpenalty + \interlinepenalty }
+      \displaywidowpenalty + \@clubpenalty + \interlinepenalty }
   \__fmwao_decide_penalty:Nn \brokenpenalty
     { \brokenpenalty + \interlinepenalty ,
-      \brokenpenalty + \clubpenalty + \interlinepenalty ,
+      \brokenpenalty + \@clubpenalty + \interlinepenalty ,
       \brokenpenalty + \widowpenalty + \interlinepenalty ,
-      \brokenpenalty + \widowpenalty + \clubpenalty + \interlinepenalty ,
-      \brokenpenalty + \displaywidowpenalty + \clubpenalty
+      \brokenpenalty + \widowpenalty + \@clubpenalty + \interlinepenalty ,
+      \brokenpenalty + \displaywidowpenalty + \@clubpenalty
                                             + \interlinepenalty }
   \__fmwao_decide_penalty:Nn \predisplaypenalty { \predisplaypenalty }
 }



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