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 /Master/texmf-dist/source | |
parent | 7b3ef595bfae2555beb94122a142ab6a758c90e6 (diff) |
widows-and-orphans (27aug22)
git-svn-id: svn://tug.org/texlive/trunk@64212 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-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 |
2 files changed, 46 insertions, 33 deletions
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. %% %% %% |