抱歉代码量太大,但我无法追踪这个问题。
我的文档中有几个常规表格和一个长表。出于某种原因,表格列表在长表之前留了一个空格,并将其标记为“1”,而从逻辑上讲,它应该是“4”。
感谢您查看这个。
% PREAMBLE
\documentclass[a4paper,oneside,centered,noparindent,noparskip]{bookest}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{nicefrac}
\usepackage{palatino} % Font for document
\usepackage{hyperref} % Hyperlinks
\usepackage{titletoc} % Customization of TOC LOF LOT
\usepackage{tocloft} % Customization of TOC LOF LOT
\usepackage[table,xcdraw]{xcolor} % For shading in tables
\usepackage{color}
\usepackage{pdfcolmk}
\usepackage{multirow}
\usepackage{ltxtable} % Instead of Longtable package %\caption package is offered with \Longtable
\usepackage{textcomp}
\usepackage{array} % For long tables, to define width of columns
\usepackage{booktabs} % Nicer spacing in columns
\usepackage{siunitx} % To write Celsius, etc.
\usepackage{enumitem} % To create item lists
\usepackage{threeparttable} % For table notes + To allow footnote material to stay with the tabular environment
\usepackage{caption} % To change way captions are labelled
\usepackage{etoolbox} % To make table footnote font smaller
\appto\TPTnoteSettings{\footnotesize}
% To format the paragraphs
\setlength{\parindent}{4em} % For indentations
\setlength{\parskip}{1em} % For space between paragrpahs
% Defining how Celsius and Fahrenheit appear
\def\degC{$^\circ\kern-0.06em\rm{C}$}
\def\degF{$^\circ\kern-0.06em\rm{F}$}
% change the style of the caption numbering.
\renewcommand{\thetable}{\arabic{table}}
% Change footnotes from numbers to symbols
\makeatletter
\def\@xfootnote[#1]{%
\protected@xdef\@thefnmark{#1}%
\@footnotemark\@footnotetext}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% FRONTMATTER STARTS
\tableofcontents
\clearpage
\listoftables
\clearpage
\thispagestyle{plain} % To not have "List of Tables appear" at the top of the "Preface" page
\section*{Preface}
\blindtext
\clearpage
\thispagestyle{plain} % To not have "List of Tables appear" at the top of the "Preface" page
\section*{Introduction}
\blindtext
\clearpage
% MAINMATTER STARTS
\chapter{Chapter}
\section{Section}
\begin{table}[]
\centering
\caption{Birds}\label{Birds}
\begin{threeparttable}
\begin{tabular}{rcl} \toprule
Color & Color & Color \\ \midrule
Color & Color & Color\tnote{*} \\
Color & Color & Color \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[*]Text.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}[]
\centering
\caption{Planets}\label{Planets}
\begin{threeparttable}
\begin{tabular}{rcl} \toprule
Color & Color & Color \\ \midrule
Color & Color & Color\tnote{*} \\
Color & Color & Color \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[*]Text.
\end{tablenotes}
\end{threeparttable}
\end{table}
\section{Chapter}
\begin{table}[]
\centering
\caption{Flower.}
\begin{threeparttable}
\begin{tabular}{lllll}\toprule
Boots & Boots & Boots & Boots & Boots \\ \midrule
Boots\tnote{*} & Boots & Boots & Boots & Boots \\
Boots & Boots & Boots & \hspace{15pt}-- & Boots \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[*]text..
\end{tablenotes}
\end{threeparttable}
\end{table}
\chapter{Chapter}
\section{Section}
\begin{longtable}{r>{\raggedright\arraybackslash}p{4.5cm}p{2.6cm}>{\raggedright\arraybackslash}p{6.9cm}}
\caption{Kings \& Queens} \label{Kings Queens} \\
\toprule
No. & Name \& Title & Dates & Events \\
\midrule
\endfirsthead
\caption*{\autoref{Kings Queens}: \textit{Continued.}} \\
\toprule
No. & Name \& Title & Dates & Events \\
\midrule
\endhead
1& King Soandso III & 2234 -- to date & This is some text \\
2& King Smith ``The Fatty Pig Eater'' & 2234 -- 3456 & yryuryrtyryereyeryeryer\\
3& King Soandso III & 234 -- 134 (?)& This is some text \\
4&&& This is some text \\ \bottomrule
\end{longtable}
\end{document}
答案1
longtable
编号问题源于表格通常按章节编号的事实(与第四张表格是而不是无关)table
。
如果你想要连续编号,你可以使用
\usepackage{chngcntr}
\counterwithout{table}{chapter}
关于表格列表中的间距,您可以使用 Gonzalo Medina 的答案表格列表中章节之间的间距这里似乎运行良好。
答案2
该计数器位于longtable 计数器table
的重置列表中。chapter and there is no individual
如果不需要重置,例如\RemoveFromReset
从xassoccnt
包中使用。
不同章节的表格条目之间的空格\@chapter
实际上是由命令添加的。
它用
\addtocontents{lot}{\protect\addvspace{10\p@}}%
如果不想这样,可以使用类似
\begingroup
\renewcommand{\addvspace}[1]{}
\listoftables
\endgroup
\documentclass[a4paper,oneside,centered,noparindent,noparskip]{bookest}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{nicefrac}
\usepackage{palatino} % Font for document
\usepackage{hyperref} % Hyperlinks
\usepackage{titletoc} % Customization of TOC LOF LOT
\usepackage{tocloft} % Customization of TOC LOF LOT
\usepackage[table,xcdraw]{xcolor} % For shading in tables
\usepackage{color}
\usepackage{pdfcolmk}
\usepackage{multirow}
\usepackage{ltxtable} % Instead of Longtable package %\caption package is offered with \Longtable
\usepackage{textcomp}
\usepackage{array} % For long tables, to define width of columns
\usepackage{booktabs} % Nicer spacing in columns
\usepackage{siunitx} % To write Celsius, etc.
\usepackage{enumitem} % To create item lists
\usepackage{threeparttable} % For table notes + To allow footnote material to stay with the tabular environment
\usepackage{caption} % To change way captions are labelled
\usepackage{xassoccnt}
\usepackage{tocloft}
\usepackage{etoolbox} % To make table footnote font smaller
\appto\TPTnoteSettings{\footnotesize}
% To format the paragraphs
\setlength{\parindent}{4em} % For indentations
\setlength{\parskip}{1em} % For space between paragrpahs
% Defining how Celsius and Fahrenheit appear
\def\degC{$^\circ\kern-0.06em\rm{C}$}
\def\degF{$^\circ\kern-0.06em\rm{F}$}
% change the style of the caption numbering.
\renewcommand{\thetable}{\arabic{table}}
\RemoveFromReset{table}{chapter}
% Change footnotes from numbers to symbols
\makeatletter
\def\@xfootnote[#1]{%
\protected@xdef\@thefnmark{#1}%
\@footnotemark\@footnotetext}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% FRONTMATTER STARTS
\tableofcontents
\clearpage
\begingroup
\renewcommand{\addvspace}[1]{}
\listoftables
\endgroup
\clearpage
\thispagestyle{plain} % To not have "List of Tables appear" at the top of the "Preface" page
\section*{Preface}
\blindtext
\clearpage
\thispagestyle{plain} % To not have "List of Tables appear" at the top of the "Preface" page
\section*{Introduction}
\blindtext
\clearpage
% MAINMATTER STARTS
\chapter{Chapter}
\section{Section}
\begin{table}[]
\centering
\caption{Birds}\label{Birds}
\begin{threeparttable}
\begin{tabular}{rcl} \toprule
Color & Color & Color \\ \midrule
Color & Color & Color\tnote{*} \\
Color & Color & Color \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[*]Text.
\end{tablenotes}
\end{threeparttable}
\end{table}
\begin{table}[h]
\centering
\caption{Planets}\label{Planets}
\begin{threeparttable}
\begin{tabular}{rcl} \toprule
Color & Color & Color \\ \midrule
Color & Color & Color\tnote{*} \\
Color & Color & Color \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[*]Text.
\end{tablenotes}
\end{threeparttable}
\end{table}
\section{Chapter}
\begin{table}[]
\centering
\caption{Flower.}
\begin{threeparttable}
\begin{tabular}{lllll}\toprule
Boots & Boots & Boots & Boots & Boots \\ \midrule
Boots\tnote{*} & Boots & Boots & Boots & Boots \\
Boots & Boots & Boots & \hspace{15pt}-- & Boots \\ \bottomrule
\end{tabular}
\begin{tablenotes}
\item[*]text..
\end{tablenotes}
\end{threeparttable}
\end{table}
\chapter{Chapter}
\section{Section}
\begin{longtable}{r>{\raggedright\arraybackslash}p{4.5cm}p{2.6cm}>{\raggedright\arraybackslash}p{6.9cm}}
\caption{Kings \& Queens} \label{Kings Queens} \\
\toprule
No. & Name \& Title & Dates & Events \\
\midrule
\endfirsthead
\caption*{\autoref{Kings Queens}: \textit{Continued.}} \\
\toprule
No. & Name \& Title & Dates & Events \\
\midrule
\endhead
1& King Soandso III & 2234 -- to date & This is some text \\
2& King Smith ``The Fatty Pig Eater'' & 2234 -- 3456 & yryuryrtyryereyeryeryer\\
3& King Soandso III & 234 -- 134 (?)& This is some text \\
4&&& This is some text \\ \bottomrule
\end{longtable}
\end{document}