I would like to make reference of a table that I have introduced before. However, after I try to typeset the first time, I have double question marks like this table ??
.
I know that I need to typeset twice to get a correct reference. But the thing is that sometimes I get double question marks for the first typesetting but often times I get a blank, like this: table
in the first typesetting.
No matter what I get in the first time, I will always get a blank after the second typesetting. My pdf looks like this: table and figure 1 show that...
What also confuses me is that I reference a figure right after my reference to the table but everything works fine as it is shown above. I have searched similar questions but I do not have similar preamble as the other guy did. Also I put my label before the caption for my table, which should not be a trouble here. So could any body helps me with this issue?
My code:
\begin{figure}[H]
\centering
\includegraphics[height=4in]{/Users/Desktop/Differentpandn.png}
\caption[]{Distributions of different sample sizes and proportions}
\label{fig:different n and p}
\end{figure}
\begin{table}[H]
\centering
\begin{tabular}{c c c c c}
\multicolumn{5}{c}{\textbf{The Normal Distribution of Different p and n}}\\ \hline
%The table is omitted for convenience
\end{tabular}
\label{tab:Table of different proportions and sizes}
\caption{Center, Shape and Center of different distributions}
\end{table}
From the table \ref{tab:Table of different proportions and sizes}
and figure \ref{fig:different n and p}
My preamble:
\usepackage[margin = 1 in, includefoot]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage[hidelinks]{hyperref}
\usepackage[shortlabels]{enumitem}
\usepackage{amsmath}
\label
must come after\caption
.label
aftercaption
is useless: tex.stackexchange.com/questions/208456/… Do you know which one is correct?\restylefloat
, which is, AFAICT, not an issue in your example.\label
before\caption
to avoid such problem, is that right?\label
must come after\caption
.