summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/addlines/addlines.sty
blob: 96d49f226f5a619b9f629f79e9001c27a40faab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%%
%% This is file `addlines.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% addlines.dtx  (with options: `package')
%% 
%%   _______________________________________
%%   Copyright (C) 2007-2008  Will Robertson
%% 
%%   License information appended.
%% 
\ProvidesPackage{addlines}
  [2008/08/16 v0.2 Add/remove lines from a page]
\RequirePackage{etex,afterpage,changepage}
\newif\if@addlines@checkpage@
\DeclareOption{final}{\@addlines@checkpage@true}
\DeclareOption{draft}{\@addlines@checkpage@false}
\ExecuteOptions{final}
\ProcessOptions
\newcommand\addlines[1][1]{%
  \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
\newcommand\removelines[1][1]{%
  \addlines[\numexpr -1*(#1) \relax]}
\let\removeline\removelines
\strictpagechecktrue
%% 
%% 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
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by Will Robertson.
%% 
%% This work consists of the files addlines.dtx and
%%                                 addlines.ins,
%%           and the derived files addlines.pdf,
%%                                 addlines.sty, and
%%                                 addlines-example.ltx.
%% 
%%
%% End of file `addlines.sty'.