texlive[49194] Master/texmf-dist: widows-and-orphans (19nov18)

commits+karl at tug.org commits+karl at tug.org
Mon Nov 19 22:52:02 CET 2018


Revision: 49194
          http://tug.org/svn/texlive?view=revision&revision=49194
Author:   karl
Date:     2018-11-19 22:52:01 +0100 (Mon, 19 Nov 2018)
Log Message:
-----------
widows-and-orphans (19nov18)

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

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans.pdf
    trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans.tex

Modified: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/widows-and-orphans/README.md	2018-11-19 04:05:47 UTC (rev 49193)
+++ trunk/Master/texmf-dist/doc/latex/widows-and-orphans/README.md	2018-11-19 21:52:01 UTC (rev 49194)
@@ -16,6 +16,10 @@
 
 The license is LPPL.
 
+A general discussion on how to manage widows and orphans can be found in a TugBoat article located at
+
+https://www.latex-project.org/publications/indexbytopic/2e-packages/
+
 -----
 
 Copyright (C) 2018 Frank Mittelbach<br />

Added: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt	2018-11-19 21:52:01 UTC (rev 49194)
@@ -0,0 +1,5 @@
+2018-11-18    <Frank.Mittelbach at latex-project.org>
+
+	* widows-and-orphans.dtx: Surplus open parenthese in message,
+	spotted by Barbara Beeton's eagle eyes.
+


Property changes on: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/changes.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-code.pdf
===================================================================
(Binary files differ)

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

Index: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf	2018-11-19 04:05:47 UTC (rev 49193)
+++ trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf	2018-11-19 21:52:01 UTC (rev 49194)

Property changes on: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.tex	2018-11-19 21:52:01 UTC (rev 49194)
@@ -0,0 +1,5 @@
+% this will typeset only documentation but not the code
+
+\AtBeginDocument{\OnlyDescription
+                 \let\tableofcontents\relax}
+\input{widows-and-orphans.dtx}


Property changes on: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans.tex	2018-11-19 04:05:47 UTC (rev 49193)
+++ trunk/Master/texmf-dist/doc/latex/widows-and-orphans/widows-and-orphans.tex	2018-11-19 21:52:01 UTC (rev 49194)
@@ -1,5 +0,0 @@
-% this will typeset only documentation but not the code
-
-\AtBeginDocument{\OnlyDescription
-                 \let\tableofcontents\relax}
-\input{widows-and-orphans.dtx}

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	2018-11-19 04:05:47 UTC (rev 49193)
+++ trunk/Master/texmf-dist/source/latex/widows-and-orphans/widows-and-orphans.dtx	2018-11-19 21:52:01 UTC (rev 49194)
@@ -24,6 +24,8 @@
     [final]
     {l3doc-TUB}
 
+\setcounter{page}{1}
+
 % fix for _TF undefined,
 % https://github.com/latex3/latex3/issues/477#issuecomment-419458783
 \ExplSyntaxOn
@@ -40,8 +42,23 @@
         } \fi
     \group_end:
   }
+
+\NewDocumentCommand \TypesetImplementationTF { m m }
+  {
+    \bool_if:NTF \g__codedoc_typeset_implementation_bool
+      { #1 }
+      { #2 }
+  }
+
 \ExplSyntaxOff
 
+\makeatletter  % fix for ltugboat issue with doc (if old doc is used)
+\def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus  1fill\kern\z@}%
+\def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil\kern\z@}%
+\def\pfill{\unskip~\dotfill\penalty500\strut\nobreak
+               \dotfil~\ignorespaces}%
+\makeatother
+
 \begin{document}
 
 \DocInput{widows-and-orphans.dtx}
@@ -83,7 +100,7 @@
 %
 % \begin{abstract}
 %   The \pkg{widows-and-orphans} package checks page or column breaks
-%   for issues with widow or orphans lines and issues warnings if such
+%   for issues with widow or orphan lines and issues warnings if such
 %   problems are detected. In addition, it checks and complains
 %   about breaks involving hyphenated words and warns about display
 %   formulas directly after a page break\Dash if they are allowed by the
@@ -100,13 +117,15 @@
 %
 % \section{Overview}
 %
-% To determine if a widow or orphan has occurred at a column/page
-% break the package analyses the \cs{outputpenalty} that triggered the
+% To determine if a widow or orphan has occurred at a column or page
+% break, the package analyzes the \cs{outputpenalty} that triggered the
 % break. As \TeX{} adds special penalties to widow and orphan lines
 % (\cs{widowpenalty} and \cs{clubpenalty}), we can hope to identify
 % them, provided the penalties have unique values so that we don't end
 % up with false positives.
 %
