I am trying to add some spacing above/below captions of algorithms using the algorithm2e package. Consider the following example:
\documentclass[a4paper]{article}
\usepackage{blindtext}
\usepackage[linesnumbered,boxed]{algorithm2e}
\SetKwInput{KwInput}{Input}
\SetKwInput{KwOutput}{Output}
\begin{document}
\begin{algorithm}[H]
\SetAlgoLined
\KwInput{Parameters...}
\KwOutput{$\emptyset$}
\If{Condition}
{
Do something \;
}
\caption{Algoritm test...}
\end{algorithm}
\blindtext{}
\begin{figure}[!h]
\caption{Figure test...}
\end{figure}
\blindtext{}
\end{document}
You can see that the caption is squeezed in below the box containing the algorithm. There is no space separating the box from the caption and not enough space separating the caption from the following text. I would like to add the same amount of space above and below the caption, but I have not yet figured out how to do that: There seems to be a working solution for the algorithms package (see Algorithms package ignores caption package) , but I can't figure out how to make a \captionsetup
apply to an algorithm2e caption. Any ideas about this?