1

I am having trouble with the Table of contents and the list of figures: The title and the entries are showing on two pages. How do I remove the big space before apendix and vita.

\documentclass[]{report} 
\usepackage[md]{titlesec} 
\usepackage{subfiles}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[titles]{tocloft} 
\usepackage[tocindentauto]{tocstyle}
\usepackage{amsmath} 
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{gensymb} 
\usepackage{float} 
\usepackage{floatpag}
\floatpagestyle{plain}
\usepackage{listings} 
\usepackage[verbose]{cite} 
\usepackage{cleveref}
\usepackage{url}
\usepackage{breakurl}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{epstopdf}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@chapter}{\addtocontents{lof}{\protect\addvspace{10\p@}}}{}{}{}% LoF
\patchcmd{\@chapter}{\addtocontents{lot}{\protect\addvspace{10\p@}}}{}{}{}% LoT
\makeatother
\usepackage{pgfplots}
\usepackage{tikz}
\titleformat{\chapter}[display]{\centering\normalfont\large}{CHAPTER \arabic{chapter}}{0pt}{}{}
\titleformat*{\section}{\centering\bfseries\large}
\titleformat*{\subsection}{\bfseries\large}
\titleformat*{\subsubsection}{\normalfont\large}
\titlespacing*{\section}{0pt}{1\baselineskip}{0pt}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\titlespacing*{\subsubsection}{0pt}{2\baselineskip}{0pt}
\titlespacing{\paragraph}{0pt}{0pt}{1em}
\renewcommand{\cftpartleader}{\cftdotfill{\cftdotsep}} % for parts
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters
\setcounter{tocdepth}{3}%all headings must be displayed in ToC.
\setcounter{secnumdepth}{3}%numbers all headings; not actually required (can set to 0 instead of 3 if wanted)
\renewcommand{\contentsname}{}%this is a kludge; ignore it
\renewcommand{\listfigurename}{}
\renewcommand{\listtablename}{}
\renewcommand{\cftpartfont}{\normalsize\normalfont} %changes font of chapters & parts in ToC.  removes bold, for instance
\renewcommand{\cftchapfont}{\normalsize\normalfont}
\renewcommand{\cftpartpagefont}{\normalsize\normalfont}
\renewcommand{\cftchappagefont}{\normalsize\normalfont}
\cftsetindents{chapter}{.25in}{.25in}%indents the chapters & sections in the ToC
\cftsetindents{section}{.5in}{.25in}
\cftsetindents{subsection}{.75in}{.5in}
\cftsetindents{subsubsection}{1in}{.5in}
\renewcommand\cftsecafterpnum{\vskip-.5\baselineskip} %these make the ToC single spaced within chapters, but keep it double spaced elsewhere
\renewcommand\cftsubsecafterpnum{\vskip-.5\baselineskip}
\renewcommand\cftsubsubsecafterpnum{\vskip-.5\baselineskip}
\newenvironment{MyFigure}[1][]{\begin{figure}[#1]\vspace{\baselineskip}}{\vspace{\baselineskip}\end{figure}}
\doublespacing %double space
\raggedbottom
\begin{document}
    %DO NOT USE \maketitle
    \thispagestyle{empty}
    \renewcommand{\thepage}{\roman{page}}% lowercase roman numerals for pre-document stuff
    \chapter*{}
    \begin{center}
    \vfill
    Copyright \copyright\ 2017
        All Rights Reserved
    \vfill
    \end{center}
    \chapter*{ABSTRACT}
    \addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ABSTRACT}
    \large
    \paragraph{Test}

    \chapter*{ACKNOWLEDGMENTS}
    \addcontentsline{toc}{part}{\vspace{-.5\baselineskip}ACKNOWLEDGMENTS}
        %\subfile{sections/Acknowledge}

    \chapter*{DEDICATION}
    \addcontentsline{toc}{part}{\vspace{-.5\baselineskip}DEDICATION}
    %\subfile{sections/Dedication}

    \chapter*{TABLE OF CONTENTS}
    \vspace{-6\baselineskip}
    \tableofcontents

    \chapter*{LIST OF FIGURES}
    \vspace{-4\baselineskip}
    \listoffigures
    \addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF FIGURES}

    \chapter*{LIST OF SYMBOLS}
    %\vspace{-6\baselineskip}
    \addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF SYMBOLS}
    \subfile{sections/Los}

    \chapter*{LIST OF ABBREVIATIONS}
    %\vspace{-6\baselineskip}
    \addcontentsline{toc}{part}{\vspace{-.5\baselineskip}LIST OF ABBREVIATIONS}
    \subfile{sections/Loa}


    \cleardoublepage
    \cleardoublepage
    \large
    \clearpage
    \setcounter{page}{1}
    \renewcommand{\thepage}{\arabic{page}}% Arabic numerals, starting at 1, for the actual document


    \addtocontents{toc}{%
        \protect\contentsline{part}{.}{}}