+% \TypesetImplementationTF {\enlargethispage*{2\baselineskip}}{}
+%
 % The package therefore analyzes the different parameter values and if
 % necessary adjusts the settings slightly so that all possible
 % combinations that can appear in documents have unique values and can
@@ -131,7 +150,6 @@
 %
 % The package has a number of key/value options to adjust its
 % behavior.
-%
 % The option \option{check} defines what happens
 % when an issue is found: default is \ovalue{warning}, other
 % possibilities are \ovalue{error}, \ovalue{info} and \ovalue{none}.
@@ -145,6 +163,9 @@
 % \option{avoid-all} or \option{default-all}. These options also assign
 % values to \cs{brokenpenalty} and \cs{predisplaypenalty}.
 %
+% \TypesetImplementationTF {\pagebreak}{}
+%
+%
 % \subsection{User commands}
 %
 % The package provides three user-level commands.
@@ -177,6 +198,19 @@
 % \end{function}
 %
 %
+%
+% \subsection{Related packages}
+%
+% Package \pkg{nowidow}: This package offers some commands to help
+% pushing lines from one page to another by locally
+% requesting no widows or orphans\Dash possibly for several lines. In that
+% respect it implements one of the possibilities discussed in the
+% \TUB\ article~\cite{tub-wao}. This is, however, in many cases not the
+% best solution to get rid of a widow or orphan when the interest is
+% to achieve high typographical quality.
+%
+%
+%
 % \StopEventually{
 % \begin{thebibliography}{1}
 % \bibitem{tub-wao}
@@ -184,7 +218,7 @@
 % \newblock Managing forlorn paragraph lines (a.k.a.\ widows and orphans)
 %  in \LaTeX{}.
 % \newblock \textsl{TUGboat} 39:3,
-%   \ifx\thisissuepageref\undefined \else \thisissuepageref{mitt-widows},\fi
+%   \ifx\thisissuepageref\undefined \else \thisissuepageref{mitt-widows} ,\fi
 %   2018.
 % \bibitem{expl3}
 % \LaTeX3 Project Team.
@@ -192,7 +226,7 @@
 %    \url{https://latex-project.org/publications/indexbytopic/l3-expl3/}
 % \end{thebibliography}
 % \ifx\thisissuepageref\undefined    ^^A is this TUB production ??? if not gen index
-%    \setlength\IndexMin{200pt}  \PrintIndex
+%     \setlength\IndexMin{200pt}  \PrintIndex
 % \fi
 % }
 %
@@ -300,7 +334,7 @@
 % \end{figure}
 %
 %    \begin{macrocode}
-\ProvidesExplPackage{widows-and-orphans}{2018/09/01}{v1.0a}
+\ProvidesExplPackage{widows-and-orphans}{2018/11/18}{v1.0b}
                     {Detecting widows and orphans (FMi)}
 %    \end{macrocode}
 %
@@ -417,7 +451,7 @@
         { \@@_problem_identified:n{hyphen} }
 %    \end{macrocode}
 %    However, I said ``\TeX{} adds'', which means if a widow line also
-%    ends up in a hyphen then the penalty will be the sum of both
+%    ends in a hyphen then the penalty will be the sum of both
 %    individual penalties. So all the cases above need to be repeated
 %    with \cs{brokenpenalty} added to the value.
 %    We generate the same warnings, though\Dash e.g., we will say ``Widow
@@ -489,7 +523,7 @@
 %  \end{macro}
 
       
-% \subsection{The messages to the user}
+% \subsection{Messages to the user}
 %
 %
 %  \begin{macro}{\@@_this_page:}
@@ -543,7 +577,6 @@
 %  \end{macro}
 %
 %
-%   \pagebreak
 %
 %
 %    The first message is issued if we have been directed to ignore a
@@ -571,7 +604,7 @@
   { Orphan~ on~ page~ \@@_this_page:
     \legacy_switch_if:nT {@twocolumn}
       { \space ( \legacy_switch_if:nTF {@firstcolumn}
-                                       { first~ } { (second~ } column) }
+                                       { first~ } { second~ } column) }
   }
   { Check~ out~ the~ page~ and~ see~ if~ you~ can~ avoid~ the~ orphan.}
 %    \end{macrocode}
@@ -587,7 +620,8 @@
   { Hyphen~ in~ last~ line~ of~ page~ \@@_this_page:
     \legacy_switch_if:nT {@twocolumn}
       { \space ( \legacy_switch_if:nTF {@firstcolumn}
-                                       { first~ } { (second~ } column) } }
+                                       { first~ } { second~ } column) }
+  }
   { Check~ out~ the~ page~ and~ see~ if~ you~ can~ get~
     a~ better~ line~ break. }
 %    \end{macrocode}
@@ -713,7 +747,6 @@
 %    \end{macrocode}
 %  \end{macro}
 %
