diff options
author | Karl Berry <karl@freefriends.org> | 2022-08-27 20:22:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-08-27 20:22:44 +0000 |
commit | fcb064757ec09cb4f3283969121026a3cd04ddb0 (patch) | |
tree | 91abd13abe16f9bd4084d5956b5e5ca019959813 | |
parent | 7b3ef595bfae2555beb94122a142ab6a758c90e6 (diff) |
widows-and-orphans (27aug22)
git-svn-id: svn://tug.org/texlive/trunk@64212 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/widows-and-orphans/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf | bin | 557181 -> 588329 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf | bin | 292579 -> 329513 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx | 66 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins | 13 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty | 30 |
7 files changed, 69 insertions, 50 deletions
diff --git a/Master/texmf-dist/doc/latex/widows-and-orphans/README.md b/Master/texmf-dist/doc/latex/widows-and-orphans/README.md index 0812db90f5b..edfe6a76d57 100644 --- a/Master/texmf-dist/doc/latex/widows-and-orphans/README.md +++ b/Master/texmf-dist/doc/latex/widows-and-orphans/README.md @@ -22,7 +22,7 @@ https://www.latex-project.org/publications/indexbytopic/2e-packages/ ----- -Copyright (C) 2018-2021 Frank Mittelbach<br /> +Copyright (C) 2018-2022 Frank Mittelbach<br /> <https://latex-project.org/> <br /> All rights reserved. diff --git a/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt b/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt index f4fe04798a7..84156da8c02 100644 --- a/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt +++ b/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt @@ -1,3 +1,9 @@ +2022-08-27 Frank Mittelbach <Frank.Mittelbach@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@latex-project.org> * widows-and-orphans.dtx: @@ -10,6 +16,6 @@ 2018-11-18 <Frank.Mittelbach@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. diff --git a/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf b/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf Binary files differindex 431ee984695..f1f596d9a1c 100644 --- a/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf +++ b/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf diff --git a/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf b/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf Binary files differindex f78f2b18107..924fa59ee5f 100644 --- a/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf +++ b/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf diff --git a/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx b/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx index dbb617265fb..fc92f914836 100644 --- a/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx +++ b/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx @@ -1,13 +1,13 @@ % \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 % 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,14 +711,14 @@ % 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. % % \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,28 +792,28 @@ % \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: % \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} diff --git a/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins b/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins index 753887020d1..683ccb53cc8 100644 --- a/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins +++ b/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.ins @@ -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. %% %% %% diff --git a/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty b/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty index 8289258aac0..e5c1c1f4890 100644 --- a/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty +++ b/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty @@ -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 } } |