# List of Appendices in ToC

I am trying to add my List of Figures to my (ShareLaTeX) document, but it wont appear in my Table of Content. Here are my code:

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

\maketitle
\thispagestyle{empty}
\newpage

\section*{Abstract}

\section*{Introduction}

\newpage
\tableofcontents

\listoffigures

\listoftables
\newpage

\pagenumbering{arabic} ´

%Several sections here

\newpage
\appendix
\section{Appendix A}
\subsection{Appendix name}

\end{document}


So, my goal is to get something like this:

I already have the Figures and Tables, but I will also want to have the List of Equations and Appendices. Any help?

Regardless of how you create your contents tables, the following provides a means for insertion of ad-hoc content related to \sections within your document.

\documentclass{article}

\usepackage{xparse}
\newcommand{\setsectiontocentry}[1]{\def\sectiontocentry{#1}}
\let\oldsection\section
\makeatletter
\RenewDocumentCommand{\section}{ s o m }{%
\IfBooleanTF{#1}
{% \section*
\oldsection*{#3}%
\IfValueTF{#2}
{\@ifundefined{sectiontocentry}
\let\sectiontocentry\relax
}
%\ifcsname sectiontocentry\endcsname
%\sectiontocentry
%\else
%#3%
%\fi
%}%
%\let\sectiontocentry\relax
%}% \section*{..}
}
{% \section
\IfValueTF{#2}
{\oldsection[#2]{#3}}% \section[.]{..}
{\oldsection{#3}}% \section{..}
}%
}
\makeatother

\begin{document}

\section*{Abstract}

\section*{Introduction}

\clearpage

\setsectiontocentry{ToC}
\tableofcontents

\setsectiontocentry{Figures}
\listoffigures

\listoftables

\clearpage
\pagenumbering{arabic}

\section{First section}
\section{Second section}
\section*[THIRD SECTION]{Third section}
\section{Last section}

\clearpage
\appendix
\section{First appendix}
\section{Second appendix}

\end{document}


Fundamentally, \section* commands don't make it into the ToC, nor does it allow for using an optional argument under \section*. The above preamble setup redefines the way \section functions to allow for the starred version \section* to have an optional argument and also insert that content into the ToC.

This works if you have access to \section, which you do in general. However, when you call \tableofcontents (and the like), a \section call is made on your behalf. For that, I've defined \setsectiontocentry{<section toc>} that will grab and place the appropriate <section toc> entry. Hopefully this is visualized in the above example.