\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\begin{document}
\tableofcontents
\newpage
\section*{First Section}
some text
\addcontentsline{toc}{section}{\rightmark}
\section*{Second Section}
\subsection*{First Subsection}
more text
\end{document}
Thanks.
Last edited by sombrancelha on Tue Jun 22, 2010 10:43 pm, edited 1 time in total.
Writing the name of the section in the \addcontentsline command would be exhaustive and boring in a long document as mine. What I've done is define \Section (I've also formatted to suit my needs) and use it instead:
\newcommand{\Section}[1]{\clearpage % put new chapters on a new page
\refstepcounter{section} % manually increment the chapter number
% manually add the chapter to the table of contents
\addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}
% and now format the header according to spec.
\begin{center}
\LARGE\scshape{#1}
\vspace*{12pt}
\end{center}
}
\newcommand{\Section}[1]{\clearpage % put new chapters on a new page
\refstepcounter{section} % manually increment the chapter number
% manually add the chapter to the table of contents
\addcontentsline{toc}{section}{#1}
% and now format the header according to spec.
\begin{center}
\LARGE\scshape{#1}
\vspace*{12pt}
\end{center}
}
That should remove the section numbers from the ToC.