I am trying to force a figure and an image to show up on the same page back to back. I read the solution of using the \afterpage which works great. Except now the \label is undefined and I cannot refer to them!
What I have so far:
\afterpage{
\begin{figure}
\centering
\includegraphics[scale=0.28]{PATH_TO_IMAGE}
\caption{Some Caption For My Image}
\label{myFigure}
\end{figure}
\begin{table}
\centering
\caption{Some Caption For My Table}
\label{myTable}
\includegraphics[scale=0.09]{PATH_TO_TABLE}
\end{table}
}
Then I refer to these normally, using \ref{myFigure} or \ref{myTable}. But the compiler says undefined references, and the PDF shows ??. If I remove the /afterpage, then the reference works just fine.
Why?
EDIT
This is for my dissertation paper at my university. The following template is provided by the university to be used.
The path to the main .tex file is here
\autoref). Please post a MWE! – Sep 11 '14 at 01:57\captionof(fromcapt-oforcaption) to provide the correct\captionfor the alternative float. – Werner Sep 11 '14 at 03:45\afterpagecause I need to force the figure and table to be on the same page. – Kousha Sep 11 '14 at 19:08afterpageis a highly invasive package that does lots of stuff and more or less none of that is at all relevant to keeping floats on the same page. In what way are you using it? I wrote the thing and I can't guess:-) – David Carlisle Sep 11 '14 at 19:17