3

tocloft seems to automatically add extra space between table entries from different chapters. I want a single space between all the entries in the list of tables. Right now I have one space between entries from the same chapter and two spaces between those from different chapters. Here's a MWE of what I have.

\documentclass[11pt, letterpaper]{thesis}

\usepackage[lmargin=1.5in, rmargin=1.0in, tmargin=2.0in, bmargin=1.0in]{geometry}


\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}} 

\usepackage{tocloft}
\addtocontents{lot}{Table \hfill\ {Page} \par}

\usepackage{titlesec}
\usepackage{caption}
\usepackage{ctable}
\usepackage{tabularx}


\begin{document}


% List of Tables

\renewcommand{\cftlottitlefont}{\normalfont}
\renewcommand\listtablename{\centerline{TABLES}}
\renewcommand{\cfttabaftersnum}{.}
\setlength{\cfttabindent}{0pt}
\setlength\cftbeforechapskip{0pt}
\setlength\cftbeforetabskip{11pt}

\listoftables

% End List of Tables


\chapter{Chapter One}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 1.1.}
\end{table}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 1.2.}
\end{table}


\chapter{Chapter Two}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 2.1.}
\end{table}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 2.2.}
\end{table}

\end{document}

I use \setlength\cftbeforechapskip{0pt}, but this seems to have no effect. I did find this: How to change the line spacing in my list of figures? and tried some of the suggestions but none seemed to work for me. Any ideas?

1
  • That space is not produced by tocloft but by the class used; can we see the definition of \@chapter of your document class? Commented Aug 29, 2012 at 16:52

1 Answer 1

6

That space is not produced by tocloft but by the class used, usually in the definition of \@chapter (at least in the standard classes); one possible solution would be to redefine this command to suppress the additional spacing; the code below shows this redefinition for the standard class book (the lines adding space to the LoF and LoT were commented out and marked with %NEW):

\documentclass[11pt, letterpaper]{book}

\usepackage[lmargin=1.5in, rmargin=1.0in, tmargin=2.0in, bmargin=1.0in]{geometry}


\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}} 

\usepackage{tocloft}
\addtocontents{lot}{Table \hfill\ {Page} \par}

\usepackage{titlesec}
\usepackage{caption}
\usepackage{ctable}
\usepackage{tabularx}

\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter}#1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
%                    \addtocontents{lof}{\protect\addvspace{10\p@}}% NEW
%                    \addtocontents{lot}{\protect\addvspace{10\p@}}% NEW
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\makeatother

\begin{document}


% List of Tables

\renewcommand{\cftlottitlefont}{\normalfont}
\renewcommand\listtablename{\centerline{TABLES}}
\renewcommand{\cfttabaftersnum}{.}
\setlength{\cfttabindent}{0pt}
\setlength\cftbeforechapskip{0pt}
\setlength\cftbeforetabskip{11pt}

\listoftables

% End List of Tables


\chapter{Chapter One}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 1.1.}
\end{table}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 1.2.}
\end{table}


\chapter{Chapter Two}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 2.1.}
\end{table}

\begin{table}[htbp] 
  \centering
    \begin{tabular}{lll}
    \toprule
    & Col 1 & Col 2 \\
    \midrule
    Row 1 & 11 & 12 \\
    Row 2 & 21 & 22 \\
    \bottomrule
    \end{tabular}
  \caption{This is table 2.2.}
\end{table}

\end{document}

Since you are usinga non-standard class, the above silution might not be appropriate for you; in that case, we will need to see how your class is adding this space.

4
  • Thanks, this works. I went into the thesis.cls file and used that code for chapter definition in place of the code you had. I just commented out the lines that had to do with lof and lot, just as you did for the book document class.
    – COM
    Commented Aug 29, 2012 at 17:37
  • @COM it's not the best practice to directly edit a .cls file; instead, you can copy in your .tex file the relevant part of the code inside \makeatletter, \makeatother as I did in my example code and permorm the changes there. Commented Aug 29, 2012 at 17:50
  • @ Gonzalo Medina, I actually did copy the code out of the .cls file and used \makeatletter and \makeatother. Sorry for not making that clear in my comment.
    – COM
    Commented Aug 29, 2012 at 18:04
  • Thanks a lot! I was searching for a solution while using the tocloft package with the book class and couldn't find any. This worked perfectly, and is also explained very well. Commented Dec 13, 2021 at 16:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .