Poner varias imágenes en una página

Poner varias imágenes en una página

Quiero varias imágenes (digamos 7) en la página en forma tabular. Estoy usando el siguiente código, pero no produce nada. ¿Podrías decirme cuál es el problema?

\begin{figure}[ht!]
     \begin{center}
%
        \subfigure[Caption of First Figure]{%
            \label{fig:first}
            \includegraphics[width=0.4\textwidth]{FirstFigure}
        }%
        \subfigure[Caption of Second Figure]{%
           \label{fig:second}
           \includegraphics[width=0.4\textwidth]{SecondFigure}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Caption of Third Figure]{%
            \label{fig:third}
            \includegraphics[width=0.4\textwidth]{ThirdFigure}
        }%
        \subfigure[Caption of Fourth Figure]{%
            \label{fig:fourth}
            \includegraphics[width=0.4\textwidth]{FourthFigure}
        }%
%
    \end{center}
    \caption{%
        The l-o-n-g caption for all the subfigures
        (FirstFigure through FourthFigure) goes here.
     }%
   \label{fig:subfigures}
\end{figure}

Respuesta1

No hay nada malo en su figura flotante como se muestra en este MWE, pero en su documento, puede ser que la altura de las figuras sea mayor, o que la figura flotante esté demasiado cerca del final de la página, o demasiado cerca de otros flotadores. En estos casos, LaTeX no puede encontrar un espacio apropiado para las opciones [ht!], por lo que el flotante se mueve a la página siguiente o incluso más, tal vez hasta el final del documento, hasta que se encuentre ese espacio.

Una solución es permitir que LaTeX decida el mejor lugar ( [htbp]), preferiblemente sin violar sus reglas ( [htbp!]) pero sugiero solo usarlo [tbp]ya que hestéticamente no siempre es el mejor lugar. Otra solución podría ser mover el flotador dos o tres párrafos arriba (o más). Si LaTeX aún no puede colocar todos los flotantes de manera elegante, considere cambiar el diseño de su manuscrito (menos flotantes, más texto entre flotantes, más texto después de flotantes...). Si es imprescindible poner la imagen "aquí", pruebe la opción Hen lugar de h!(esta opción debe estar \usepackage{float}en el preámbulo)

MWE

\documentclass{article}
\usepackage{subfigure}
\usepackage{lipsum}
\usepackage[demo]{graphicx}
\usepackage[utf8]{inputenc}

\begin{document}

\lipsum[1]

\begin{figure}[ht!]
     \begin{center}
%
        \subfigure[Caption of First Figure]{%
            \label{fig:first}
            \includegraphics[width=0.4\textwidth]{FirstFigure}
        }%
        \subfigure[Caption of Second Figure]{%
           \label{fig:second}
           \includegraphics[width=0.4\textwidth]{SecondFigure}
        }\\ %  ------- End of the first row ----------------------%
        \subfigure[Caption of Third Figure]{%
            \label{fig:third}
            \includegraphics[width=0.4\textwidth]{ThirdFigure}
        }%
        \subfigure[Caption of Fourth Figure]{%
            \label{fig:fourth}
            \includegraphics[width=0.4\textwidth]{FourthFigure}
        }%
%
    \end{center}
    \caption{%
        The l-o-n-g caption for all the subfigures
        (FirstFigure through FourthFigure) goes here.
     }%
   \label{fig:subfigures}
\end{figure}

\lipsum[2-5]

\end{document}

información relacionada