-% \pagebreak
 %
 %  \begin{macro}{\@@_initialize:}
 %    Now we are ready to go. The first action is to clear the property
@@ -724,7 +757,7 @@
 %    \end{macrocode}
 %    When \TeX{} breaks a page at a glue item with no explicit penalty involved
 %    it sets \cs{outputpenalty} to \texttt{10000} in the output
-%    routine to distinguish from a case where an explicit penalty of
+%    routine to distinguish it from a case where an explicit penalty of
 %    \texttt{0} was in the document. That means none of our parameters
 %    or parameter combinations can be allowed to have that particular
 %    value, because otherwise we would get a false match for each break
@@ -838,7 +871,6 @@
 %    \begin{macrocode}
   \bool_set_false:N \l_@@_success_bool
   \bool_do_until:Nn \l_@@_success_bool
-    {
 %    \end{macrocode}
 %    Inside the loop we start with the assumption that the current
 %    value of the parameter is fine and then check if that assumption
@@ -845,7 +877,7 @@
 %    is true. If yes, we can exit the loop, otherwise we will have to
 %    try with a different value.
 %    \begin{macrocode}
-     \bool_set_true:N \l_@@_success_bool
+   { \bool_set_true:N \l_@@_success_bool
 %    \end{macrocode}
 %    For the verification we try each item in the second parameter to
 %    see if that is already in the property list.
@@ -867,7 +899,6 @@
 %    therefore add all combinations with this parameter to the
 %    property list, as from now on they are forbidden as well.
 %
-%    \pagebreak
 %
 %    So we
 %    map once more over the second argument and enter them:
@@ -876,8 +907,7 @@
        { \clist_map_inline:nn { #2 }
            { \int_set:Nn \l_@@_tmp_int {##1}
              \prop_put:NVn \l_@@_penalties_prop \l_@@_tmp_int {##1}
-	   }
-       }
+           } }
 %    \end{macrocode}
 %    If we failed we increment the parameter value and retry:
 %    \begin{macrocode}
@@ -888,8 +918,8 @@
 %
 %
 %    One place where we will run this code is at the beginning of the
-%    document (so that changes to the parameters in the preamble or
-%    the document class are picked up). The other place is when the
+%    document (so that changes to the parameters in the document class or
+%    the preamble are picked up). The other place is when the
 %    user changes any of the parameters in the middle of the document
 %    via \cs{WaOsetup}.
 %    \begin{macrocode}
@@ -931,17 +961,20 @@
                                \int_set:Nn \@clubpenalty { \clubpenalty }
   ,orphans / default .code:n = \int_set:Nn \clubpenalty  {   150        }
                                \int_set:Nn \@clubpenalty { \clubpenalty }
-   % ====================================
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
   ,widows .choice:
-  ,widows / prevent  .code:n = \int_set:Nn \widowpenalty { 10000 }
-  ,widows / avoid    .code:n = \int_set:Nn \widowpenalty {  5000 }
-  ,widows / default  .code:n = \int_set:Nn \widowpenalty {   150 }
-   % ====================================
+  ,widows / prevent  .code:n = \int_set:Nn \widowpenalty  { 10000   }
+  ,widows / avoid    .code:n = \int_set:Nn \widowpenalty  {  5000   }
+  ,widows / default  .code:n = \int_set:Nn \widowpenalty  {   150   }
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
   ,hyphens .choice:
-  ,hyphens / prevent .code:n = \int_set:Nn \brokenpenalty { 10000 }
-  ,hyphens / avoid   .code:n = \int_set:Nn \brokenpenalty {  2000 }
-  ,hyphens / default .code:n = \int_set:Nn \brokenpenalty {    50 }
-   % ====================================
+  ,hyphens / prevent .code:n = \int_set:Nn \brokenpenalty { 10000   }
+  ,hyphens / avoid   .code:n = \int_set:Nn \brokenpenalty {  2000   }
+  ,hyphens / default .code:n = \int_set:Nn \brokenpenalty {    50   }
   ,prevent-all  .code:n = \int_set:Nn \clubpenalty        { 10000   }
                           \int_set:Nn \widowpenalty       { 10000   }
                           \int_set:Nn \displaywidowpenalty{ 10000   }
@@ -1006,7 +1039,7 @@
 %    current page or column:
 %    \begin{macrocode}
 \NewDocumentCommand\WaOignorenext{}
-  { \bool_gset_false:N\g_@@_gen_warn_bool }
+  { \bool_gset_false:N \g_@@_gen_warn_bool }
 %    \end{macrocode}
 %  \end{macro}
 %

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	2018-11-19 04:05:47 UTC (rev 49193)
+++ trunk/Master/texmf-dist/tex/latex/widows-and-orphans/widows-and-orphans.sty	2018-11-19 21:52:01 UTC (rev 49194)
@@ -31,7 +31,7 @@
 
 
 \NeedsTeXFormat{LaTeX2e}    \RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{widows-and-orphans}{2018/09/01}{v1.0a}
+\ProvidesExplPackage{widows-and-orphans}{2018/11/18}{v1.0b}
                     {Detecting widows and orphans (FMi)}
 \tl_put_left:Nn \@makecol { \__fmwao_test_for_widows_etc: }
 \bool_new:N \g__fmwao_gen_warn_bool
@@ -101,7 +101,7 @@
   { Orphan~ on~ page~ \__fmwao_this_page:
     \legacy_switch_if:nT {@twocolumn}
       { \space ( \legacy_switch_if:nTF {@firstcolumn}
-                                       { first~ } { (second~ } column) }
+                                       { first~ } { second~ } column) }
   }
   { Check~ out~ the~ page~ and~ see~ if~ you~ can~ avoid~ the~ orphan.}
 \msg_new:nnnn {widows-and-orphans} {hyphen}
@@ -108,7 +108,8 @@
   { Hyphen~ in~ last~ line~ of~ page~ \__fmwao_this_page:
     \legacy_switch_if:nT {@twocolumn}
       { \space ( \legacy_switch_if:nTF {@firstcolumn}
-                                       { first~ } { (second~ } column) } }
+                                       { first~ } { second~ } column) }
+  }
   { Check~ out~ the~ page~ and~ see~ if~ you~ can~ get~
     a~ better~ line~ break. }
 \msg_new:nnnn {widows-and-orphans} {widow}
