diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/sttools/flushend.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/sttools/flushend.sty | 207 |
1 files changed, 112 insertions, 95 deletions
diff --git a/Master/texmf-dist/tex/latex/sttools/flushend.sty b/Master/texmf-dist/tex/latex/sttools/flushend.sty index 83e3186a6c6..486986bd6e2 100644 --- a/Master/texmf-dist/tex/latex/sttools/flushend.sty +++ b/Master/texmf-dist/tex/latex/sttools/flushend.sty @@ -1,49 +1,30 @@ -%% flushend.sty -%% Copyright 1997 Sigitas Tolu\v sis +%% +%% This is file `flushend.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% flushend.dtx (with options: `package') +%% +%% Copyright (C) 1997-2012 by Sigitas Tolu\v{s}is <sigitas@vtex.lt> %% VTeX Ltd., Akademijos 4, Vilnius, Lithuania -%% e-mail sigitas@vtex.lt %% http://www.vtex.lt/tex/download/macros/ +%% -------------------------------------------------------------------------- +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% 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.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. %% -% This program can 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 (at your option) any later version. -% -% PURPOSE: Balanced columns on last page in twocolumn mode. -% -% SHORT DESCRIPTION: -% -% \flushend (loaded by default) -% --------- -% Switches on column balancing at last page -% -% \raggedend -% ---------- -% Switches off column balancing at last page -% -% \atColsBreak={#1} -% ------------------ -% Adds #1 in place of original column break (without balancing) -% Example: \atColsBreak{\vskip-2pt} -% -% \showcolsendrule -% ---------------- -% Adds rule to the bottom of columns (just for debugging) -% -% P.S. To stretch right column by #1 add command \vskip-#1 just before -% command \end{document}. -% TO shrink right column by #1 add command \vskip#1 just before -% command \end{document}. -% Example: \vskip-10pt -% \end{document} -% -% \changes{1997/05/16}{first version} -% \changes{1997/09/09}{support for compatibility with cuted.sty} -% \changes{1997/10/01}{\vipersep changed to \stripsep for compatibility with cuted.sty} -% +%% PURPOSE: Balanced columns on last page in twocolumn mode. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{flushend} + [2012/05/29 v1.1 Balancing columns at last page] \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{flushend}[1997/10/01] -% \newbox\@aaa \newbox\@ccc \@ifundefined{@viper}{\newbox\@viper}{} @@ -61,56 +42,78 @@ \@tempdima\ht\@leftcolumn \splittopskip\topskip\splitmaxdepth\maxdepth \setbox\@tempboxa\vbox{% - \unvbox\@leftcolumn\setbox0\lastbox\unskip% - \the\atColsBreak% - \unvbox\@outputbox\setbox0\lastbox\unskip}% - \@tempdimb .5\ht\@tempboxa% - \loop - \setbox\@aaa\copy\@tempboxa% - \setbox\@ccc\vbox to\@tempdimb{% - \vsplit\@aaa to\@tempdimb\vss\vsplit\@aaa to\@tempdimb}% - \wlog{Extra height:\the\ht\@aaa\space when \the\@tempdimb}% - \ifvoid\@aaa \else \advance\@tempdimb 1pt \repeat% - \loop - \setbox\@aaa\copy\@tempboxa% - \setbox\@ccc\vbox to\@tempdimb{% - \vsplit\@aaa to\@tempdimb\vss}% - \wlog{(2)Left:\the\ht\@ccc\space Right:\the\ht\@aaa\space Output:\the\@tempdimb}% - \ifdim \ht\@ccc<\ht\@aaa \@tempdimb \the\ht\@aaa \repeat% - \wlog{- LAST -^^JExtra skip:\the\@extra@skip^^JLeft:\the\ht\@ccc^^JRight:\the\ht\@aaa^^JOutput:\the\@tempdimb}% - \setbox\@ccc\vbox to\@tempdimb{% - \vsplit\@tempboxa to\@tempdimb\vss}% - \setbox\@leftcolumn\vbox to\@tempdima{% - \vbox to\@tempdimb{\unvbox\@ccc}% - \hrule\@height\@nd@page@rule% - \vss}% - \setbox\@outputbox\vbox to\@tempdima{% - \vbox to\@tempdimb{\unvbox\@tempboxa\vfilneg\vskip\@extra@skip}% - \hrule\@height\@nd@page@rule% - \vss}% - \setbox\@outputbox \vbox {% - \hb@xt@\textwidth {% - \hb@xt@\columnwidth {% - \box\@leftcolumn \hss}% - \hfil - \vrule \@width\columnseprule - \hfil - \hb@xt@\columnwidth {% - \box\@outputbox \hss}% - }% - }% + \unvbox\@leftcolumn\setbox0\lastbox\unskip + \the\atColsBreak + \unvbox\@outputbox\setbox0\lastbox\unskip + }% + \@tempdimb .5\ht\@tempboxa + \loop + \setbox\@aaa\copy\@tempboxa + \setbox\@ccc\vbox to\@tempdimb{% + \vsplit\@aaa to\@tempdimb + \vss + \vsplit\@aaa to\@tempdimb + }% + \wlog{Extra height:\the\ht\@aaa\space when \the\@tempdimb}% + \ifvoid\@aaa + \else + \advance\@tempdimb 1\p@ + \repeat + \loop + \setbox\@aaa\copy\@tempboxa + \setbox\@ccc\vbox to\@tempdimb{% + \vsplit\@aaa to\@tempdimb + \vss + }% + \wlog{(2)Left:\the\ht\@ccc\space + Right:\the\ht\@aaa\space + Output:\the\@tempdimb + }% + \ifdim \ht\@ccc<\ht\@aaa + \@tempdimb \the\ht\@aaa + \repeat + \wlog{- LAST -^^JExtra skip:\the\@extra@skip + ^^JLeft:\the\ht\@ccc + ^^JRight:\the\ht\@aaa + ^^JOutput:\the\@tempdimb + }% + \setbox\@ccc\vbox to\@tempdimb{% + \vsplit\@tempboxa to\@tempdimb + \vss + }% + \setbox\@leftcolumn\vbox to\@tempdima{% + \vbox to\@tempdimb{\unvbox\@ccc}% + \hrule\@height\@nd@page@rule + \vss + }% + \setbox\@outputbox\vbox to\@tempdima{% + \vbox to\@tempdimb{% + \unvbox\@tempboxa + \vfilneg + \vskip\@extra@skip + }% + \hrule\@height\@nd@page@rule + \vss + }% + \setbox\@outputbox \vbox {% + \hb@xt@\textwidth {% + \hb@xt@\columnwidth {\box\@leftcolumn \hss}% + \hfil + \vrule \@width\columnseprule + \hfil + \hb@xt@\columnwidth {\box\@outputbox \hss}% + }% + }% \else - \setbox\@outputbox \vbox {% - \hb@xt@\textwidth {% - \hb@xt@\columnwidth {% - \box\@leftcolumn \hss}% - \hfil - \vrule \@width\columnseprule - \hfil - \hb@xt@\columnwidth {% - \box\@outputbox \hss}% - }% - }% + \setbox\@outputbox \vbox {% + \hb@xt@\textwidth {% + \hb@xt@\columnwidth {\box\@leftcolumn \hss}% + \hfil + \vrule \@width\columnseprule + \hfil + \hb@xt@\columnwidth {\box\@outputbox \hss}% + }% + }% \fi \ifvoid\hold@viper \else @@ -122,20 +125,34 @@ \@dblfloatplacement \@startdblcolumn \@whilesw\if@fcolmade \fi - {\@outputpage - \@startdblcolumn}% + {\@outputpage \@startdblcolumn}% \ifvoid\@viper \else \global\setbox\@viper\vbox{% - \vskip-\stripsep\unvbox\@viper}\@viperoutput + \vskip-\stripsep + \unvbox\@viper + }% + \@viperoutput \fi \endgroup \fi } \let\prev@enddocument\enddocument \newif\if@lastpage \@lastpagefalse -\def\enddocument{\global\@lastpagetrue\let\@outputdblcol\last@outputdblcol\prev@enddocument} +\def\enddocument{% + \global\@lastpagetrue + \let\@outputdblcol\last@outputdblcol + \prev@enddocument + } \def\raggedend{\global\let\enddocument\prev@enddocument} -\def\flushend{\gdef\enddocument{\global\@lastpagetrue\let\@outputdblcol\last@outputdblcol\prev@enddocument}} +\def\flushend{% + \gdef\enddocument{% + \global\@lastpagetrue + \let\@outputdblcol\last@outputdblcol + \prev@enddocument + }% + } \def\showcolsendrule{\global\@nd@page@rule=.4pt} \endinput +%% +%% End of file `flushend.sty'. |