I'm trying to add a table of contents into my paper but it comes up with undefined control sequence everytime. I read online it may be a clash with some of the packages used in my preamble, so I'll give my preamble here.

\documentclass[a4paper,12pt]{amsart}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{ellipsis}
\usepackage{soul}
\usepackage{amsthm}
\usepackage{amsmath,amssymb}
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{caption}
\usepackage{rotating}
\usepackage{pdflscape}

\begin{document}

\tableofcontents


This results in the error undefined control sequence. l.14 \contentsfinish.

-
We may need more information, adding \section{test}\end{document} to your example, I have no compilation problems. Please post a full minimal example that display your problem. – daleif Apr 13 '12 at 8:27
Also note that it's recommendable, often even necessary to load hyperref at the end of your preamble, cf. tex.stackexchange.com/questions/1863/… – doncherry Apr 13 '12 at 8:29
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem – Marco Daniel Apr 13 '12 at 8:45
Thanks for the note with regards to hyperref. Something odd has happened, I copied and pasted the whole of my document to a new file and the table of contents worked fine, yet in my original file (which should be an EXACT copy) it still has the same error...?! – Izzy Apr 13 '12 at 9:51
Remove auxiliary files, such as the .toc and .aux files, and compile again. – Stefan Kottwitz Apr 13 '12 at 10:20
show 1 more comment

## closed as too localized by Stefan Kottwitz♦Apr 13 '12 at 11:17

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.