I'm having an issue with cross reference using Lyx. I'm using threeparttable with cross reference inside a float. Although the table number is 1, the compiled file shows me "Table 2" when I cross reference it.

I read the following thread Combining threeparttable with cross references - LyX but the solution there doesn't apply to me because I'm not calling an external file.

I'm using Lyx 2.1.3, MiKTeX 2.9 and Windows 7.

Here is the TEX code:

% Preview source code

%% LyX 2.1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.




Table \ref{stats_goods} provides some summary statistics about each

\section{Empirical Analysis}



\protect\caption{\textsc{Summary Statistics }\label{stats_goods}}



\begin{tabular}{>{\centering}p{2.5cm}>{\centering}p{2.5cm}>      {\centering}p{2.5cm}>{\centering}p{2cm}>{\centering}p{2cm}>{\centering}p{1.5cm}}
x & y & z & w & 1 & 2\tabularnewline
 &  &  &  &  & \tabularnewline
 &  &  &  &  & \tabularnewline
 &  &  &  &  & \tabularnewline
 &  &  &  &  & \tabularnewline
 &  &  &  &  & \tabularnewline

\begin{tablenotes}[para,flushleft]\footnotesize{Note: My     note}\end{tablenotes} \end{threeparttable}


I appreciate any help!


The LaTeX code works for me after removing the centering environment that surrounds the caption. LyX adds that because the alignment of the paragraph containing the caption is set to Centered. Set it back to default, and it will probably work fine.

That is, right click right outside the caption box, on the same line, choose Paragraph settings, select Paragraph's default as alignment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.