any one knows how to avoid warning of ``Underfull \hbox (badness 10000)
detected at line''? It happens right at the \end{algorithm}. I did not
notice anything wrong with the output. As the badness is 10000, I guess it
might be just some none crucial technique bug of algorithm2e? It is
frustrating to see a lots of such warnings every time compile the file
though.
Thanks =D
There are two reasons I've seen this come up, and both are easy to fix,
but if they're hidden inside macros it might be hard to figure out
which it is and where to fix it.
(Note that I've only used plain TeX; the Right Solution if you're using
a macro package might involve changing the way you're using the macros
rather than adding plain TeX calls.)
If spacing is defined with exact sizes, the layout algorithm will try
(and usually fail) to fit things into the size of the page with exactly
those spacings. The solution to that is to add an allowable adjustment
(I think the technical term for this is "springs", but it's been a
while) to the spacings where appropriate, by adding "plus <size> minus
<size>" after the specification for the spacing amount. (1pt in both
directions is probably a good size to start with.) Once you have
springs in your spacing, the layout algorithm will stretch or compress
them (weighted by the size specified - a 2pt spring will stretch twice
as much as a 1pt one) to fit the size of the box to the size it needs
to fill, and only complain about overfull/underfullness if it needs to
stretch the springs more than the amount specified.
If the internal spacing is set up properly, but you have something that
*shouldn't* fill the width of the box it's in, then the solution is to
tell the layout algorithm that. The way to do that is to add a
'\hfill', which acts as an infinitely stretchy spring, after the part
that needs padding.
dave
--
Dave Vandervies dj3vande at eskimo dot com
The guys in comp.std.c would make excellent politicians, if only they
weren't so honest.
--Richard Heathfield in comp.lang.c
in the algorithm2e.sty
%%%%%%%%%%%%%%%%%%%
%
%% at the beginning of algocf or figure environment
\newcommand{\@algocf@start}{%
\@algoskip%
\begin{lrbox}{\algocf@algobox}%
\setlength{\algowidth}{\hsize}%
\vbox\bgroup% save all the algo in a box
\hbox to\algowidth\bgroup\hbox to \algomargin{\hfill}\vtop\bgroup%
\ifthenelse{\boolean{algocf@slide}}{\parskip 0.5ex\color{black}}{}%
% initialization
\addtolength{\hsize}{-1.5\algomargin}%
\let\@mathsemicolon=\;\def\;{\ifmmode\@mathsemicolon\else\@endalgoln\fi}%
\raggedright\AlFnt{}%
\ifthenelse{\boolean{algocf@slide}}{\incmargin{\skipalgocfslide}}{}%
\@algoinsideskip%
%
}
%
change the line \addtolength{\hsize}{-1.5\algomargin}% to
\addtolength{\hsize}{-\algomargin}%
then all warnings dissapear =D hope the authors of algorithm2e will correct
this in the next release...
"SmallX" <sma...@ymail.com> д����Ϣ����:gqb7kv$d7o$1...@rumours.uwaterloo.ca...