Tentei remover o espaçamento em torno dos números [H] definindo \intextsep
como 0pt
, mas infelizmente isso não altera o espaçamento em torno dos subflutuantes.
Existe uma maneira de fazer isso (além de adicionar manualmente um negativo \vspace
)?
\documentclass{article}
\usepackage{showframe}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\usepackage{float}
% remove spacing around H figures
\setlength{\intextsep}{0pt}
\begin{document}
Sample text.
% REMOVE THIS SPACING!
\begin{figure}[H]
\subfloat[Sample caption.]{\fbox{\includegraphics[width=.475\linewidth]{1.png}}}%
\hfill
\subfloat[Sample caption.]{\fbox{\includegraphics[width=.475\linewidth]{2.png}}}%
\end{figure}
Sample text.
\begin{figure}[H]
\minipage{0.475\textwidth}
\includegraphics[width=\linewidth]{3.png}
\endminipage\hfill
\minipage{0.475\textwidth}
\includegraphics[width=\linewidth]{4.png}
\endminipage
\end{figure}
Sample text.
\end{document}
Responder1
Parece que usar o subcaption
em vez do subfig
pacote resolve.
\documentclass{article}
\usepackage{showframe}
\usepackage{subcaption}
\usepackage[demo]{graphicx}
\usepackage{float}
% remove spacing around H figures
\setlength{\intextsep}{0pt}
\begin{document}
Sample text.
\begin{figure}[H]
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{3.png}
\caption{Sample caption.}
\end{subfigure}\hfill
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{4.png}
\caption{Sample caption.}
\end{subfigure}
\end{figure}
Sample text.
\begin{figure}[H]
\minipage{0.475\textwidth}
\includegraphics[width=\linewidth]{3.png}
\endminipage\hfill
\minipage{0.475\textwidth}
\includegraphics[width=\linewidth]{4.png}
\endminipage
\end{figure}
Sample text.
\end{document}