\chapter{INTRODUCTION}
\label{Intro}
\section{Background}
\label{Backgrnd}
%\subfile{Sections/Background}

\section{Questions and Limitations}
\label{Quest}
%\subfile{Sections/quest}

\chapter{RELATED WORKS}
\label{RelWorks}
%\subfile{Sections/Relworks}

\chapter{METHODOLOGY}
\label{Method}
%\subfile{Sections/Methodology}

\chapter{RESULTS}
\label{Result}
\%subfile{Sections/Result}

\chapter{CONCLUSION}
\label{Conclusion}
%\subfile{Sections/conclusion}


\cleardoublepage
\addcontentsline{toc}{part}{\vspace{-.5\baselineskip}REFERENCES}
\cleardoublepage
\renewcommand\bibname{REFERENCES}
\setstretch{1} %this single spaces within bib entries, but keeps double spaces between entries

%\bibliography{ref}
%\bibliographystyle{IEEEtran}
%\nocite{*}
%\bibliographystyle{unsrt}

\addtocontents{toc}{%
    \protect\contentsline{part}{APPENDIX }{}}
\appendix
\titleformat{\chapter}[display]{\centering\normalfont\large}{APPENDIX  \Alph{chapter}}{0pt}{}{}
\titlespacing*{\chapter }{0pt}{250pt}{40pt}
\chapter{Equations }
\label{eqn}
%\subfile{Sections/Equation}
\clearpage
%\chapter[\vspace{-.5\baselineskip}FINAL APPENDIX TITLE]{ Equation}%the last appendix needs to be added strangely


\clearpage
\chapter*{VITA}
\addcontentsline{toc}{part}{VITA}
\large
%\subfile{Sections/Vita}
\end{document}

TOC: TOC

Appendix: Appendix

Werner
  • 603,163
JKJ
  • 161

1 Answers1

2

You mention in your preamble

\renewcommand{\contentsname}{}%this is a kludge; ignore it

This kludge is an issue. While it removes the titles of the ToC, it doesn't change the mechanism associated with printing these. Inherently, \tableofcontents is set as a \chapter* under the report document class. And these chapters are set on a clean page (executing \cleardoublepage before setting the chapter title). So, even though you say

\chapter*{TABLE OF CONTENTS}
\vspace{-6\baselineskip}
\tableofcontents

\tableofcontents still calls \chapter*{\contentsname}, which clears the current page. Instead, you probably want to

\renewcommand{\contentsname}{TABLE OF CONTENTS}

and set an appropriate \titlespacing to enforce your negative \vspace prior to setting the ToC. This way you can just call \tableofcontents and it will set the heading the way you want, together with the spacing and the actual ToC.

The same discussion above holds for \listfigurename/\listoffigures and \listtablename/\listoftables.


Immediately before setting your Appendix and Vita chapters, you change the chapter title format and spacing using the following:

\titleformat{\chapter}[display]{\centering\normalfont\large}{APPENDIX \Alph{chapter}}{0pt}{}{}
\titlespacing*{\chapter}{0pt}{250pt}{40pt}

Specifically, here's the definition of \titlespacing from the titlesec documentation (section 3.2 Spacing):

\titlespacing*{<command>}{<left>}{<before-sep>}{<after-sep>}[<right-sep>]

The starred version kills the indentation of the paragraph following the title, except in drop, wrap and runin where this possibility does not make sense.

  • <left> increases the left margin, except in the ...margin, and drop shape, where this parameter sets the title width, in wrap, the maximum width, and in runin, the indentation just before the title. With negative value the title overhangs.

  • <before-sep> is the vertical space before the title.

  • <after-sep> is the separation between title and text-vertical with hang, block, and display, and horizontal with runin, drop, wrap and ...margin. By making the value negative, you may define an effective space of less than \parskip.

  • The hang, block and display shapes have the possibility of increasing the <right-sep> margin with this optional argument.

You're explicitly setting <before-sep> to 250pt, which is very large. It is the cause behind your titles being pushed down to the bottom of the page on these \chapters.

Werner
  • 603,163