I have the following code:
\documentclass{scrbook}
\usepackage[linesnumbered,ruled]{algorithm2e}
\begin{document}
AAAA
BBBB
\begin{algorithm}
\vspace*{-1cm}
\caption{My Caption\ldots}
My Code
\end{algorithm}
\end{document}
which does not move the "My Code" part with the caption "My Caption" upwards - but it works for figure environement - any suggestions how this can be done for the algorithms?
NOTE: I know a way of specifying the \vpsace* above the \begin{algorithm} but that won't work if you have a text arround it - it will mess up the text, and not move the algorithm.