桌号不一致

桌号不一致

我遇到了以下问题:我将两个相同类型的表格放在一起,但第二个表格的编号不一致:第一个表格有编号2.1(第 2 章,表格 1 的编号),第二个表格有编号2.3

我的示例如下:

\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{arabtex}
\usepackage{semtrans}
\usepackage{longtable}
\usepackage{array}
\usepackage{tipa}
\usepackage{booktabs}
\usepackage{setspace}
\begin{document}

\chapter{The analyzed roots and verbs}
\label{chap-AnalyzedRootsAndVerbs}
\chapter{Root S\Alif L `ask (for)'}
\label{chap-RootS'L}

\section{Verbal types and tokens of the root S\Alif L in the Qur'an}
\label{sec-Types and Tokens of the root S'L}


\section{The root in the Dictionaries of CA}
\label{S'L_in_CA_Dictionaries}

\section{Form I – the verb \textit{sa\Alif ala} `ask (for)'}
\label{FormI_sa'ala_ask(for)}

\subsection{Semantic roles of the verb \textit{sa\Alif ala} `ask (for)'}
\label{Semantic roles sa'ala}

Text text tesxt text text Text text tesxt text textText text tesxt text     textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text text

\begin{table}[h!]
\caption{Semantic roles and their definition for the verb \textit{sa\Alif ala} `ask (for)' }
\label{table:semantic roles of sa'ala}
\begin{longtable}{ p{1,5cm} | p{11cm} }
\hline
\textbf{Abbr.} & \textbf{Meaning and Definition} \\
\hline
[A] & agent, i.e. speaker: someone A, who says something [UTT] \\

 [AD] & addressee: someone B to whom A says something [UTT] \\

 [REQ] & request: the thing/action etc. someone A [A] wants someone B [AD] to do or that A wants to have from B \\

 [T] & theme: something (person, thing, event), that someone A [A] asks someone B [AD] something about \\

 [UTT] & utterance: something (word(s), sentence(s)) that someone A [A] says to someone B [AD] \\
\hline
\end{longtable}
\end{table}

\begin{table}[h!]
  \caption{Abbreviations in the coding frames for the verb \textit{sa\Alif ala} `ask (for)' }
    \label{table:abbreviations in the coding frames of sa'ala}
 \begin{longtable}{ p{1,5cm} | p{11cm} }
\hline
\textbf{Abbr.} & \textbf{Meaning and Definition} \\
\hline
 [A] & agent, i.e. speaker: someone A, who says something [UTT] \\

 [AD] & addressee: someone B to whom A says something [UTT] \\

 [REQ] & request: the thing/action etc. someone A [A] wants someone B [AD] to do or that A wants to have from B \\

 [T] & theme: something (person, thing, event), that someone A [A] asks someone B [AD] something about \\

 [UTT] & utterance: something (word(s), sentence(s)) that someone A [A] says to someone B [AD] \\
\hline
     \end{longtable}
\end{table}
\end{document}

(当然表格不会完全相同)

知道为什么会出现这个编号错误吗?

谢谢你!

答案1

将可怕的table环境放在外面longtable(表格是要跨页面的,而不是飘走的),\caption{...}\label{...}\endfirsthead如果你的标题应该放在顶部,例如

\begin{longtable}{ p{1,5cm} | p{11cm} }
  \caption{Semantic roles and their definition for the verb \textit{sa\Alif ala} `ask (for)' }
  \label{table:semantic roles of sa'ala}
\endfirsthead
\hline
... more table content here
\end{longtable}

为什么桌号不对?原因是longtable无论有没有标题,都会自动增加桌号。(在\refstepcounter{table}后面有明确说明\def\LT@arraylongtable.sty

使用\begin{table}\caption{...}\begin{longtable}...将使表计数器增加两次,第一次增加\caption,第二次longtable再增加。

一遍又一遍地应用这种错误的包装,表计数器将偏离真实值。

以下是完整代码

\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{arabtex}
\usepackage{semtrans}
\usepackage{longtable}
\usepackage{array}
\usepackage{tipa}
\usepackage{booktabs}
\usepackage{setspace}
\begin{document}

\chapter{The analyzed roots and verbs}
\label{chap-AnalyzedRootsAndVerbs}
\chapter{Root S\Alif L `ask (for)'}
\label{chap-RootS'L}

\section{Verbal types and tokens of the root S\Alif L in the Qur'an}
\label{sec-Types and Tokens of the root S'L}


\section{The root in the Dictionaries of CA}
\label{S'L_in_CA_Dictionaries}

\section{Form I – the verb \textit{sa\Alif ala} `ask (for)'}
\label{FormI_sa'ala_ask(for)}

\subsection{Semantic roles of the verb \textit{sa\Alif ala} `ask (for)'}
\label{Semantic roles sa'ala}

Text text tesxt text text Text text tesxt text textText text tesxt text     textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text textText text tesxt text text

\begin{longtable}{ p{1,5cm} | p{11cm} }
  \caption{Semantic roles and their definition for the verb \textit{sa\Alif ala} `ask (for)' }
  \label{table:semanticrolesofsaala}
\endfirsthead
\hline
\textbf{Abbr.} & \textbf{Meaning and Definition} \\
\hline
[A] & agent, i.e. speaker: someone A, who says something [UTT] \\

 [AD] & addressee: someone B to whom A says something [UTT] \\

 [REQ] & request: the thing/action etc. someone A [A] wants someone B [AD] to do or that A wants to have from B \\

 [T] & theme: something (person, thing, event), that someone A [A] asks someone B [AD] something about \\

 [UTT] & utterance: something (word(s), sentence(s)) that someone A [A] says to someone B [AD] \\
\hline
\end{longtable}

\begin{longtable}{ p{1,5cm} | p{11cm} }
 \caption{Abbreviations in the coding frames for the verb \textit{sa\Alif ala} `ask (for)' }
 \label{table:abbreviationsinthecodingframesofsaala}
\endfirsthead

\hline
\textbf{Abbr.} & \textbf{Meaning and Definition} \\
\hline
 [A] & agent, i.e. speaker: someone A, who says something [UTT] \\

 [AD] & addressee: someone B to whom A says something [UTT] \\

 [REQ] & request: the thing/action etc. someone A [A] wants someone B [AD] to do or that A wants to have from B \\

 [T] & theme: something (person, thing, event), that someone A [A] asks someone B [AD] something about \\

 [UTT] & utterance: something (word(s), sentence(s)) that someone A [A] says to someone B [AD] \\
\hline
     \end{longtable}
\end{document}

关于标签的评论:最好使用不带任何空格且仅包含拉丁字母和数字的标签。

相关内容