summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-09-08 16:23:48 +0000
committerKarl Berry <karl@freefriends.org>2008-09-08 16:23:48 +0000
commit1e490c47d2998d62acb68dc520a10f7966ca484f (patch)
treecc139e7d350623f54c63d5e5cc6ac95443c402aa /Master/texmf-dist/source
parentb570aa2dd0f2c5e23b1f3bac8aeaf2e337c1f7f9 (diff)
addlines update (16aug08)
git-svn-id: svn://tug.org/texlive/trunk@10494 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/addlines/addlines.dtx83
-rw-r--r--Master/texmf-dist/source/latex/addlines/addlines.ins12
2 files changed, 57 insertions, 38 deletions
diff --git a/Master/texmf-dist/source/latex/addlines/addlines.dtx b/Master/texmf-dist/source/latex/addlines/addlines.dtx
index fa39d15cbdc..97fbd69d528 100644
--- a/Master/texmf-dist/source/latex/addlines/addlines.dtx
+++ b/Master/texmf-dist/source/latex/addlines/addlines.dtx
@@ -5,7 +5,7 @@
%<*readme>
____________________
The addlines package
-v0.1
+v0.2
This package provides the command \addlines for adding
or removing space in the textblock of the page it's
@@ -15,11 +15,16 @@ so that a section fits better on the next page.
It will also add space to the *facing* page in a
two-sided document.
+An inverse command is provided if you prefer it:
+ \removelines{ x } == \addlines{ -x }
+
+See addlines.pdf for more info.
+
______________
Will Robertson
wspr 81 [at] gmail [dot] com
-Copyright 2007
+Copyright 2007-2008
Distributed under the LaTeX Project Public License
%</readme>
%<*internal>
@@ -31,8 +36,8 @@ Distributed under the LaTeX Project Public License
\keepsilent
\preamble
- __________________________________
- Copyright (C) 2007 Will Robertson
+ _______________________________________
+ Copyright (C) 2007-2008 Will Robertson
License information appended.
@@ -40,7 +45,7 @@ Distributed under the LaTeX Project Public License
\endpreamble
\postamble
-Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+Copyright (C) 2007-2008 by Will Robertson <wspr81@gmail.com>
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -94,8 +99,9 @@ This work consists of the files addlines.dtx and
%
% \maketitle
%
+% \noindent
% This is a small package that defines a user command for adding lines
-% to the current and facing page. This is intended to be used in the
+% to the current (and facing page, if appropriate). This is intended to be used in the
% final typesetting
% process of a manuscript for running pages long or short in order to
% fit their material better (starting a paragraph on the next page,
@@ -121,7 +127,7 @@ This work consists of the files addlines.dtx and
% For syntactic sugar, \cmd{\addline} is a synonym for \cmd\addlines,
% and \cmd{\removeline\textcolor{gray}(s\textcolor{gray})} is the opposite of \cmd\addlines.
%
-% As mentioned in the introduction, for a double-sided document
+% As alluded to in the introduction, for a double-sided document
% (\eg, if the class option |[twoside]| is in
% effect) extra height must be added to \emph{both pages} on a spread
% for things to look good. If \cmd\addlines\ is called on an even page
@@ -129,13 +135,18 @@ This work consists of the files addlines.dtx and
% facing page. Conversely, on an odd page (\ie, a \emph{recto} or right-side
% page) an error is produced, but the space is still added.
%
+% These errors can be suppressed by loading \pkg{addlines} with the |[draft]|
+% package option. The option that indicates that errors should
+% be shown is |[final]|; this is activated by default but could be overridden with a |[draft]|
+% class option.
+%
% \subsection*{Notes}
% This command is a wrapper around the more basic command
-% \cmd\enlargethispage. It uses the \pkg{chngpage} package to check if
+% \cmd\enlargethispage. It uses the \pkg{changepage} package to check if
% the command is called on an even page, and the \pkg{afterpage}
% package to add material to a facing odd page if necessary.
%
-% The \pkg{chngpage} mechanism for detecting page number oddness may
+% The \pkg{changepage} mechanism for detecting page number oddness may
% require more than a single \LaTeX\ compilation to stabilise, so
% false positives may occur. If \pkg{memoir} is used, its
% \cmd\strictpagechecktrue\ command is executed.
@@ -152,7 +163,8 @@ This work consists of the files addlines.dtx and
%<*example>
\documentclass[twoside]{article}
\usepackage[a5paper,width=30em,lines=30]{geometry}
-\usepackage{lipsum,addlines}
+\usepackage{lipsum}
+\usepackage{addlines}
\begin{document}
\lipsum[1-5]
@@ -163,9 +175,17 @@ This work consists of the files addlines.dtx and
\emph{Here is the command used erroneously on an odd page.}
\addlines
+
+\lipsum[16-20]
\end{document}
%</example>
% \end{macrocode}
+%
+% \subsection*{Change history}
+% \begin{description}
+% \item[0.1] Initial version implementing the basic commands.
+% \item[0.2] Switched from \pkg{chngpage} to \pkg{changepage} and added package options |[draft]| and |[final]|.
+% \end{description}
%
%
%
@@ -180,21 +200,21 @@ This work consists of the files addlines.dtx and
%
% \begin{macrocode}
\ProvidesPackage{addlines}
- [2007/10/13 v0.1 Add/remove lines from a page]
+ [2008/08/16 v0.2 Add/remove lines from a page]
% \end{macrocode}
%
% Packages:
% \begin{macrocode}
-\RequirePackage{etex,afterpage,chngpage}
+\RequirePackage{etex,afterpage,changepage}
% \end{macrocode}
%
-% Detecting \pkg{memoir} for \pkg{chngpage} incompatibilities.
+% Option:
% \begin{macrocode}
-\newif\ifpl@memoir
-\def\ifmemoir@tf{%
- \ifpl@memoir\expandafter\@firstoftwo
- \else\expandafter\@secondoftwo\fi}
-\@ifclassloaded{memoir}{\pl@memoirtrue}{\pl@memoirfalse}
+\newif\if@addlines@checkpage@
+\DeclareOption{final}{\@addlines@checkpage@true}
+\DeclareOption{draft}{\@addlines@checkpage@false}
+\ExecuteOptions{final}
+\ProcessOptions
% \end{macrocode}
%
% \begin{macro}{\addlines}
@@ -202,15 +222,17 @@ This work consists of the files addlines.dtx and
% \begin{macrocode}
\newcommand\addlines[1][1]{%
\enlargethispage{#1\baselineskip}%
- \if@twoside
- \checkoddpage
- \ifmemoir@tf\ifoddpage\ifcpoddpage
- \PackageError{addlines}
- {You're adding lines to the wrong page}
- {Extra lines need to be added to both sides of a doublepage spread.^^J
- This error might clear up after a recompile, though.}%
- \else
- \afterpage{\enlargethispage{#1\baselineskip}}%
+ \if@addlines@checkpage@
+ \if@twoside
+ \checkoddpage
+ \ifoddpage
+ \PackageError{addlines}
+ {You're adding lines to the wrong page}
+ {Extra lines need to be added to both sides of a doublepage spread.^^J
+ This error might clear up after a recompile, though.}%
+ \else
+ \afterpage{\enlargethispage{#1\baselineskip}}%
+ \fi
\fi
\fi}
\let\addline\addlines
@@ -227,12 +249,9 @@ This work consists of the files addlines.dtx and
% \end{macrocode}
% \end{macro}
%
-% Finally, we don't want sloppy page number checking if we're using
-% \pkg{memoir}:
+% Finally, we don't want sloppy page number checking:
% \begin{macrocode}
-\ifpl@memoir
- \strictpagechecktrue
-\fi
+\strictpagechecktrue
% \end{macrocode}
%
%\iffalse
diff --git a/Master/texmf-dist/source/latex/addlines/addlines.ins b/Master/texmf-dist/source/latex/addlines/addlines.ins
index 260a24ddcbb..28329326489 100644
--- a/Master/texmf-dist/source/latex/addlines/addlines.ins
+++ b/Master/texmf-dist/source/latex/addlines/addlines.ins
@@ -6,8 +6,8 @@
%%
%% addlines.dtx (with options: `batchfile')
%%
-%% __________________________________
-%% Copyright (C) 2007 Will Robertson
+%% _______________________________________
+%% Copyright (C) 2007-2008 Will Robertson
%%
%% License information appended.
%%
@@ -16,15 +16,15 @@
\keepsilent
\preamble
- __________________________________
- Copyright (C) 2007 Will Robertson
+ _______________________________________
+ Copyright (C) 2007-2008 Will Robertson
License information appended.
\endpreamble
\postamble
-Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+Copyright (C) 2007-2008 by Will Robertson <wspr81@gmail.com>
Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
@@ -45,7 +45,7 @@ This work consists of the files addlines.dtx and
\generate{\file{\jobname-example.ltx}{\from{\jobname.dtx}{example}}}
\endbatchfile
%%
-%% Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+%% Copyright (C) 2007-2008 by Will Robertson <wspr81@gmail.com>
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of