@@ -169,8 +170,7 @@
 \cs_new:Npn \__fmwao_decide_penalty:Nn #1 #2 {
   \bool_set_false:N \l__fmwao_success_bool
   \bool_do_until:Nn \l__fmwao_success_bool
-    {
-     \bool_set_true:N \l__fmwao_success_bool
+   { \bool_set_true:N \l__fmwao_success_bool
      \clist_map_inline:nn { #2 }
        { \int_set:Nn \l__fmwao_tmp_int {##1}
          \prop_get:NVNT
@@ -181,8 +181,7 @@
        { \clist_map_inline:nn { #2 }
            { \int_set:Nn \l__fmwao_tmp_int {##1}
              \prop_put:NVn \l__fmwao_penalties_prop \l__fmwao_tmp_int {##1}
-   }
-       }
+           } }
        { \int_incr:N #1 }
      }
 }
@@ -204,17 +203,14 @@
                                \int_set:Nn \@clubpenalty { \clubpenalty }
   ,orphans / default .code:n = \int_set:Nn \clubpenalty  {   150        }
                                \int_set:Nn \@clubpenalty { \clubpenalty }
-   % ====================================
   ,widows .choice:
-  ,widows / prevent  .code:n = \int_set:Nn \widowpenalty { 10000 }
-  ,widows / avoid    .code:n = \int_set:Nn \widowpenalty {  5000 }
-  ,widows / default  .code:n = \int_set:Nn \widowpenalty {   150 }
-   % ====================================
+  ,widows / prevent  .code:n = \int_set:Nn \widowpenalty  { 10000   }
+  ,widows / avoid    .code:n = \int_set:Nn \widowpenalty  {  5000   }
+  ,widows / default  .code:n = \int_set:Nn \widowpenalty  {   150   }
   ,hyphens .choice:
-  ,hyphens / prevent .code:n = \int_set:Nn \brokenpenalty { 10000 }
-  ,hyphens / avoid   .code:n = \int_set:Nn \brokenpenalty {  2000 }
-  ,hyphens / default .code:n = \int_set:Nn \brokenpenalty {    50 }
-   % ====================================
+  ,hyphens / prevent .code:n = \int_set:Nn \brokenpenalty { 10000   }
+  ,hyphens / avoid   .code:n = \int_set:Nn \brokenpenalty {  2000   }
+  ,hyphens / default .code:n = \int_set:Nn \brokenpenalty {    50   }
   ,prevent-all  .code:n = \int_set:Nn \clubpenalty        { 10000   }
                           \int_set:Nn \widowpenalty       { 10000   }
                           \int_set:Nn \displaywidowpenalty{ 10000   }
@@ -240,7 +236,7 @@
 
 \NewDocumentCommand\WaOparameters{}{\prop_show:N \l__fmwao_penalties_prop}
 \NewDocumentCommand\WaOignorenext{}
-  { \bool_gset_false:N\g__fmwao_gen_warn_bool }
+  { \bool_gset_false:N \g__fmwao_gen_warn_bool }
 
 \endinput
 %%



More information about the tex-live-commits mailing list