0

I am using document class book and adding list of tables and list of figure using code below in TOC

\cleardoublepage \addcontentsline{toc}{chapter}{List of Figures} \listoffigures \cleardoublepage \addcontentsline{toc}{chapter}{List of Tables} \listoftables

I want to remove the extra space from the top margin and space between title list of tables and where tables start, code

What is expected by the university is expected

2
  • There are two apporaches. You can use a package like titletoc or you can modify \l@table (which does the actual formatting). Feb 25 at 13:20
  • @JohnKormylo, I read the pdf for titletoc, but unable to figure out how to reduce the space, please can you assist with the command, that I read more on.
    – Roshni
    Feb 26 at 1:47

1 Answer 1

0

This assumes that the captions have no titles, just "Table 1:". Or they do allow titles but just didn't show them in the example. If not, then \l@table will have to ignore the title and just use \numberline (doable using saveboxes, but more complicated). Note that the margins (\leftskip and \rightskip) include the table and page numbers.

It turns out thet \@dottedtocline cannot add a right margin, so had to format everything. OTOH, the only thing I changed with \listoftables was to replace \chapter*{\listtablename}.

\documentclass{book}
\usepackage{showframe}

\renewcommand\thetable{\arabic{table}}% as opposed to 1.1, 1.2 etc.

\makeatletter
\renewcommand*\l@table[2]{% #1 = title (with \numberline), #2 = page
  \def\numberline##1{\leavevmode\llap{Table~##1: }}%
  \leftskip=0.5in% left margin
  \rightskip=0.75in% right margin
  {#1}\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill% dotted line
  \rlap{ #2}\par}

\renewcommand\listoftables{%
    \if@twocolumn% probably not needed
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    %\chapter*{\listtablename}% defalt title
    \null\vskip\baselineskip
    \noindent\parbox{\textwidth}{\centering
      LIST OF TABLES\\
      \vskip\baselineskip
      (There is no bold or italics text on LOT)}\par
    \null\hfill\makebox[0.75in][l]{ PAGE}\par
      \thispagestyle{plain}%
      \@mkboth{% sets header
          \MakeUppercase\listtablename}%
         {\MakeUppercase\listtablename}%
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
    }
\makeatother

\begin{document}
\frontmatter
\cleardoublepage \addcontentsline{toc}{chapter}{List of Tables}% add to toc
\listoftables

\mainmatter
\chapter{Start}
Some text.

\begin{table}[ht]
  \caption{}
\end{table}

\begin{table}[ht]
  \caption{}
\end{table}
    
\end{document}
1
  • If you are required to use double spacing for the entire document, you will need the setspace package and may need to revise the spacing. I find it amusing that universities go to such lengths to make it look like dissertations are still being cranked out on mechanical typewriters (or MS wprd). Feb 26 at 14:17

You must log in to answer this question.

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