I have an algorithm with caption on top. I want to control the vertical spacing of the caption: distance from text above and distance from algorithm below. As I understand I should use belowskip and aboveskip but they do nothing (I have put some crazy spacing just to exemplify), I guess because when I redefine the float style I am implicitly given it a fixed position? Thanks for help.
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % set input encoding
\usepackage[english]{babel}
\usepackage{varwidth}
%% Algorithms
\usepackage{algorithm,algorithmic}
\usepackage{caption}
\usepackage{setspace}
% Change float style of algorithm from "ruled" to "plaintop"
\floatstyle{plaintop}
\restylefloat{algorithm}
% Change caption format
\captionsetup[algorithm]{
belowskip=100pt,
aboveskip=50pt,
font=scriptsize,
justification = raggedright,
singlelinecheck = false,
name = Algorithm
}
% Change width of horizontal lines
\makeatletter
\newcommand{\algrule}[1][1pt]{\par\vskip.5\baselineskip\hrule height
#1\par\vskip.5\baselineskip}
\makeatother
%% Notes to figures, tables, algorithms
\newcommand{\notes}[1]{{ \vspace{3pt} \begin{spacing}{1} \scriptsize #1 \end{spacing}}}
\begin{document}
Some text here.
\begin{algorithm}
\caption{Algorithm caption}
\label{alg:algorithm-label}
\begin{algorithmic}[1]
\algrule
\IF{some condition is true}
\STATE do some processing
\ELSIF{some other condition is true}
\STATE do some different processing
\ELSE
\STATE do the default actions
\ENDIF
\algrule
\end{algorithmic}
\notes{Some notes here.}
\end{algorithm}
Some more text here.
\end{document}