[Tex/LaTex] Latex – Table of contents appearing twice

table of contents

I am writing my Thesis document and I have Problem with table of Contents. It appears twice all the time. I tried many ways but could not get any help.

screenshot

\documentclass[a4paper, 12pt, oneside, BCOR1cm,toc=chapterentrywithdots]{article}
\usepackage{graphicx}
\begin{document}
\begin{titlepage}

{
    \begin{center}
        \raisebox{-1ex}{\includegraphics[scale=0.8]{University1.PNG}}
         \raisebox{-1ex}{\includegraphics[scale=0.7]{DOC.PNG}}
    \end{center}
    \vspace{0.5cm}
}

\begin{center}

\LARGE{\textbf{eksfhsufse sdsdgz hfszudfg sjhdgsdgs}}\\
\vspace{1cm}


\Large{\textbf{Master Thesis}}\\ 
\vspace{0.5cm}
Submitted in Fulfilment of the\\
Requirements for the Academic Degree\\
M.Sc.\\
\vspace{0.5cm}
Dept. of Computer Science\\
Chair of Computer Engineering
\end{center}
\vspace{3cm}
Submitted by: ajdadad\\
Student ID: bxdjhasdga\\
Date: 12.12.2016\\
\vspace{0.0cm}\\
Supervising tutor: jdjasda \\
(further supervisors)
\end{titlepage}

%---------------------------------------------------------
% Declaration
%---------------------------------------------------------

{Declaration}
%\blindtext
\\
%\textbf{Keywords: Keyword1, Keyword2, Keyword3, ...max 5}
\vspace{0.0mm}
%setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{0.0}
\begin{sloppypar}
my content 
\end{sloppypar}
\newpage

%---------------------------------------------------------
% Table of Contents, List of figures, List of Tables
%---------------------------------------------------------
\tableofcontents
\section{Introduction}
\section{Motivation}
\section{Theoritical Background}
\subsection{Development of Emissions legislation}
\subsection{Beginning of regulation for Exhaust Emissions}
\subsection{Current Emission regulations}
\subsection{Worldwide Harmonized Light vehicles Test cycle}
\subsection{Portable Emission Measurement system}
\subsection{Real-Drive Emissions}
\section{Software}
\subsection{INCA}
\subsection{Matlab/Simulink}
\subsection{Mil-Desk}
\subsection{Microsoft Visual Studio 2013}
\subsubsection{Programing language C}
\section{Conclusion}
\section{References}
\listoffigures
\listoftables
\end{document}

This is my code. Any help would be appreciable. Thanks in advance.

Best Answer

The table of contents (ToC) is showed only one time, just where it is your \tableofcontents code.

The \section{Introduction} is not the first line of the ToC, is the title of the first section in the main text. But without normal text among sections titles, the list of titles resemble a table of contents without number of pages. Just write some text among the \section and \subsection lines, e.g.:

\subsection{INCA}
The Inca Empire was the largest empire in pre-Columbian America.

And you will see the difference.

For a better understanding of the basics, is always better start with a minimal working example as:

\documentclass{article} 
\begin{document}
\tableofcontents 
\section{Introduction} 
    This is a little example.
\section{Motivation} 
    Light the way for who is in the dark.
\end{document}

mwe

Not enough clear? May be help a different ToC and colors. (Also help a lot comment each obscure code):

\documentclass{paper}         % Just for see a dotted ToC 
\usepackage{color}            % Just for see another color in the ToC 
\pagestyle{empty}             % Just for no head/foot distraction
\begin{document}              % This start the document
{\color{red}\tableofcontents} % This make a (one) ToC in red 
\color{blue}                  % This turn blue the following content in blue
\section{Introduction}        % This is already the contents !!
    This is a little example. % This is plain text  
\section{Motivation}          % This is another section title
    Light the way for who
 is in the dark.
\end{document}                % This is the end

mwe

Related Question