I have a strange bug where Latex does not continuously count figures. This bug appears only if the caption is above the figure and if the figure includes subfigures. The number of subfigures does not matter, as long as it includes at least one, it is counted as two figures. Please find below a reproducible example in which I show all of these cases.
\documentclass[a4paper,11pt,parskip,oneside,leqno]{scrartcl}
\usepackage[a4paper,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\caption{this is number 1}
\centering
\begin{subfigure}{0.8\textwidth}
\caption{here I have two subfigures with captions}
\end{subfigure}
\begin{subfigure}{0.8\textwidth}
\caption{second subfigure. I leave out the images for simplicity. This figure is now counted as two and Latex continues with figure 3:}
\end{subfigure}
\end{figure}
\begin{figure}
\caption{this should be figure 2. Here I have no subfigures and this figure is therefore only counted as one}
\centering
\end{figure}
\begin{figure}
\caption{as you can see here. This should be number 3 but we only stepped up one number from the last one so thats ok}
\centering
\begin{subfigure}{0.8\textwidth}
\caption{this one works because the figure above does not use subfigures}
\end{subfigure}
\begin{subfigure}{0.8\textwidth}
\caption{but after this one, it would continue with number 6 because I'm using subfigures again}
\end{subfigure}
\begin{subfigure}{0.8\textwidth}
\caption{the number of subfigures does not seem to matter}
\end{subfigure}
\end{figure}
\begin{figure}
\centering
\begin{subfigure}{0.8\textwidth}
\caption{as you can see here}
\end{subfigure}
\begin{subfigure}{0.8\textwidth}
\caption{again a figure with two subfigures to show that:}
\end{subfigure}
\caption{If I put the caption BELOW the figure, the problem does not appear}
\end{figure}
\begin{figure}
\caption{as you can see here}
\centering
\end{figure}
\end{document}
I'd like to have figures with subfigures but I'd like to have the captions on top of the figures and I'd like Latex to count from 1 to N without leaving out numbers ;-) Any help would be appreciated!

articleinstead ofscrartcl. – Andrew Swann Apr 20 '18 at 14:47\usepackage[figureposition=b]{caption}(which emulates the default setting in KOMA-Script). – May 15 '18 at 06:35