% This is FLOATBOX.STY to be included in LaTeX via
% \documentstyle[floatbox]{...}
% It gives you appropriate TeXniques to let float text "around"
% a given box without counting lines.
%
% Two macros are written. The first one is called \floatrightbox
% and produces the following hack:
%
% Bla-bla-bla-bla-bla-bla-bla-bla-bla-bla  B
% Bla-bla-bla-bla-bla-bla-bla-bla-bla-bla  O
% Bla-bla-bla-bla-bla-bla-bla-bla-bla-bla  X
% Bla-bla-bla-bla-bla-bla-bla-bla-bla-bla-bla
% Bla-bla-bla-bla-bla-bla-bla-bla-bla-bla-bla
%
% Call it by
% \floatrightbox{\shortstack{B\\O\\X}} Bla-bla....
%
% \floatleftbox places the box in the upper left corner of the
% paragraph.
\message{This is documentstyle FLOATBOX.STY by Elmar Schalueck 15.4.1991}
\makeatletter
\newdimen\@totalheight
\newdimen\@wordskip
\newcount\@numberlines
\newdimen\@hangindent
\newdimen\@tempdim
\long\def\floatrightbox#1{
\setbox0\hbox{#1}
\@totalheight=\ht0\advance\@totalheight by\dp0
\@numberlines=\@totalheight\divide\@numberlines by\baselineskip
\@tempdim=\baselineskip\multiply\@tempdim by-\@numberlines
\advance\@tempdim by\@totalheight
\ifdim\@tempdim>0.3pt \advance\@numberlines by 1\fi
\@wordskip=\fontdimen2\font
\@hangindent=\wd0\advance\@hangindent by\@wordskip
\vskip0.5\@tempdim
\hskip-\wd0
\hskip\textwidth
\box0
\par
\vskip-0.5\@tempdim
\vskip-\@totalheight
\hangindent=-\@hangindent
\hangafter=-\@numberlines
}
\def\floatleftbox#1{
\setbox0\hbox{#1}
\@totalheight=\ht0\advance\@totalheight by\dp0
\@numberlines=\@totalheight\divide\@numberlines by\baselineskip
\@tempdim=\baselineskip\multiply\@tempdim by-\@numberlines
\advance\@tempdim by\@totalheight
\ifdim\@tempdim>0.3pt \advance\@numberlines by 1\fi
\@wordskip=\fontdimen2\font
\@hangindent=\wd0\advance\@hangindent by\@wordskip
\hangindent=\@hangindent
\hangafter=-\@numberlines
\hskip-\@hangindent
\box0
\vskip-\@totalheight
\hangindent=\@hangindent
\hangafter=-\@numberlines
}
\makeatother
