[Tex/LaTex] Force latex to put a figure and a table in the same page

captionsfloatsminipage

I have tried both to use floating properties and static alignment to force latex to put a figure and a table next to each other with no success. Also, when I use \noindent\begin{minipage}{\linewidth} with the \captionof package, they will be put together, however, the mini-break causes the previous page to be cut in the middle. Anyone has a suggestion for me? Actually these figure and table must take the whole page.

%\noindent\begin{minipage}{\linewidth}
%\centering
%\resizebox{13.4cm}{!}{\includegraphics{figures}}
%\captionof{figure}{figure i would like to be on top}
%\label{fig:BN_breakdown}
%%\end{figure}




%%\begin{table}[]
%\small
%\centering
%\captionof{table}{Table I would like to be bottom of the figure}
%\label{table}
%\centering
%\begin{tabular}{| l | l  | p{7cm}|c|}
%\hline 
%\textbf{}  & \textbf{Category} & \textbf{Description} & \textbf{Time\%}  \\  
%\hline    
%\\ \hline
%\end{tabular}
%\end{minipage} 

Best Answer

You could load the afterpage package and encase the figure/table material in an \afterpage{...} statement: The typesetting of the argument of the \afterpage instruction is deferred until the start of the next page.

\documentclass{article}
\usepackage[demo]{graphicx} % remove 'demo' option in real document
\usepackage{caption,afterpage,tabularx}
\usepackage{lipsum} % for filler text

\begin{document}
\lipsum[1-3] % filler text

\afterpage{% % defer placement until start of next page
\noindent
\begin{minipage}{\textwidth}
\centering

\includegraphics[width=0.9\textwidth]{figures} % choose width of graph
\captionof{figure}{Figure above table}
\label{fig:BN_breakdown}

\vspace{2cm} % choose the vertical separation between figure and table

\small
\captionof{table}{Table below figure}
\label{table}
\begin{tabularx}{0.9\textwidth}{| l | l | X | c |} % choose width of `tabularx`
\hline 
\textbf{} & \textbf{Category} & \textbf{Description} & \textbf{Time \%}  \\  
\hline    
 & & & \\ \hline
\end{tabularx}
\end{minipage}
\clearpage  % if needed/desired
}% end of argument of \afterpage

\lipsum[4-9] % more filler text
\end{document}