2

This was my first attempt at Latex. I am using LaTeXila. I fail to understand why my table of contents reproduces my entire report and then assigns it a page number:

Contents
0.1 1 A bin of 50 manufactured parts contain three defective parts and 47 non-defective parts. ... Implement Bubble sort and Randomized Quicksort and make a comparative report of their performance . . . . . . . . . . . . . . . . . . . . . 2

The 'code' part:

\begin{document}

\maketitle{}  
\tableofcontents{  
\begin {enumerate}  
\item {question 1}\item {question 2}\item {question 3}\item {question 4}  
\end{enumerate}}  

%\chapter{Assignment}  
\begin{section} {1 A bin of 50 manufactured parts contain three defective parts and 47 non-defective parts. ... Implement Bubble sort and Randomized Quicksort and make a comparative report of their performance }   
\end{section}  
\end{document}

1 Answer 1

4

\maketitle \tableofcontents and \item do not take {...} arguments, and \section is not an environment. I think you want something like this:

enter image description here

\documentclass{report}



\title{hmm}
\author{me}
\begin{document}

\maketitle
\tableofcontents

\clearpage

\begin {enumerate}
\item question 1
\item question 2
\item question 3
\item question 4
\end{enumerate}

\chapter{Assignment}
\section{something}
 1 A bin of 50 manufactured parts contain three defective parts and 47 non-defective parts. ... Implement Bubble sort and Randomized Quicksort and make a comparative report of their performance 

\end{document}
2
  • Works great! I don't want to see that 'Chapter 1' written over there. How to get rid of that? (you might have noticed I have commented that line in my code)
    – pnp
    Commented Sep 3, 2012 at 11:36
  • 1
    If you don't want it to be in chapter 1 delete the \chapter command. (If you don't want chapters at all use \documentcass{article} not report as then teh top level sectioning unit is section. Commented Sep 3, 2012 at 11:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .