Intenté eliminar el espacio alrededor de las figuras [H] configurándolo \intextsep
en 0pt
, pero lamentablemente esto no cambia el espacio alrededor de los subflotadores.
¿Hay alguna forma de hacer esto (aparte de agregar manualmente un 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}
Respuesta1
Parece que usar el subcaption
en lugar del subfig
paquete funciona.
\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}