I have this strange problem with the labels inside the floating that contains a table. For my first table I put the label inside the floating area, then I added the cross reference somewhere in the text. The problem is that when I created the pdf this cross reference showed number 2, when the table is the number 1. But something even more strange happen later, It didn't matter if I had created different labels for different tables, all the cross references in the pdf showed number 2 and not the correct value according with table referenced
% Vista preliminar del código fuente
%% LyX 2.0.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage{array}
\usepackage{multirow}
\usepackage{setspace}
\onehalfspacing
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
\makeatother
\usepackage{babel}
\begin{document}
\setcounter{section}{1}
\section{\noindent evolution}
\begin{onehalfspace}
\noindent {\large This is summarized in the Table \ref{Laws}.}{\large \par}
\noindent {\large }
\begin{table}[h]
{\large }%
\begin{tabular}{|>{\centering}p{0.04\textwidth}|>{\centering}p{0.05\textwidth}|}
\hline
\multirow{1}{0.04\textwidth}{\textbf{No. }} & \textbf{Year}\tabularnewline
\hline
I & 1974\tabularnewline
\hline
II & 1974\tabularnewline
\hline
\end{tabular}{\large }{\large \par}
{\large \caption{Law of evolution}
}{\large \par}
\label{Laws}
\end{table}
{\large \par}
\end{onehalfspace}
\begin{onehalfspace}
\subsection{\noindent The study }
\end{onehalfspace}
\begin{onehalfspace}
\noindent {\large Table \ref{paul} summarized the hypothesis.}{\large \par}
\noindent {\large }
\begin{table}[h]
{\large }%
\begin{tabular}{|c|>{\raggedright}m{0.35\textwidth}|}
\hline
\textbf{Number} & \textbf{Hypothesis}\tabularnewline
\hline
1 & Open \tabularnewline
\hline
\end{tabular}{\large \par}
{\large \caption{Hypothesis}
}{\large \par}
\label{paul}
\end{table}
{\large \par}
\end{onehalfspace}
{\large See Table \ref{summary}.}{\large \par}
{\large }
\begin{table}[h]
{\large }%
\begin{tabular}{|c|c|}
\hline
\textbf{\small Law} & \textbf{\small Name}\tabularnewline
\hline
I & Continuing change\tabularnewline
\hline
\end{tabular}{\large \par}
{\large \caption{Summary}
}{\large \par}
\label{summary}
\end{table}
{\large \par}
\subsection{Status.}
{\large Look table \ref{H}.}{\large \par}
{\large }
\begin{table}[h]
{\large }%
\begin{tabular}{|>{\raggedright}p{0.13\textwidth}|>{\raggedright}p{0.15\textwidth}|}
\hline
\textbf{Validated laws} & \textbf{Invalidated laws}\tabularnewline
\hline
I, VI & II, III, IV, V\tabularnewline
\hline
I, VI & II, III, IV, V\tabularnewline
\hline
\end{tabular}{\large \par}
{\large \caption{Studies}
}{\large \par}
{\large \label{H}}
\end{table}
\end{document}
With this I got these results: For table 1 the cross references indicated number 2 For table 2 the cross references indicated number 2 For table 3 the cross references indicated number 2 For table 4 the cross references indicated number 2.2
Where did I make a mistake?
Thanks