[Tex/LaTex] Blank pages getting inserted between figures

appendicesblank-pageerrors

I have been trying with no success to find out what is causing this problem, im using

\documentclass{report} 
\usepackage{appendix}
\renewcommand{\appendixname}{APÉNDICE} 
\renewcommand{\appendixtocname}{APÉNDICE} \renewcommand{\appendixpagename}{APÉNDICE} 
\addappheadtotoc 
\appendixpage 
\appendix  
\input{Tesis/Estructura/07_Apendice}

I already finished writing the entire document and now Im just placing some appendix content (a bunch of pictures) however it keeps placing a blank page between every floating figure I place and it does this at random, sometimes it adds it and sometimes it doesnt, this makes it difficult to understand why its happening, but when it happens the blank page does not go away, even after clearing the cache. This does not happen in the entire document only in the appendice.

\section{ Section 1 }
\begin{figure}[H]
    \begin{center}
        \includegraphics[width = 1\textwidth]{Tesis/Image/1.jpg}
        \captionof{figure}{ Picture 1 } 
    \label{p1}
    \end{center} 
\end{figure}

\section{ section 2 }

\begin{figure}[H]
    \begin{center}
        \includegraphics[width = 1\textwidth]{Images/2.JPG}
        \captionof{figure}{ Picture 2} 
    \label{p2}
    \end{center} 
\end{figure}

\section{ section 3 }

\begin{figure}[H]
    \begin{center}
        \includegraphics[width = .9\textwidth]{Images/2.jpg}
        \captionof{figure}{ figure 2.} 
    \label{Sensor}
    \end{center} 
\end{figure}

This can generate something like this (sorry for the size it's the only way i found to try to show how the document compiles), as i said this only happens when i chain several pictures and sections, it's only happening in the appendix

enter image description here

I already tried using \newpage, \clearpage, \let\cleardoublepage\clearpageand changing document class to, \documentclass[11pt,oneside]{report} changing the size of the pictures with no changes

There are no \newpage commands in the appendix or around any commands related to it

Best Answer

Without having access to your graphics files (e.g., 1.jpg, 2.jpg, etc), it's not possible to offer a definitive diagnosis. Going mainly by the screenshots you've posted, I'd say that there's a high likelihood that the pictures are too big to fit on a page that also contains a sectioning header.

One way to overcome this difficulty is to force LaTeX to size the images so that their overall dimensions are the lesser of \textwidth and 0.88\textheight. ("Why not 1\textheight?", you may ask. Recall that each page is also supposed to contain a sectioning header and a caption, so some space needs to be reserved for those elements.) This may be achieved by adding the option keepaspectratio for each \includegraphics instruction, as is done in the code below.

To conserve space, do get rid of all \begin{center} and \end{center} statements and issue \centering directives instead.

\documentclass{report} 

\usepackage{appendix,float}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage[demo]{graphicx} % remove 'demo' option in real document

\renewcommand{\appendixname}{APÉNDICE} 
\renewcommand{\appendixtocname}{APÉNDICE} \renewcommand{\appendixpagename}{APÉNDICE} 
\addappheadtotoc 

\begin{document}
\tableofcontents

\appendixpage 

\appendix  

\section{ section 1 }
\begin{figure}[H]
\centering
    \includegraphics[width=\textwidth, 
                     height = 0.88\textheight, 
                     keepaspectratio]
                    {Tesis/Image/1.jpg}
    \caption{Picture 1} 
    \label{p1}
\end{figure}


\section{ section 2 }
\begin{figure}[H]
\centering
    \includegraphics[width=\textwidth, 
                     height = 0.88\textheight, 
                     keepaspectratio]
                    {Images/2.jpg}
    \caption{Picture 2} 
    \label{p2}    
\end{figure}


\section{ section 3 }
\begin{figure}[H]
\centering
    \includegraphics[width=\textwidth, 
                     height = 0.88\textheight, 
                     keepaspectratio]
                    {Images/3.jpg}
    \caption{ Pigure 3} 
    \label{Sensor}
\end{figure}

\end{document}