-
Notifications
You must be signed in to change notification settings - Fork 0
/
balance.sty
executable file
·87 lines (86 loc) · 3.29 KB
/
balance.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
%%
%% This is file `balance.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% balance.dtx (with options: `package')
%% =============================================
%% IMPORTANT NOTICE:
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%%
%% This is a generated file.
%% It may not be distributed without the original source file balance.dtx.
%%
%% Full documentation can be obtained by LaTeXing that original file.
%% Only a few abbreviated comments remain here to describe the usage.
%% =============================================
%% Copyright 1993-1999 Patrick W Daly
%% Max-Planck-Institut f\"ur Aeronomie
%% Max-Planck-Str. 2
%% D-37191 Katlenburg-Lindau
%% Germany
%% E-mail: daly@linmpi.mpg.de
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{balance}
[1999/02/23 4.3 (PWD)]
% In order to balance the columns on a page, \balance must be given
% somewhere within the first column. To turn off the feature, give
% \nobalance. One has to look at the unbalanced text first to decide
% where best to place \balance.
%-----------------------------------------------------------
\newcommand{\@BAlancecol}{\if@twocolumn
\setbox0=\vbox{\unvbox\@outputbox} \@tempdima=\ht0
\advance\@tempdima by \topskip \advance\@tempdima
by -\baselineskip \divide\@tempdima by 2
\splittopskip=\topskip
{\vbadness=\@M \loop \global\setbox3=\copy0
\global\setbox1=\vsplit3 to \@tempdima
\ifdim\ht3>\@tempdima \global\advance\@tempdima by 1pt \repeat}
\setbox\@leftcolumn=\vbox to \@tempdima{\unvbox1\vfil}
\setbox\@outputbox=\vbox to \@tempdima
{\dimen2=\dp3\unvbox3\kern-\dimen2
\vfil}
\fi}
\newif\if@BAlanceone
\global\@BAlanceonefalse
\newdimen\oldvsize
\newcommand{\@BAdblcol}{\if@firstcolumn
\unvbox\@outputbox \penalty\outputpenalty
\global\oldvsize=\@colht \global\multiply \@colht by 2
\global\@BAlanceonetrue
\global\@firstcolumnfalse
\else \global\@firstcolumntrue
\if@BAlanceone
\global\@BAlanceonefalse\@BAlancecol
\global\@colht=\oldvsize \else
\PackageWarningNoLine{balance}
{You have called \protect\balance\space
in second column\MessageBreak
Columns might not be balanced}\fi
\setbox\@outputbox\vbox to \@colht{\hbox to\textwidth
{\hbox to\columnwidth {\box\@leftcolumn \hss}\hfil
\vrule width\columnseprule\hfil \hbox to\columnwidth
{\box\@outputbox \hss}}\vfil}\@combinedblfloats
\@outputpage \begingroup \@dblfloatplacement
\@startdblcolumn \@whilesw\if@fcolmade \fi
{\@outputpage\@startdblcolumn}\endgroup
\fi}
\newcommand{\@BAcleardblpage}{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}\newpage\fi\fi}
\newcommand{\@@cleardblpage}{}
\let\@@cleardblpage=\cleardoublepage
\newcommand{\@@utputdblcol}{}
\let\@@utputdblcol=\@outputdblcol
\newcommand{\balance}{\global\let\@outputdblcol=\@BAdblcol
\global\let\cleardoublepage=\@BAcleardblpage}
\newcommand{\nobalance}{\global\let\@outputdblcol=\@@utputdblcol
\global\let\cleardoublepage=\@@cleardblpage}
%%
%% <<<<< End of generated file <<<<<<
%%
%% End of file `balance.sty'.