## Table of content issue

Hi,

I was wondering if anyone could please help me with the following problem I am having using SW:

When I try compiling the following code through PDF preview in scientific workplace, instead of getting my content page as in the attached PDF Test, I get the content page on the very first page of my document as in the attached  Untitled1.pdf.

Code:

\documentclass{article}

\begin{document}

\section{A test section}
Some text\ldots

\subsection{A test subsection}
Some text\ldots

\newpage

\tableofcontents

\newpage

And here's the text that should come on the page after the one containing TOC.

\end{document}

Many thanks.

Regards,

Bouba

AttachmentSize
Test.pdf37.75 KB
Untitled1.pdf37.71 KB

### When SW opens the document it

When SW opens the document it sees the \tableofcontents command as a front matter element and moves this macro to the front matter.  It keep the \tableofcontents command in the body of the document you will need to place the command inside an encapsulated TeX field.  Use Insert, Typeset Object, TeX Field and turn on the Encapsulated check box.

You could also replace \tableofcontents with: