-
Notifications
You must be signed in to change notification settings - Fork 15
/
savetrees.sty
189 lines (189 loc) · 5.4 KB
/
savetrees.sty
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
%%
%% This is file `savetrees.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% savetrees.dtx (with options: `package')
%%
%% This is a generated file.
%%
%% Copyright (C) 2007 by Scott Pakin <[email protected]>
%%
%% This file may be distributed and/or modified under the 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.3c or later is part of all distributions of LaTeX version
%% 2006/05/20 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{savetrees}
[2007/12/23 v1.2a Pack as much text as possible onto each page]
\newif\if@st@normal@sections
\DeclareOption{normalsections}{\@st@normal@sectionstrue}
\newif\if@st@normal@margins
\DeclareOption{normalmargins}{\@st@normal@marginstrue}
\newif\if@st@normal@lists
\DeclareOption{normallists}{\@st@normal@liststrue}
\newif\if@st@normal@floats
\DeclareOption{normalfloats}{\@st@normal@floatstrue}
\newif\if@st@normal@indent
\DeclareOption{normalindent}{\@st@normal@indenttrue}
\newif\if@st@normal@title
\DeclareOption{normaltitle}{\@st@normal@titletrue}
\newif\if@st@normal@leading
\DeclareOption{normalleading}{\@st@normal@leadingtrue}
\newif\if@st@normal@looseness
\DeclareOption{normallooseness}{\@st@normal@loosenesstrue}
\newif\if@st@normal@bib
\DeclareOption{normalbib}{\@st@normal@bibtrue}
\newif\if@st@normal@bibnotes
\DeclareOption{normalbibnotes}{\@st@normal@bibnotestrue}
\ProcessOptions\relax
\if@st@normal@sections
\else
\RequirePackage[tiny,compact]{titlesec}
\fi
\newlength{\@st@marginsize}
\setlength{\@st@marginsize}{1.5cm}
\if@st@normal@margins
\else
\RequirePackage[lmargin=\@st@marginsize,
rmargin=\@st@marginsize,
tmargin=\@st@marginsize,
bmargin=\@st@marginsize,
includefoot,
footskip=2ex]{geometry}
\fi
\if@st@normal@lists
\else
\RequirePackage{calc}
\def\itemize{%
\ifnum \@itemdepth >\thr@@\@toodeep\else
\advance\@itemdepth\@ne
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\expandafter
\list
\csname\@itemitem\endcsname
{\def\makelabel##1{\hss\llap{##1}}%
\settowidth{\leftmargin}{\csname\@itemitem\endcsname}%
\addtolength{\leftmargin}{\labelsep * \@itemdepth}%
\setlength{\topsep}{4pt plus 1pt minus 2pt}%
\setlength{\itemsep}{0pt}%
\setlength{\parsep}{0pt}%
}%
\fi}
\def\enumerate{%
\ifnum \@enumdepth >\thr@@\@toodeep\else
\advance\@enumdepth\@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\expandafter
\list
\csname label\@enumctr\endcsname
{\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}%
\settowidth{\leftmargin}{\csname label\@enumctr\endcsname}%
\addtolength{\leftmargin}{\labelsep * \@enumdepth}%
\setlength{\topsep}{4pt plus 1pt minus 2pt}%
\setlength{\itemsep}{0pt}%
\setlength{\parsep}{0pt}%
}
\fi}
\renewenvironment{description}{%
\begin{list}{}{\setlength{\leftmargin}{1em}%
\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}%
}{%
\end{list}
}
\fi
\if@st@normal@floats
\else
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.85}
\renewcommand{\dbltopfraction}{0.85}
\renewcommand{\dblfloatpagefraction}{.85}
\setcounter{topnumber}{25}
\setcounter{bottomnumber}{25}
\setcounter{totalnumber}{25}
\setcounter{dbltopnumber}{25}
\fi
\if@st@normal@indent
\else
\setlength{\parindent}{1em}
\fi
\if@st@normal@title
\else
\def\@maketitle{%
\newpage
\null
\begin{center}%
\let \footnote \thanks
{\large \textbf{\@title}\par}
\vskip 0.5\baselineskip
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par
\vskip 0.5\baselineskip
\@date
\end{center}%
\par
\vskip \baselineskip
}
\fi
\if@st@normal@leading
\else
\renewcommand{\baselinestretch}{0.9}
\fi
\if@st@normal@looseness
\else
\let\markeverypar\everypar
\newtoks\everypar
\everypar\markeverypar
\markeverypar{\the\everypar\looseness=-1\relax}
\fi
\if@st@normal@bib
\else
\renewenvironment{thebibliography}[1]{%
\@ifundefined{chapter}{%
\section*{\refname
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}}%
}{%
\chapter*{\bibname
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\setlength{\parsep}{0pt}%
\setlength{\itemsep}{1pt}%
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\small
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m
}{%
\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist
}
\fi
\if@st@normal@bibnotes
\newcommand{\savetreesbibnote}[1]{#1}
\else
\newcommand{\savetreesbibnote}[1]{\@gobble}
\fi
\endinput
%%
%% End of file `savetrees.sty'.