Graphics, Figures & TablesDuplicate of TOC

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Vanvic
Posts: 2
Joined: Thu Mar 14, 2013 7:59 pm

Duplicate of TOC

Post by Vanvic »

Hello friends.

I'm having a problem with the Table of contents. Each time it appears twice in my pdf document :( Can anyone help me sort this out? Thanks a lot

I have done the following:

Code: Select all

\newpage
\tableofcontents
\section{Management-\textit{The definition}}
\section{Management-the history}
\section{Analysis}
P.S: I'm new to Latex.
Last edited by cgnieder on Thu Mar 14, 2013 8:48 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Duplicate of TOC

Post by cgnieder »

Hi Vanvic,

welcome to the LaTeX community!
Vanvic wrote:[...] Each time [the table of contents] appears twice in my pdf document [...]

Code: Select all

\newpage
\tableofcontents
\section{Management-\textit{The definition}}
\section{Management-the history}
\section{Analysis}
This is not caused by only the code you posted as you can verify easily:

Code: Select all

\documentclass{article}

\begin{document}

\newpage
\tableofcontents
\section{Management-\textit{The definition}}
\section{Management-the history}
\section{Analysis}

\end{document}
So please post a complete Infominimal working example starting with \documentclass and ending with \end{document} similar to the one I just posted. We will then be able to reproduce the issue and hopefully be able to figure out what causes it.

Regards
site moderator & package author
Vanvic
Posts: 2
Joined: Thu Mar 14, 2013 7:59 pm

Duplicate of TOC

Post by Vanvic »

Hello Cgnieder.

Thanks a lot for the reply. :D

I wrote:

Code: Select all

\documentclass[12 pt]{article}
\usepackage{graphicx}
\begin{document}
\title{\textbf{ROLE OF MANAGERS}:\\assignment for the Organisation and Management module}
\author{Vanvic}
\maketitle

\newpage
\tableofcontents
\addtocontents{toc}{\protect\rule{\textwidth}{.2pt}\par}
\section{Management-\textit{The definition}}
\section{Management-The history}
\section{Analysis}
\end{document}
I don't know what's the problem with that.

Thanks again for helping :)
Last edited by cgnieder on Thu Mar 14, 2013 10:11 pm, edited 1 time in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Duplicate of TOC

Post by cgnieder »

But this does not produce two tables of contents! Open your code in writeLaTeX (follow the link above the code) to verify.

If you really have two tables of contents you have to be doing something else, too.

Regards
site moderator & package author
Post Reply