\ProvidesPackage{roundflt}[2004/12/19 v0.1 Rounded double floats] % % Function to round a distance to n * baselineskip + topskip. Distance to round % is #1, which should be a dimension register. % \def\@roundlen#1{% \advance#1-\topskip \divide#1\normalbaselineskip \multiply#1\baselineskip \advance#1\topskip } \newdimen\@dblstretch \@dblstretch=0.6\normalbaselineskip \newdimen\rndfl@tempdim \def\round@dblfloatht#1{% \rndfl@tempdim\@colht \advance\rndfl@tempdim#1% \@roundlen\rndfl@tempdim % Now \rndfl@tempdim is the rounded colht. Determine the difference from % what \@colht will become without rounding. \advance\rndfl@tempdim-\@colht \advance\rndfl@tempdim-#1% \multiply\rndfl@tempdim\m@ne % Now \rndfl@tempdim is a negative value indicating the amount that we must % shrink the top area. If this amount is less than the maximum shrink % allowed, then add a baseline skip. \ifdim\rndfl@tempdim>\@dblstretch \advance\rndfl@tempdim-\normalbaselineskip \fi % Now modify #1 to reflect this change in distance. Keep in mind that #1 is % negative, so a positive rndfl@tempdim should increase the magnitude of #1 % by making it more negative. \advance#1-\rndfl@tempdim } \def\@addtodblcol{% \begingroup \@insertfalse \@setfloattypecounts \@getfpsbit \tw@ \ifodd\@tempcnta \@flsetnum \@dbltopnum \ifnum \@dbltopnum>\z@ \@tempswafalse \ifdim \@dbltoproom>\ht\@currbox \@tempswatrue \else \ifnum \@fpstype<\sixt@@n \advance \@dbltoproom \@textmin \ifdim \@dbltoproom>\ht\@currbox \@tempswatrue \fi \advance \@dbltoproom -\@textmin \fi \fi \if@tempswa \@bitor \@currtype \@dbldeferlist \if@test \else \@tempdima -\ht\@currbox \advance\@tempdima -\ifx \@dbltoplist\@empty \dbltextfloatsep \else \dblfloatsep \fi \round@dblfloatht\@tempdima \global \advance \@dbltoproom \@tempdima \global \advance \@colht \@tempdima \global \advance \@dbltopnum \m@ne \@cons \@dbltoplist \@currbox \@inserttrue \fi \fi \fi \fi \if@insert \else \@cons\@dbldeferlist\@currbox \fi \endgroup } \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\dbltextfloatsep{20\p@ \@plus 0.6\normalbaselineskip \@minus 0.4\normalbaselineskip} \endinput