I'm using the float
package and I defined a new float environment. I noticed that when there's a figure inside float with width=\textwidth
the space between the figure and the caption is doubled. However, when it's something like width=0.9\textwidth
or other number, the space is the standard for a float environment.
I simply use \vspace{-\abovecaptionskip}
when the figure has the width of the text, but I don't know why this happens and if there is some explanation.
\documentclass[draft]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[demo]{graphicx}
\usepackage{float}
\newfloat{scheme}{htbp}{schemes}
\begin{document}
\begin{scheme}[h]
\centering
\includegraphics[width=\textwidth]{}
\caption{Lorem ipsum}
\end{scheme}
\end{document}