2

Apologies for the large amount of code, but I can't track this issue down.

I have a few regular tables in my document, as well as a longtable. For some reason, the List of Tables leaves a space before the longtable and labels it "1" when, logically, it should be "4".

Thanks for looking into this.

enter image description here

% 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}
  • The space is the default since \chapter uses something like \addtocontents{lot}{\addvspace{10pt}} (effectively) for book and apparently for bookest class too –  Feb 27 '17 at 17:32
  • Crosspost from http://latex-community.org/forum/viewtopic.php?f=45&t=29231 –  Feb 27 '17 at 21:56

2 Answers2

1

The table counter is on the reset list of chapter and there is no individuallongtable` counter.

If there should be no reset, e.g. use \RemoveFromReset from the xassoccnt package.

The space between table entries from different chapters is added by the \@chapter command actually.

It uses

\addtocontents{lot}{\protect\addvspace{10\p@}}%

there.If this is not wanted, use something like

\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}

enter image description here

0

The numbering issue comes from the fact that tables are usually numbered chapter by chapter (and has nothing to do with the fact that your fourth table is a longtable and not a table.

If you want continuous numbering, you can use

\usepackage{chngcntr}
\counterwithout{table}{chapter}

About the spacing in the list of tables, you can use Gonzalo Medina's answer to spacing between chapters in list of tables it seems to work fine here.

mvienney
  • 986