I have following codes:
\begin{document}
\appendix
\input{appendix1/appendix1.tex}
\input{appendix2/appendix2.tex}
\end{document}
And appendix 2 includes following codes:
\chapter{APPENDIX B }
\label{chp:appendixB}
\section{Grouped Test Images with Their Histograms}
\subsection*{Portrait}
\begin{figure}[h!]
\begin{subfigure}[h!]{\textwidth}
%\includegraphics[width=10cm, height=4.5cm]{einstein_image&histogram.jpg}
\includegraphics[width=\linewidth]{einstein_image&histogram.jpg}
\centering
\caption{Einstein Image and Histogram}
\label{fig:3_9_1}
\caption*{Source: Courtesy of Gonzales \& Woods \cite{data_e} }
\end{subfigure}
\begin{subfigure}[h!]{\textwidth}
\includegraphics[width=\linewidth]{lena_image&histogram.jpg}
\centering
\caption{Lena Image and Histogram}
\label{fig:3_9_2}
\caption*{Source: Image Databases, Standard Test Images \cite{data_lwpcmphlwj}}
\end{subfigure}
\caption{Images and Histograms belong to Portrait Class}
\end{figure}
I am attaching the results:
Why there is a duplication on the "Appendix B"? Why there is a big gap between the captions?
Thanks,


\flushbottom(https://tex.stackexchange.com/q/10743), but I could well be wrong. Your first question is impossible to answer as it stands I think, as you haven't told us anything about the document class or other things in the preamble that might influence this. Can you make a minimal working example and add that to your question instead of the two snippets? – Torbjørn T. Apr 26 '18 at 20:32