[Tex/LaTex] Creating List of Equations

equationstable of contents

I want to create list of equations, I used:

\documentclass[final]{york-thesis}

\usepackage{tocloft}

\begin{document}

\makefrontmatter

\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

\listofmyequations

\input{Chapter1}
\input{Chapter2}
\input{Chapter3}
\input{Chapter4}

\end{document}

It created the list of equations, but I have three issues:

  1. The Table of Content, List of Tables, List of Figures (which are automatically generated by the latex template file) is not starting at the beginning of the page as they were before this command.
  2. List of Tables, List of Figures were included in the Table of Content before but now they disappear.
  3. I would like to add also List of Equations to the Table of Content.

Below is part of cls file where I guess is related of the construction of the Table of Content, I hope it helps figuring out why the Table of Content, List of Tables and List of Figures are not starting at the beginning of pages.

\newboolean{hasfigures}\setboolean{hasfigures}{false}
\newboolean{hastables}\setboolean{hastables}{false}
\newboolean{masters}\setboolean{masters}{false}
\newcommand{\spacing}[1]{\renewcommand{\baselinestretch}{#1}%
\large\normalsize}


\renewcommand\contentsname{Table of Contents}
\renewcommand\listfigurename{List of Figures}
\renewcommand\listtablename{List of Tables}
\renewcommand\bibname{Bibliography}
\newcommand{\contentsheader}[2] { \addtocontents{#1} {
  \centerline{\underline{#2}\protect\hfill%
    \underline{Page}}}}
\renewcommand\tableofcontents { \chapter*{\contentsname}
\addcontentsline{toc}{chapter}{Table of Contents}
\@starttoc{toc}}
\renewcommand\listoffigures { \chapter*{\listfigurename}
\addcontentsline{toc}{chapter}{List of Figures}
\@starttoc{lof}}
\renewcommand\listoftables { \chapter*{\listtablename}
\addcontentsline{toc}{chapter}{List of Tables}
\@starttoc{lot}}


\tableofcontents
\ifthenelse{\boolean{hastables}}{\listoftables}{}
\ifthenelse{\boolean{hasfigures}}{\listoffigures}{}
\@ifdefined{@prefacefile}{\makepreface}
\@ifdefined{@abbreviationsfile}{\makeabbreviations}
\newpage
\pagenumbering {arabic}
\setcounter {page}{1}}

Best Answer

The described issue isn't seen in this example. I've added \usepackage{tocbibind} for including of ToC etc. into ToC and added the LoE to the ToC as well.

However, the manual usage of \myequation is error-prone and isn't recommended!

\documentclass[final]{york-thesis}

\usepackage{tocbibind}
\usepackage{tocloft}
\usepackage{xpatch}


\begin{document}

\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

\xpretocmd{\listofmyequations}{\addcontentsline{toc}{chapter}{\listequationsname}}{}{}

\tableofcontents

%\makefrontmatter % can't use this command due to erros


\clearpage
\listofmyequations

\chapter{First chapter}

\section{First section}

\begin{equation}
E=mc^2 
\end{equation}
\myequations{Some equation}

%\input{Chapter1}
%\input{Chapter2}
%\input{Chapter3}
%\input{Chapter4}

\end{document}

enter image description here