summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/savetrees
diff options
context:
space:
mode:
authorReinhard Kotucha <reinhard.kotucha@web.de>2006-11-25 17:23:32 +0000
committerReinhard Kotucha <reinhard.kotucha@web.de>2006-11-25 17:23:32 +0000
commite99754332735dd885d2fd4714f2e8c37576ab1ca (patch)
tree9db91badc3a99df6b94cc80bdee6356e19fce006 /Master/texmf-dist/source/latex/savetrees
parent01a2923c9562d87e93e06777e560f3fd981e955d (diff)
update savetrees.
git-svn-id: svn://tug.org/texlive/trunk@2527 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/savetrees')
-rw-r--r--Master/texmf-dist/source/latex/savetrees/savetrees.dtx109
-rw-r--r--Master/texmf-dist/source/latex/savetrees/savetrees.ins16
2 files changed, 97 insertions, 28 deletions
diff --git a/Master/texmf-dist/source/latex/savetrees/savetrees.dtx b/Master/texmf-dist/source/latex/savetrees/savetrees.dtx
index bad28cdc161..59a2fe0934e 100644
--- a/Master/texmf-dist/source/latex/savetrees/savetrees.dtx
+++ b/Master/texmf-dist/source/latex/savetrees/savetrees.dtx
@@ -1,30 +1,32 @@
% \iffalse meta-comment
%
-% Copyright (C) 2004 by Scott Pakin <scott+st@pakin.org>
+% Copyright (C) 2006 by Scott Pakin <scott+st@pakin.org>
% ------------------------------------------------------
%
% This file may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.2
+% 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
%
-% and version 1.2 or later is part of all distributions of LaTeX
-% version 1999/12/01 or later.
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2006/05/20 or later.
%
% \fi
%
% \iffalse
+%<*driver>
+\ProvidesFile{savetrees.dtx}
+%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{savetrees}
-%<package> [2004/07/17 v1.1 Pack as much text as possible onto each page]
+%<*package>
+ [2006/11/20 v1.2 Pack as much text as possible onto each page]
+%</package>
%
%<*driver>
\documentclass{ltxdoc}
-\usepackage[normalbibnotes,normalbib,normalfloats,normalindent,
- normalleading,normallists,normalmargins,normalsections,
- normaltitle]{savetrees}
\usepackage{array}
\usepackage{dcolumn}
\usepackage{tabularx}
@@ -38,7 +40,7 @@
%</driver>
% \fi
%
-% \CheckSum{278}
+% \CheckSum{293}
%
% \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
@@ -59,7 +61,7 @@
%
% \changes{v1.0}{2002/07/06}{Initial version}
%
-% \GetFileInfo{savetrees.sty}
+% \GetFileInfo{savetrees.dtx}
%
% \DoNotIndex{\.,\@arabic,\@author,\@biblabel,\@clubpenalty,\@date,\@empty}
% \DoNotIndex{\@enumctr,\@enumdepth,\@gobble,\@itemdepth,\@itemitem}
@@ -146,9 +148,13 @@
% whitespace &
% Redefine \texttt{\string\maketitle} \\
%
-% Reduced interline spacing &
+% Reduce interline spacing &
% Reassign \texttt{\string\baselinestretch} \\
%
+% Discourage \TeX\ from allowing the last line of a paragraph to
+% contain only a single word &
+% Reassign \texttt{\string\looseness} \\
+%
% Typeset bibliographies smaller and with no inter-item spacing &
% Redefine \texttt{thebibliography} \\
% \hline
@@ -230,6 +236,8 @@
%
% \item[\pkgoption{normalleading}] Don't modify interline spacing.
%
+% \item[\pkgoption{normallooseness}] Don't modify paragraph looseness.
+%
% \item[\pkgoption{normalbib}] Don't modify bibliography formatting.
%
% \item[\pkgoption{normalbibnotes}] Don't omit |NOTE| fields from the
@@ -434,14 +442,18 @@
% to pack more text onto a page with minimal effort, \progname{makethin}
% can be quite efficacious.
%
+% \DeleteShortVerb{\|}
% \begin{center}
-% \textbf{Warning} \\
-% \fbox{\begin{minipage}{0.66\textwidth}
+% \begin{tabular}{|p{0.66\linewidth}|}
+% \multicolumn{1}{c}{\textbf{Warning}} \\
+% \hline
% To avoid confusion with the original font-metric files, do not
% distribute the \texttt{.tfm} or \texttt{.vf} files generated by
-% \progname{makethin} unless you rename them first.
-% \end{minipage}}
+% \progname{makethin} unless you rename them first. \\
+% \hline
+% \end{tabular}
% \end{center}
+% \MakeShortVerb{\|}
%
% In addition to requiring Perl\index{Perl|usage}, \progname{makethin}
% depends upon two helper programs: \progname{kpsewhich} and
@@ -1025,6 +1037,21 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\if@st@normal@looseness}
+% \begin{macro}{\@st@normal@loosenesstrue}
+% \begin{macro}{\@st@normal@loosenessfalse}
+% These are used to conditionally disable \pkgname{savetrees}'s
+% modifications to \TeX's paragraph looseness (i.e.,~the number of lines
+% by which \TeX\ is instructed to shrink each paragraph).
+% \begin{macrocode}
+\newif\if@st@normal@looseness
+\DeclareOption{normallooseness}{\@st@normal@loosenesstrue}
+% \end{macrocode}
+% \pkgoptiondecl{normallooseness}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\if@st@normal@bib}
% \begin{macro}{\@st@normal@bibtrue}
% \begin{macro}{\@st@normal@bibfalse}
@@ -1098,13 +1125,17 @@
% Use the \pkgname{geometry} package to narrow our page margins, unless
% the author wants to keep \LaTeX's original ones. Note that we accept
% \pkgname{geometry}'s default of zero space allocated to marginal notes.
+% \changes{v1.2}{2006/11/20}{Made the top margin consistent with the other
+% margins and allocated space for the footer}
% \begin{macrocode}
\if@st@normal@margins
\else
\RequirePackage[lmargin=\@st@marginsize,
rmargin=\@st@marginsize,
- tmargin=0pt,
- bmargin=\@st@marginsize]{geometry}
+ tmargin=\@st@marginsize,
+ bmargin=\@st@marginsize,
+ includefoot,
+ footskip=2ex]{geometry}
\fi
% \end{macrocode}
%
@@ -1306,6 +1337,41 @@
% \end{macro}
%
%
+% \subsection{Paragraph looseness}
+% \changes{v1.2}{2006/11/20}{Added support for reducing paragraph looseness}
+%
+% Some paragraphs end with a lone word on the last line. If we can
+% discourage such typesetting we can gain an extra line. The underlying
+% mechanism we use is \TeX's |\looseness| primitive, which encourages
+% \TeX\ to expand the current paragraph by a given number of lines.
+% However, |\looseness| can be set to a negative number, which
+% encourages \TeX\ to shrink the current paragraph by a given number of
+% lines. For this technique to work, the paragraph must be relatively
+% long to \TeX\ has enough shrinkable whitespace to work with.
+%
+% Unfortunately, |\looseness| applies only to the current paragraph. We
+% therefore use |\everypar| to inject |\looseness=-1| into every
+% paragraph. However, the approach is not quite so simple as the
+% |\looseness=-1| is not injected into list environments. We therefore
+% use some tricky code due to Donald Arseneau to make the effect of
+% |\looseness=-1| as global as possible:
+% \begin{macrocode}
+\if@st@normal@looseness
+\else
+ \let\markeverypar\everypar
+ \newtoks\everypar
+ \everypar\markeverypar
+ \markeverypar{\the\everypar\looseness=-1}
+\fi
+% \end{macrocode}
+%
+% Even when |\everypar| is used in the ordinary fashion it is likely to
+% conflict with various \LaTeX\ packages. Because the preceding code is
+% a particularly tricky redefinition of |\everypar| it's likely that
+% many documents will need to disable paragraph looseness by specifying
+% the \pkgoption{normallooseness} option to \pkgname{savetrees}.
+%
+%
% \subsection{Bibliography formatting}
%
% There are two ways we save space when typesetting bibliographies.
@@ -1334,14 +1400,17 @@
% \changes{v1.1}{2004/07/17}{Modified to test for
% \texttt{\string\string\string\chapter}, not
% \texttt{\string\string\string\bibname}.}
+% \changes{v1.2}{2006/11/19}{Modified to use the more robust
+% \texttt{\string\string\string\@ifundefined} macro to test for the existence
+% of \texttt{\string\string\string\chapter}}
% \begin{macrocode}
- \ifx\chapter\@undefined
+ \@ifundefined{chapter}{%
\section*{\refname
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}}%
- \else
+ }{%
\chapter*{\bibname
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
- \fi
+ }%
% \end{macrocode}
% Back to the original code\dots
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/savetrees/savetrees.ins b/Master/texmf-dist/source/latex/savetrees/savetrees.ins
index f262f0fc887..212eb77e4c7 100644
--- a/Master/texmf-dist/source/latex/savetrees/savetrees.ins
+++ b/Master/texmf-dist/source/latex/savetrees/savetrees.ins
@@ -1,15 +1,15 @@
%%
-%% Copyright (C) 2004 by Scott Pakin <scott+st@pakin.org>
+%% Copyright (C) 2006 by Scott Pakin <scott+st@pakin.org>
%%
%% This file may be distributed and/or modified under the conditions of
-%% the LaTeX Project Public License, either version 1.2 of this license
+%% 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
%%
-%% and version 1.2 or later is part of all distributions of LaTeX version
-%% 1999/12/01 or later.
+%% and version 1.3c or later is part of all distributions of LaTeX version
+%% 2006/05/20 or later.
%%
\input docstrip.tex
@@ -25,17 +25,17 @@
This is a generated file.
-Copyright (C) 2004 by Scott Pakin <scott+st@pakin.org>
+Copyright (C) 2006 by Scott Pakin <scott+st@pakin.org>
This file may be distributed and/or modified under the conditions of
-the LaTeX Project Public License, either version 1.2 of this license
+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
-and version 1.2 or later is part of all distributions of LaTeX version
-1999/12/01 or later.
+and version 1.3c or later is part of all distributions of LaTeX version
+2006/05/20 or later.
\endpreamble