我在使用 Lyx 进行交叉引用时遇到了问题。我使用带有浮点数内交叉引用的 threeparttable。虽然表号是 1,但当我进行交叉引用时,编译后的文件显示“表 2”。
我读了以下帖子将 threeparttable 与交叉引用相结合 - LyX但是那里的解决方案并不适用于我,因为我没有调用外部文件。
我正在使用 Lyx 2.1.3、MiKTeX 2.9 和 Windows 7。
以下是 TEX 代码:
% 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.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{array}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{threeparttable}
\makeatother
\usepackage{babel}
\begin{document}
\section{Introduction}
Table \ref{stats_goods} provides some summary statistics about each
good.
\section{Empirical Analysis}
\clearpage
\begin{table}[p]
\begin{threeparttable}
\begin{centering}
\protect\caption{\textsc{Summary Statistics }\label{stats_goods}}
\par\end{centering}
\smallskip{}
\begin{centering}
\begin{tabular}{>{\centering}p{2.5cm}>{\centering}p{2.5cm}> {\centering}p{2.5cm}>{\centering}p{2cm}>{\centering}p{2cm}>{\centering}p{1.5cm}}
\hline
x & y & z & w & 1 & 2\tabularnewline
\hline
\hline
& & & & & \tabularnewline
& & & & & \tabularnewline
& & & & & \tabularnewline
& & & & & \tabularnewline
& & & & & \tabularnewline
\hline
\end{tabular}
\par\end{centering}
\begin{tablenotes}[para,flushleft]\footnotesize{Note: My note}\end{tablenotes} \end{threeparttable}
\end{table}
\end{document}
我很感激任何帮助!
答案1
删除标题周围的环境后,LaTeX 代码对我来说可以正常工作centering
。LyX 添加该环境是因为包含标题的段落的对齐方式设置为居中。将其恢复为默认值,它可能会正常工作。
即,在标题框外单击鼠标右键,在同一行上,选择“段落设置”,选择段落的默认作为对齐。