summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-18 22:28:38 +0000
committerKarl Berry <karl@freefriends.org>2011-09-18 22:28:38 +0000
commit649107c8ec87f4bc736e7089a0bf9aed9ba1e137 (patch)
tree04623d8fc210bb8d43ecdbb8f39db8179499c86a
parent6db79334c1cc1379812ec2d45bd12de5eae8c6e0 (diff)
nowidow 0.4 (14sep11)
git-svn-id: svn://tug.org/texlive/trunk@24001 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/nowidow/README.TEXLIVE7
-rw-r--r--Master/texmf-dist/doc/latex/nowidow/nowidow.pdfbin101736 -> 123697 bytes
-rw-r--r--Master/texmf-dist/source/latex/nowidow/nowidow.dtx134
-rw-r--r--Master/texmf-dist/tex/latex/nowidow/nowidow.sty32
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check3
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds1
6 files changed, 158 insertions, 19 deletions
diff --git a/Master/texmf-dist/doc/latex/nowidow/README.TEXLIVE b/Master/texmf-dist/doc/latex/nowidow/README.TEXLIVE
new file mode 100644
index 00000000000..6c28a7b565b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/nowidow/README.TEXLIVE
@@ -0,0 +1,7 @@
+The following files have been removed in the TeX Live installation of
+the current package, typically due to duplication, lack of space, or
+missing source code. You can find these files on CTAN at
+ http://mirror.ctan.org/macros/latex/contrib/nowidow
+If questions or concerns, email tex-live@tug.org.
+
+ nowidow-test.pdf
diff --git a/Master/texmf-dist/doc/latex/nowidow/nowidow.pdf b/Master/texmf-dist/doc/latex/nowidow/nowidow.pdf
index 437734cb8cb..356f1d4ac36 100644
--- a/Master/texmf-dist/doc/latex/nowidow/nowidow.pdf
+++ b/Master/texmf-dist/doc/latex/nowidow/nowidow.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/nowidow/nowidow.dtx b/Master/texmf-dist/source/latex/nowidow/nowidow.dtx
index 833ca1f0367..db0bf62c217 100644
--- a/Master/texmf-dist/source/latex/nowidow/nowidow.dtx
+++ b/Master/texmf-dist/source/latex/nowidow/nowidow.dtx
@@ -26,12 +26,12 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{nowidow}
%<*package>
- [2011/09/11 0.2 Easily prevent widows]
+ [2011/09/14 0.4 Easily prevent widows and orphans]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
-\usepackage{nowidow}[2011/09/11]
+\usepackage{nowidow}[2011/09/14]
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -43,7 +43,7 @@
%</driver>
% \fi
%
-% \CheckSum{24}
+% \CheckSum{55}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -62,6 +62,8 @@
% Right brace \} Tilde \~}
%
%
+% \changes{0.4}{2011/09/14}{Add orphan management}
+% \changes{0.3}{2011/09/13}{Add setnowidow command and package options}
% \changes{0.2}{2011/09/11}{Fix nowidow@X}
% \changes{0.1}{2011/09/11}{Initial version}
%
@@ -70,34 +72,59 @@
% \providecommand*{\url}{\texttt}
% \GetFileInfo{nowidow.dtx}
% \title{The \textsf{nowidow} package}
-% \author{Raphaƫl Pinson \\ \url{raphink@gmail.com}}
+% \author{Rapha\"el Pinson \\ \url{raphink@gmail.com}}
% \date{\fileversion~from \filedate}
%
% \maketitle
%
% \section{Introduction}
%
-% Widows (single lines at the top of a page) happen frequently
+% This package was based on the answer to a
+% question\footnote{\url{http://tex.stackexchange.com/questions/26272/expansion-issue-with-begingroup-and-foreach/26275\#26275}}
+% about expansion with |\begingroup| and |\foreach| asked on \url{http://tex.stackexchange.com}.
+% Thanks to Martin Scharrer\footnote{\url{http://tex.stackexchange.com/users/2975/martin-scharrer}} for his solution.
+%
+% Widows (single lines at the top of a page) and orphans
+% (single lines at the bottom of a page) happen frequently
% and should be avoided.
%
-% The |\widowpenalty| command allows to prevent them,
-% but its syntax is a bit complex to use.
+% The |\widowpenalties| and |\clubpenalties| commands allow to prevent them,
+% but their syntax is a bit complex to use.
%
-% The \textsf{nowidow} package provides a |\nowidow| command which is simpler
-% to use in order to prevent widows.
+% The \textsf{nowidow} package provides |\nowidow| and |\noclub| commands
+% which are simpler to use in order to prevent widows and orphans.
%
% \section{Usage}
%
% To load the package, use:
%
% \begin{verbatim}
-% \usepackage{nowidow}
+% \usepackage[<options>]{nowidow}
+% \end{verbatim}
+%
+% \subsection{Options}
+%
+% \DescribeMacro{defaultlines=<value>}
+%
+% The \texttt{defaultlines} option
+% sets the default minimal number of lines
+% to be kept after or before the page break.
+%
+% \DescribeMacro{all}
+%
+% The \texttt{all} option sets the widow and orphan penalties
+% for the whole document upon loading the package, for example:
+%
+% \begin{verbatim}
+% \usepackage[defaultlines=4,all]{nowidow}
% \end{verbatim}
%
+% \subsection{Commands}
+%
% \DescribeMacro{\nowidow}
%
% To prevent widows in a paragraph, call |\nowidow|
-% immediatly at the of the paragraph (without an empty line),
+% immediatly at the end of the paragraph (without an empty line),
% optionally followed by the minimal number of lines you
% want after the page break:
%
@@ -108,8 +135,41 @@
% \end{verbatim}
%
% The minimal number of lines to be kept after
-% the page break defaults to 2 if not specified.
+% the page break defaults to 2 if not specified
+% or overridden by the \texttt{defaultlines} option.
+%
+% \DescribeMacro{\setnowidow}
+%
+% This macro is similar to |\nowidow| but sets
+% the widow penalty for the whole document
+% instead of the current paragraph only.
%
+% This macro is used when the package is loaded
+% with the \texttt{all} option.
+%
+% \DescribeMacro{\noclub}
+%
+% This is similar to the |\nowidow| command
+% but prevents orphans at the end of a page:
+%
+% \begin{verbatim}
+% This paragraph overflows to the next page,
+% but I really don't want any orphans in it.
+% \noclub[3]
+% \end{verbatim}
+%
+% The minimal number of lines to be kept before
+% the page break defaults to 2 if not specified
+% or overridden by the \texttt{defaultlines} option.
+%
+% \DescribeMacro{\setnoclub}
+%
+% This macro is similar to |\noclub| but sets
+% the orphan penalty for the whole document
+% instead of the current paragraph only.
+%
+% This macro is used when the package is loaded
+% with the \texttt{all} option.
%
% \StopEventually{}
%
@@ -123,6 +183,19 @@
\ProvidesPackage{nowidow}
% \end{macrocode}
%
+% \begin{macro}{Options}
+% \begin{macrocode}
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{
+ family=nowidow,
+ prefix=nowidow@,
+}
+\DeclareStringOption[2]{defaultlines}
+\DeclareBoolOption{all}
+\ProcessKeyvalOptions*
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\nowidow@X}
% \begin{macrocode}
\def\nowidow@X#1{%
@@ -135,18 +208,49 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\setnowidow}
+% \begin{macrocode}
+\newcommand{\setnowidow}[1][\nowidow@defaultlines]{%
+ \mathchardef\nowidowmax#1\relax
+ \widowpenalties #1 \nowidow@X{1} 0\par
+}
+\ifnowidow@all
+ \setnowidow
+\fi
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\nowidow}
% \begin{macrocode}
-\newcommand{\nowidow}[1][2]{%
+\newcommand{\nowidow}[1][\nowidow@defaultlines]{%
\begingroup
- \mathchardef\nowidowmax#1\relax
- \widowpenalties #1 \nowidow@X{1} 0\par
+ \setnowidow[#1]
\endgroup
}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\setnoclub}
+% \begin{macrocode}
+\newcommand{\setnoclub}[1][\nowidow@defaultlines]{%
+ \mathchardef\nowidowmax#1\relax
+ \clubpenalties #1 \nowidow@X{1} 0\par
+}
+\ifnowidow@all
+ \setnoclub
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\noclub}
+% \begin{macrocode}
+\newcommand{\noclub}[1][\nowidow@defaultlines]{%
+ \begingroup
+ \setnoclub[#1]
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
%
% \iffalse
%</package>
diff --git a/Master/texmf-dist/tex/latex/nowidow/nowidow.sty b/Master/texmf-dist/tex/latex/nowidow/nowidow.sty
index 0eee05aa210..406dabf040a 100644
--- a/Master/texmf-dist/tex/latex/nowidow/nowidow.sty
+++ b/Master/texmf-dist/tex/latex/nowidow/nowidow.sty
@@ -20,8 +20,16 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{nowidow}
- [2011/09/11 0.2 Easily prevent widows]
+ [2011/09/14 0.4 Easily prevent widows and orphans]
\ProvidesPackage{nowidow}
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{
+ family=nowidow,
+ prefix=nowidow@,
+}
+\DeclareStringOption[2]{defaultlines}
+\DeclareBoolOption{all}
+\ProcessKeyvalOptions*
\def\nowidow@X#1{%
\ifnum#1<\nowidowmax
10000
@@ -29,10 +37,28 @@
\the\numexpr(#1)+1\expandafter\relax\expandafter}%
\fi
}
-\newcommand{\nowidow}[1][2]{%
- \begingroup
+\newcommand{\setnowidow}[1][\nowidow@defaultlines]{%
\mathchardef\nowidowmax#1\relax
\widowpenalties #1 \nowidow@X{1} 0\par
+}
+\ifnowidow@all
+ \setnowidow
+\fi
+\newcommand{\nowidow}[1][\nowidow@defaultlines]{%
+ \begingroup
+ \setnowidow[#1]
+ \endgroup
+}
+\newcommand{\setnoclub}[1][\nowidow@defaultlines]{%
+ \mathchardef\nowidowmax#1\relax
+ \clubpenalties #1 \nowidow@X{1} 0\par
+}
+\ifnowidow@all
+ \setnoclub
+\fi
+\newcommand{\noclub}[1][\nowidow@defaultlines]{%
+ \begingroup
+ \setnoclub[#1]
\endgroup
}
\endinput
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 4eef1a2e050..592725a7d13 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -380,7 +380,8 @@ my @TLP_working = qw(
tokenizer toolbox tools topfloat totcount totpages toptesi
trajan
translation-arsclassica-de translation-chemsym-de
- translation-europecv-de translation-evc-de translation-moreverb-de
+ translation-europecv-de translation-evc-de
+ translation-filecontents-de translation-moreverb-de
tree-dvips trfsigns trimspaces trivfloat trsym truncate
tsemlines
tucv tufte-latex tugboat tugboat-plain turkmen turnstile turnthepage
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index 49886cba0a0..8d51700364a 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -2099,6 +2099,7 @@ $standardclean = '\.head|\.tmp|\.dvi|\.log|\.out|\.aux|\.toc|\.lof|\.lot'
'jknapltx' => 'ubbold.fd', # clash bbold's Ubbold.fd; sauter bbold fails
'jlabels' => 'jlabels.pdf', # no source
'linguex' => 'cgloss4e.sty', # symlink
+ 'nowidow' => 'nowidow-test.pdf', # no source
'numericplots' => '.*\.m', # matlab
'piechartmp' => 'piechartmp.pdf', # no source
'ptptex' => '(overcite|cite|wrapfig).sty', # duplicated