How i can do if i want it in latex code of table of contents

I try to construct the table of content in latex but it have to in the form in this picture. How can i do it?

• Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – Reinstate Monica - M. Schröder Feb 25 '14 at 15:31
• Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. In particular, please consider constructing a minimal working example (MWE) so that folks have a good starting point. Presumably you're using \tableofcontents and you need help customizing it? – cmhughes Feb 25 '14 at 15:31
• You had included the tag writelatex. I removed it, but now I realize that it might have been intentional. Do you use the web service of writelatex.com ? If yes, I apologize for the incorrect re-taf, you just add the tag back. – yo' Feb 25 '14 at 17:30

1 Answer

Here's my attempt to emulate what you've created in Word (presumably) with some simple LaTeX code. This code example is what @chmhughes referred to as a minimal working example (MWE), which you should be able to compile.

There are a couple of things to note with this example:

1) This code shows you the basic workings of how to include sections and subsections in your content page. I have not created an exact copy of your ToC, but given you all the components to do it yourself.

2) I have left out the reference to the contents page in your contents page, as this is somewhat superfluous.

\documentclass[12pt,a4paper]{report}

\begin{document}

\pagenumbering{roman}
\chapter*{Thai Abstract}
\addcontentsline{toc}{chapter}{Thai Abstract}

\chapter*{English Abstract}
\addcontentsline{toc}{chapter}{English Abstract}

\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}

\tableofcontents
\newpage

\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\newpage

\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
\newpage

\pagenumbering{arabic}
\chapter{Introduction}
\section{Motivation and literature surveys}
\section{Research objective}
\section{Thesis overview}

\chapter{Example Chapter}
\section{Example section}
\subsection{Example subsection}
\subsubsection{Example subsubsection}

\end{document}


This should output something like this:

If you want to change the font and style of the contents page I suggest you look up this question on How to change fonts.

Writing your thesis in this template will require that you have everything in one document, which will be very ugly and confusing. I suggest you look at the \include command, as you can create several smaller documents e.g. one for the Thai Abstract, English Abstract etc. and use the \include{filename} command to call these documents into the contents page. Note that filename must be the name of the file you are calling e.g. \include{thaiabs} will call the thaiabs.tex file you have written your Thai Abstract in.

Therefore:

\documentclass[12pt,a4paper]{report}

\begin{document}

\pagenumbering{roman}
\include{thaiabs}
\include{engabs}
\include{acknowledgements}

\tableofcontents
\newpage

\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
\newpage

\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
\newpage

\pagenumbering{arabic}

\include{introduction}

\include{example}

\end{document}


thaiabs.tex file would contain:

\chapter*{Thai Abstract}
\addcontentsline{toc}{chapter}{Thai Abstract}

Type your abstract here.


engabs.tex file would contain:

\chapter*{English Abstract}
\addcontentsline{toc}{chapter}{English Abstract}

Type your abstract here.


introduction.tex file would contain:

\chapter{Introduction}
\section{Motivation and literature surveys}
\section{Research objective}
\section{Thesis overview}


example.tex file would contain:

\chapter{Example Chapter}
\section{Example section}
\subsection{Example subsection}
\subsubsection{Example subsubsection}